diff --git a/.buildkite/scripts/steps/checks/telemetry.sh b/.buildkite/scripts/steps/checks/telemetry.sh index 073f1fbaaff02..a767ba2a003cb 100755 --- a/.buildkite/scripts/steps/checks/telemetry.sh +++ b/.buildkite/scripts/steps/checks/telemetry.sh @@ -5,4 +5,10 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check Telemetry Schema -node scripts/telemetry_check + +if is_pr && ! is_auto_commit_disabled; then + node scripts/telemetry_check --fix + check_for_changed_files "node scripts/telemetry_check" true +else + node scripts/telemetry_check +fi diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2f64a12a39581..1bf4354a52401 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -337,7 +337,6 @@ packages/kbn-dev-proc-runner @elastic/kibana-operations packages/kbn-dev-utils @elastic/kibana-operations packages/kbn-discover-contextual-components @elastic/obs-ux-logs-team @elastic/kibana-data-discovery packages/kbn-discover-utils @elastic/kibana-data-discovery -packages/kbn-doc-links @elastic/docs packages/kbn-docs-utils @elastic/kibana-operations packages/kbn-dom-drag-drop @elastic/kibana-visualizations @elastic/kibana-data-discovery packages/kbn-ebt-tools @elastic/kibana-core @@ -623,6 +622,7 @@ packages/shared-ux/storybook/config @elastic/appex-sharedux packages/shared-ux/storybook/mock @elastic/appex-sharedux packages/shared-ux/table_persist @elastic/appex-sharedux src/core @elastic/kibana-core +src/platform/packages/shared/kbn-doc-links @elastic/docs src/plugins/advanced_settings @elastic/appex-sharedux @elastic/kibana-management src/plugins/ai_assistant_management/selection @elastic/obs-ai-assistant src/plugins/bfetch @elastic/appex-sharedux diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index fde70b5ffca0e..a2af3b91931af 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -187,7 +187,7 @@ this setting stores part of the URL in your browser session to keep the URL short. [[theme-darkmode]]`theme:darkMode`:: -The UI theme that the {kib} UI should use. +deprecated:[9.0.0] The UI theme that the {kib} UI should use. Set to `enabled` or `disabled` to enable or disable the dark theme. Set to `system` to have the {kib} UI theme follow the system theme. You must refresh the page to apply the setting. diff --git a/docs/upgrade-notes.asciidoc b/docs/upgrade-notes.asciidoc index 236d768b16d4e..effe1308408cc 100644 --- a/docs/upgrade-notes.asciidoc +++ b/docs/upgrade-notes.asciidoc @@ -23,8 +23,8 @@ ADD INSTRUCTIONS FOR USERS LOOKING TO UPGRADE. HOW CAN THEY WORK AROUND THIS? 1. Copy and edit the template in the right section of this file. Most recent entries should be at the top of the section, search for sections using the text "[float]". 2. Edit the anchor ID [[REPO-PR]] of the template with proper values. 3. Don't hardcode the link to the new entry. Instead, make it available through the doc link service files: - - https://github.com/elastic/kibana/blob/main/packages/kbn-doc-links/src/get_doc_links.ts - - https://github.com/elastic/kibana/blob/main/packages/kbn-doc-links/src/types.ts + - https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts + - https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-doc-links/src/types.ts The entry in the main links file should look like this: diff --git a/examples/developer_examples/public/app.tsx b/examples/developer_examples/public/app.tsx index 0f0c0e4429356..0e915eeccf1ec 100644 --- a/examples/developer_examples/public/app.tsx +++ b/examples/developer_examples/public/app.tsx @@ -28,6 +28,7 @@ import { AppMountParameters, I18nStart, ThemeServiceStart, + UserProfileService, } from '@kbn/core/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import { ExampleDefinition } from './types'; @@ -36,6 +37,7 @@ interface StartServices { analytics: Pick; i18n: I18nStart; theme: Pick; + userProfile: UserProfileService; } interface Props { diff --git a/examples/developer_examples/public/plugin.ts b/examples/developer_examples/public/plugin.ts index b7f676ad9a71a..478da722775a5 100644 --- a/examples/developer_examples/public/plugin.ts +++ b/examples/developer_examples/public/plugin.ts @@ -28,10 +28,10 @@ export class DeveloperExamplesPlugin implements Plugin coreStart.application.navigateToApp(appId), getUrlForApp: (appId: string) => coreStart.application.getUrlForApp(appId), diff --git a/examples/routing_example/public/services.ts b/examples/routing_example/public/services.ts index 7ec7d408c1b6b..ac6bfbc5f1690 100644 --- a/examples/routing_example/public/services.ts +++ b/examples/routing_example/public/services.ts @@ -12,6 +12,7 @@ import type { CoreStart, I18nStart, ThemeServiceStart, + UserProfileService, } from '@kbn/core/public'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import { @@ -25,6 +26,7 @@ interface StartServices { analytics: Pick; i18n: I18nStart; theme: Pick; + userProfile: UserProfileService; } export interface Services { @@ -37,8 +39,8 @@ export interface Services { } export function getServices(core: CoreStart): Services { - const { analytics, i18n, theme } = core; - const startServices = { analytics, i18n, theme }; + const { analytics, i18n, theme, userProfile } = core; + const startServices = { analytics, i18n, theme, userProfile }; return { startServices, diff --git a/examples/ui_action_examples/public/hello_world_action.tsx b/examples/ui_action_examples/public/hello_world_action.tsx index 7597ec75a2fe0..52a808ed48641 100644 --- a/examples/ui_action_examples/public/hello_world_action.tsx +++ b/examples/ui_action_examples/public/hello_world_action.tsx @@ -14,7 +14,7 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; export const ACTION_HELLO_WORLD = 'ACTION_HELLO_WORLD'; -type StartServices = Pick; +type StartServices = Pick; export const createHelloWorldActionDefinition = ( getStartServices: () => Promise diff --git a/examples/ui_actions_explorer/public/hello_world_example.tsx b/examples/ui_actions_explorer/public/hello_world_example.tsx index bcf4ed7e24fe5..33b201e83adcf 100644 --- a/examples/ui_actions_explorer/public/hello_world_example.tsx +++ b/examples/ui_actions_explorer/public/hello_world_example.tsx @@ -19,7 +19,7 @@ const DYNAMIC_ACTION_ID = `${ACTION_HELLO_WORLD}-Waldo`; interface Props { uiActionsStartService: UiActionsStart; - startServices: Pick; + startServices: Pick; } export const HelloWorldExample = ({ uiActionsStartService, startServices }: Props) => { diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 210ecb6fa266f..320730edc972e 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -349,18 +349,6 @@ "description": "WARNING: When you delete a connector, it cannot be recovered.", "operationId": "delete-actions-connector-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -394,18 +382,6 @@ "get": { "operationId": "get-actions-connector-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "An identifier for the connector.", "in": "path", @@ -419,7 +395,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -479,18 +455,6 @@ "post": { "operationId": "post-actions-connector-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -513,7 +477,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -548,7 +512,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -608,18 +572,6 @@ "put": { "operationId": "put-actions-connector-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -642,7 +594,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -672,7 +624,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -735,18 +687,6 @@ "description": "You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems.", "operationId": "post-actions-connector-id-execute", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -769,7 +709,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -789,7 +729,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -852,18 +792,6 @@ "description": "You do not need any Kibana feature privileges to run this API.", "operationId": "get-actions-connector-types", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases).", "in": "query", @@ -884,20 +812,7 @@ "/api/actions/connectors": { "get": { "operationId": "get-actions-connectors", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": {}, "summary": "Get all connectors", "tags": [ @@ -909,18 +824,6 @@ "delete": { "operationId": "delete-alerting-rule-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -963,18 +866,6 @@ "get": { "operationId": "get-alerting-rule-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The identifier for the rule.", "in": "path", @@ -988,7 +879,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -1844,18 +1735,6 @@ "post": { "operationId": "post-alerting-rule-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -1878,7 +1757,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -2174,7 +2053,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -3030,18 +2909,6 @@ "put": { "operationId": "put-alerting-rule-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -3064,7 +2931,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -3343,7 +3210,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -4204,18 +4071,6 @@ "post": { "operationId": "post-alerting-rule-id-disable", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4238,7 +4093,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -4278,18 +4133,6 @@ "post": { "operationId": "post-alerting-rule-id-enable", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4334,18 +4177,6 @@ "post": { "operationId": "post-alerting-rule-id-mute-all", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4390,18 +4221,6 @@ "post": { "operationId": "post-alerting-rule-id-unmute-all", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4446,18 +4265,6 @@ "post": { "operationId": "post-alerting-rule-id-update-api-key", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4505,18 +4312,6 @@ "post": { "operationId": "post-alerting-rule-rule-id-alert-alert-id-mute", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4570,18 +4365,6 @@ "post": { "operationId": "post-alerting-rule-rule-id-alert-alert-id-unmute", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4635,18 +4418,6 @@ "get": { "operationId": "get-alerting-rules-find", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The number of rules to return per page.", "in": "query", @@ -4793,7 +4564,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -5649,18 +5420,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "get-dashboards-dashboard", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The page number to return. Default is \"1\".", "in": "query", @@ -5687,7 +5446,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -5836,18 +5595,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "delete-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -5879,18 +5626,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "get-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A unique identifier for the dashboard.", "in": "path", @@ -5904,7 +5639,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -6539,18 +6274,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "post-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -6573,7 +6296,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -7108,7 +6831,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -7715,18 +7438,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "put-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -7749,7 +7460,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -8278,7 +7989,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -8885,24 +8596,11 @@ "/api/fleet/agent_download_sources": { "get": { "operationId": "get-fleet-agent-download-sources", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -8962,7 +8660,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -8994,18 +8692,6 @@ "post": { "operationId": "post-fleet-agent-download-sources", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -9019,7 +8705,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9055,7 +8741,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9100,7 +8786,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -9135,18 +8821,6 @@ "description": "Delete an agent binary download source by ID.", "operationId": "delete-fleet-agent-download-sources-sourceid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -9169,7 +8843,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9187,7 +8861,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -9220,18 +8894,6 @@ "description": "Get an agent binary download source by ID.", "operationId": "get-fleet-agent-download-sources-sourceid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "sourceId", @@ -9244,7 +8906,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9289,7 +8951,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -9322,18 +8984,6 @@ "description": "Update an agent binary download source by ID.", "operationId": "put-fleet-agent-download-sources-sourceid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -9355,7 +9005,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9391,7 +9041,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9436,7 +9086,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -9470,18 +9120,6 @@ "get": { "operationId": "get-fleet-agent-policies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -9578,7 +9216,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -10287,7 +9925,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -10319,18 +9957,6 @@ "post": { "operationId": "post-fleet-agent-policies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -10352,7 +9978,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -10603,7 +10229,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -11297,7 +10923,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -11331,18 +10957,6 @@ "post": { "operationId": "post-fleet-agent-policies-bulk-get", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -11368,7 +10982,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -11398,7 +11012,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12095,7 +11709,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -12130,18 +11744,6 @@ "description": "Delete an agent policy by ID.", "operationId": "post-fleet-agent-policies-delete", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -12155,7 +11757,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12178,7 +11780,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12200,7 +11802,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -12235,18 +11837,6 @@ "description": "Get a list of outputs associated with agent policies.", "operationId": "post-fleet-agent-policies-outputs", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -12260,7 +11850,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12283,7 +11873,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12385,7 +11975,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -12420,18 +12010,6 @@ "description": "Get an agent policy by ID.", "operationId": "get-fleet-agent-policies-agentpolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentPolicyId", @@ -12456,7 +12034,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -13150,7 +12728,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -13183,18 +12761,6 @@ "description": "Update an agent policy by ID.", "operationId": "put-fleet-agent-policies-agentpolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -13228,7 +12794,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -13479,7 +13045,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -14173,7 +13739,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -14208,18 +13774,6 @@ "description": "Copy an agent policy by ID.", "operationId": "post-fleet-agent-policies-agentpolicyid-copy", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -14253,7 +13807,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -14276,7 +13830,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -14970,7 +14524,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15005,18 +14559,6 @@ "description": "Download an agent policy by ID.", "operationId": "get-fleet-agent-policies-agentpolicyid-download", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentPolicyId", @@ -15053,7 +14595,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "type": "string" } @@ -15062,7 +14604,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15087,7 +14629,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15122,18 +14664,6 @@ "description": "Get a full agent policy by ID.", "operationId": "get-fleet-agent-policies-agentpolicyid-full", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentPolicyId", @@ -15170,7 +14700,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -15625,7 +15155,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15660,18 +15190,6 @@ "description": "Get a list of outputs associated with agent policy by policy id.", "operationId": "get-fleet-agent-policies-agentpolicyid-outputs", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentPolicyId", @@ -15684,7 +15202,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -15783,7 +15301,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15817,18 +15335,6 @@ "get": { "operationId": "get-fleet-agent-status", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "policyId", @@ -15867,7 +15373,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -15930,7 +15436,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15964,18 +15470,6 @@ "get": { "operationId": "get-fleet-agent-status-data", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "agentsIds", @@ -16023,7 +15517,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16061,7 +15555,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -16095,18 +15589,6 @@ "get": { "operationId": "get-fleet-agents", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -16193,7 +15675,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16614,7 +16096,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -16646,18 +16128,6 @@ "post": { "operationId": "post-fleet-agents", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -16671,7 +16141,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16693,7 +16163,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16714,7 +16184,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -16748,18 +16218,6 @@ "get": { "operationId": "get-fleet-agents-action-status", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -16807,7 +16265,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16949,7 +16407,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -16983,18 +16441,6 @@ "post": { "operationId": "post-fleet-agents-actions-actionid-cancel", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17017,7 +16463,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17090,7 +16536,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17123,24 +16569,11 @@ "/api/fleet/agents/available_versions": { "get": { "operationId": "get-fleet-agents-available-versions", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17161,7 +16594,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17195,18 +16628,6 @@ "post": { "operationId": "post-fleet-agents-bulk-reassign", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17220,7 +16641,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17260,7 +16681,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17278,7 +16699,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17312,18 +16733,6 @@ "post": { "operationId": "post-fleet-agents-bulk-request-diagnostics", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17337,7 +16746,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17378,7 +16787,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17396,7 +16805,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17430,18 +16839,6 @@ "post": { "operationId": "post-fleet-agents-bulk-unenroll", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17455,7 +16852,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17501,7 +16898,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17519,7 +16916,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17553,18 +16950,6 @@ "post": { "operationId": "post-fleet-agents-bulk-update-agent-tags", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17578,7 +16963,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17626,7 +17011,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17644,7 +17029,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17678,18 +17063,6 @@ "post": { "operationId": "post-fleet-agents-bulk-upgrade", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17703,7 +17076,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17759,7 +17132,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17777,7 +17150,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17812,18 +17185,6 @@ "description": "Delete a file uploaded by an agent.", "operationId": "delete-fleet-agents-files-fileid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17846,7 +17207,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17868,7 +17229,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17903,18 +17264,6 @@ "description": "Get a file uploaded by an agent.", "operationId": "get-fleet-agents-files-fileid-filename", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "fileId", @@ -17935,7 +17284,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "type": "object" } @@ -17944,7 +17293,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17977,24 +17326,11 @@ "/api/fleet/agents/setup": { "get": { "operationId": "get-fleet-agents-setup", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "A summary of the agent setup status. `isReady` indicates whether the setup is ready. If the setup is not ready, `missing_requirements` lists which requirements are missing.", @@ -18046,7 +17382,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18078,18 +17414,6 @@ "post": { "operationId": "post-fleet-agents-setup", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -18104,7 +17428,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "A summary of the result of Fleet's `setup` lifecycle. If `isInitialized` is true, Fleet is ready to accept agent enrollment. `nonFatalErrors` may include useful insight into non-blocking issues with Fleet setup.", @@ -18143,7 +17467,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18177,18 +17501,6 @@ "get": { "operationId": "get-fleet-agents-tags", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "kuery", @@ -18210,7 +17522,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -18231,7 +17543,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18266,18 +17578,6 @@ "description": "Delete an agent by ID.", "operationId": "delete-fleet-agents-agentid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -18300,7 +17600,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -18321,7 +17621,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18354,18 +17654,6 @@ "description": "Get an agent by ID.", "operationId": "get-fleet-agents-agentid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentId", @@ -18387,7 +17675,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -18787,7 +18075,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18820,18 +18108,6 @@ "description": "Update an agent by ID.", "operationId": "put-fleet-agents-agentid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -18853,7 +18129,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -18876,7 +18152,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19276,7 +18552,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19310,18 +18586,6 @@ "post": { "operationId": "post-fleet-agents-agentid-actions", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19343,7 +18607,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19419,7 +18683,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19492,7 +18756,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19526,18 +18790,6 @@ "post": { "operationId": "post-fleet-agents-agentid-reassign", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19559,7 +18811,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19578,7 +18830,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": {}, @@ -19589,7 +18841,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19623,18 +18875,6 @@ "post": { "operationId": "post-fleet-agents-agentid-request-diagnostics", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19656,7 +18896,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -19679,7 +18919,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19697,7 +18937,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19731,18 +18971,6 @@ "post": { "operationId": "post-fleet-agents-agentid-unenroll", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19764,7 +18992,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -19792,18 +19020,6 @@ "post": { "operationId": "post-fleet-agents-agentid-upgrade", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19825,7 +19041,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19853,7 +19069,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": {}, @@ -19864,7 +19080,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19898,18 +19114,6 @@ "get": { "operationId": "get-fleet-agents-agentid-uploads", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentId", @@ -19922,7 +19126,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19983,7 +19187,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20017,18 +19221,6 @@ "get": { "operationId": "get-fleet-check-permissions", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "fleetServerSetup", @@ -20041,7 +19233,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20067,7 +19259,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20100,24 +19292,11 @@ "/api/fleet/data_streams": { "get": { "operationId": "get-fleet-data-streams", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20224,7 +19403,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20258,18 +19437,6 @@ "get": { "operationId": "get-fleet-enrollment-api-keys", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -20300,7 +19467,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20413,7 +19580,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20445,18 +19612,6 @@ "post": { "operationId": "post-fleet-enrollment-api-keys", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -20470,7 +19625,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20495,7 +19650,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20556,7 +19711,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20591,18 +19746,6 @@ "description": "Revoke an enrollment API key by ID by marking it as inactive.", "operationId": "delete-fleet-enrollment-api-keys-keyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -20625,7 +19768,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20646,7 +19789,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20679,18 +19822,6 @@ "description": "Get an enrollment API key by ID.", "operationId": "get-fleet-enrollment-api-keys-keyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "keyId", @@ -20703,7 +19834,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20757,7 +19888,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20791,18 +19922,6 @@ "post": { "operationId": "post-fleet-epm-bulk-assets", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -20816,7 +19935,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20851,7 +19970,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20907,7 +20026,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20941,18 +20060,6 @@ "get": { "operationId": "get-fleet-epm-categories", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "prerelease", @@ -20973,7 +20080,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21017,7 +20124,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -21051,18 +20158,6 @@ "post": { "operationId": "post-fleet-epm-custom-integrations", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -21076,7 +20171,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21125,7 +20220,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21225,7 +20320,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -21259,18 +20354,6 @@ "get": { "operationId": "get-fleet-epm-data-streams", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "type", @@ -21320,7 +20403,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21350,7 +20433,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -21384,18 +20467,6 @@ "get": { "operationId": "get-fleet-epm-packages", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "category", @@ -21424,7 +20495,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21923,7 +20994,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -21955,18 +21026,6 @@ "post": { "operationId": "post-fleet-epm-packages", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -21998,7 +21057,7 @@ ], "requestBody": { "content": { - "application/gzip; application/zip; Elastic-Api-Version=2023-10-31": { + "application/gzip; application/zip": { "schema": { "format": "binary", "type": "string" @@ -22009,7 +21068,7 @@ "responses": { "200": { "content": { - "application/gzip; application/zip; Elastic-Api-Version=2023-10-31": { + "application/gzip; application/zip": { "schema": { "additionalProperties": false, "properties": { @@ -22109,7 +21168,7 @@ }, "400": { "content": { - "application/gzip; application/zip; Elastic-Api-Version=2023-10-31": { + "application/gzip; application/zip": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22143,18 +21202,6 @@ "post": { "operationId": "post-fleet-epm-packages-bulk", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -22176,7 +21223,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22226,7 +21273,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22386,7 +21433,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22420,18 +21467,6 @@ "get": { "operationId": "get-fleet-epm-packages-installed", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "dataStreamType", @@ -22507,7 +21542,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22626,7 +21661,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22659,24 +21694,11 @@ "/api/fleet/epm/packages/limited": { "get": { "operationId": "get-fleet-epm-packages-limited", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22697,7 +21719,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22731,18 +21753,6 @@ "get": { "operationId": "get-fleet-epm-packages-pkgname-stats", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "pkgName", @@ -22755,7 +21765,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22782,7 +21792,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22816,18 +21826,6 @@ "delete": { "operationId": "delete-fleet-epm-packages-pkgname-pkgversion", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -22866,7 +21864,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22953,7 +21951,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22985,18 +21983,6 @@ "get": { "operationId": "get-fleet-epm-packages-pkgname-pkgversion", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "pkgName", @@ -23050,7 +22036,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -23644,7 +22630,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -23676,18 +22662,6 @@ "post": { "operationId": "post-fleet-epm-packages-pkgname-pkgversion", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -23743,7 +22717,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -23765,7 +22739,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -23865,7 +22839,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -23897,18 +22871,6 @@ "put": { "operationId": "put-fleet-epm-packages-pkgname-pkgversion", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -23938,7 +22900,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -23957,7 +22919,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -24539,7 +23501,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -24573,18 +23535,6 @@ "post": { "operationId": "post-fleet-epm-packages-pkgname-pkgversion-transforms-authorize", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -24622,7 +23572,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -24653,7 +23603,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "items": { "additionalProperties": false, @@ -24682,7 +23632,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -24716,18 +23666,6 @@ "get": { "operationId": "get-fleet-epm-packages-pkgname-pkgversion-filepath", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "pkgName", @@ -24756,14 +23694,14 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": {} } } }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -24797,18 +23735,6 @@ "get": { "operationId": "get-fleet-epm-templates-pkgname-pkgversion-inputs", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "pkgName", @@ -24859,7 +23785,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -24931,7 +23857,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -24964,24 +23890,11 @@ "/api/fleet/epm/verification_key_id": { "get": { "operationId": "get-fleet-epm-verification-key-id", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25000,7 +23913,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25033,24 +23946,11 @@ "/api/fleet/fleet_server_hosts": { "get": { "operationId": "get-fleet-fleet-server-hosts", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25119,7 +24019,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25151,18 +24051,6 @@ "post": { "operationId": "post-fleet-fleet-server-hosts", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -25176,7 +24064,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25221,7 +24109,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25275,7 +24163,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25310,18 +24198,6 @@ "description": "Delete a Fleet Server host by ID.", "operationId": "delete-fleet-fleet-server-hosts-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -25344,7 +24220,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25362,7 +24238,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25395,18 +24271,6 @@ "description": "Get a Fleet Server host by ID.", "operationId": "get-fleet-fleet-server-hosts-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "itemId", @@ -25419,7 +24283,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25473,7 +24337,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25506,18 +24370,6 @@ "description": "Update a Fleet Server host by ID.", "operationId": "put-fleet-fleet-server-hosts-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -25539,7 +24391,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25575,7 +24427,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25629,7 +24481,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25663,18 +24515,6 @@ "post": { "operationId": "post-fleet-health-check", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -25688,7 +24528,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25707,7 +24547,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25731,7 +24571,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25756,7 +24596,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25790,18 +24630,6 @@ "get": { "operationId": "get-fleet-kubernetes", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "download", @@ -25830,7 +24658,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25848,7 +24676,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25882,18 +24710,6 @@ "get": { "operationId": "get-fleet-kubernetes-download", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "download", @@ -25922,7 +24738,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "type": "string" } @@ -25931,7 +24747,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25956,7 +24772,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25990,18 +24806,6 @@ "post": { "operationId": "post-fleet-logstash-api-keys", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -26016,7 +24820,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -26034,7 +24838,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -26068,18 +24872,6 @@ "post": { "operationId": "post-fleet-message-signing-service-rotate-key-pair", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -26103,7 +24895,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -26121,7 +24913,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -26146,7 +24938,7 @@ }, "500": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -26179,24 +24971,11 @@ "/api/fleet/outputs": { "get": { "operationId": "get-fleet-outputs", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -27244,7 +26023,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -27276,18 +26055,6 @@ "post": { "operationId": "post-fleet-outputs", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -27301,7 +26068,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -28326,7 +27093,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -29359,7 +28126,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -29394,18 +28161,6 @@ "description": "Delete output by ID.", "operationId": "delete-fleet-outputs-outputid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -29428,7 +28183,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -29446,7 +28201,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -29471,7 +28226,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -29504,18 +28259,6 @@ "description": "Get output by ID.", "operationId": "get-fleet-outputs-outputid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "outputId", @@ -29528,7 +28271,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -30561,7 +29304,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -30594,18 +29337,6 @@ "description": "Update output by ID.", "operationId": "put-fleet-outputs-outputid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -30627,7 +29358,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -31628,7 +30359,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -32661,7 +31392,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -32695,18 +31426,6 @@ "get": { "operationId": "get-fleet-outputs-outputid-health", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "outputId", @@ -32719,7 +31438,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -32748,7 +31467,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -32782,18 +31501,6 @@ "get": { "operationId": "get-fleet-package-policies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -32870,7 +31577,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -33470,7 +32177,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -33502,18 +32209,6 @@ "post": { "operationId": "post-fleet-package-policies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -33539,7 +32234,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -34149,7 +32844,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -34734,7 +33429,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -34759,7 +33454,7 @@ }, "409": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -34793,18 +33488,6 @@ "post": { "operationId": "post-fleet-package-policies-bulk-get", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -34830,7 +33513,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -34856,7 +33539,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35444,7 +34127,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -35469,7 +34152,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35496,18 +34179,6 @@ "post": { "operationId": "post-fleet-package-policies-delete", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -35521,7 +34192,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35546,7 +34217,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "items": { "additionalProperties": false, @@ -35665,7 +34336,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -35700,18 +34371,6 @@ "description": "Upgrade a package policy to a newer package version.", "operationId": "post-fleet-package-policies-upgrade", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -35725,7 +34384,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35747,7 +34406,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "items": { "additionalProperties": false, @@ -35790,7 +34449,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -35824,18 +34483,6 @@ "post": { "operationId": "post-fleet-package-policies-upgrade-dryrun", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -35849,7 +34496,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35874,7 +34521,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "items": { "additionalProperties": false, @@ -36987,7 +35634,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -37022,18 +35669,6 @@ "description": "Delete a package policy by ID.", "operationId": "delete-fleet-package-policies-packagepolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -37064,7 +35699,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -37082,7 +35717,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -37115,18 +35750,6 @@ "description": "Get a package policy by ID.", "operationId": "get-fleet-package-policies-packagepolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "packagePolicyId", @@ -37151,7 +35774,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -37736,7 +36359,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -37761,7 +36384,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -37787,18 +36410,6 @@ "description": "Update a package policy by ID.", "operationId": "put-fleet-package-policies-packagepolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -37832,7 +36443,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -38434,7 +37045,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39019,7 +37630,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39044,7 +37655,7 @@ }, "403": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39077,24 +37688,11 @@ "/api/fleet/proxies": { "get": { "operationId": "get-fleet-proxies", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39177,7 +37775,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39209,18 +37807,6 @@ "post": { "operationId": "post-fleet-proxies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -39234,7 +37820,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39293,7 +37879,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39361,7 +37947,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39396,18 +37982,6 @@ "description": "Delete a proxy by ID", "operationId": "delete-fleet-proxies-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -39430,7 +38004,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39448,7 +38022,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39481,18 +38055,6 @@ "description": "Get a proxy by ID.", "operationId": "get-fleet-proxies-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "itemId", @@ -39505,7 +38067,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39573,7 +38135,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39606,18 +38168,6 @@ "description": "Update a proxy by ID.", "operationId": "put-fleet-proxies-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -39639,7 +38189,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39693,7 +38243,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39761,7 +38311,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39795,18 +38345,6 @@ "post": { "operationId": "post-fleet-service-tokens", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -39820,7 +38358,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -39838,7 +38376,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39860,7 +38398,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39893,24 +38431,11 @@ "/api/fleet/settings": { "get": { "operationId": "get-fleet-settings", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39989,7 +38514,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40014,7 +38539,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40039,18 +38564,6 @@ "put": { "operationId": "put-fleet-settings", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -40064,7 +38577,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40112,7 +38625,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40191,7 +38704,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40216,7 +38729,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40243,18 +38756,6 @@ "post": { "operationId": "post-fleet-setup", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -40269,7 +38770,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "A summary of the result of Fleet's `setup` lifecycle. If `isInitialized` is true, Fleet is ready to accept agent enrollment. `nonFatalErrors` may include useful insight into non-blocking issues with Fleet setup.", @@ -40308,7 +38809,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40333,7 +38834,7 @@ }, "500": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Internal Server Error", @@ -40362,18 +38863,6 @@ "description": "List the metadata for the latest uninstall tokens per agent policy.", "operationId": "get-fleet-uninstall-tokens", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "Partial match filtering for policy IDs", "in": "query", @@ -40416,7 +38905,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40476,7 +38965,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40511,18 +39000,6 @@ "description": "Get one decrypted uninstall token by its ID.", "operationId": "get-fleet-uninstall-tokens-uninstalltokenid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "uninstallTokenId", @@ -40535,7 +39012,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40584,7 +39061,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40618,18 +39095,6 @@ "get": { "operationId": "get-security-role", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges.", "in": "query", @@ -40655,18 +39120,6 @@ "delete": { "operationId": "delete-security-role-name", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -40700,18 +39153,6 @@ "get": { "operationId": "get-security-role-name", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The role name.", "in": "path", @@ -40746,18 +39187,6 @@ "description": "Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm.", "operationId": "put-security-role-name", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -40792,7 +39221,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41065,18 +39494,6 @@ "post": { "operationId": "post-security-roles", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41090,7 +39507,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41376,18 +39793,6 @@ "description": "It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.

[Required authorization] Route required privileges: ALL of [copySavedObjectsToSpaces].", "operationId": "post-spaces-copy-saved-objects", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41401,7 +39806,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41474,18 +39879,6 @@ "post": { "operationId": "post-spaces-disable-legacy-url-aliases", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41499,7 +39892,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41550,18 +39943,6 @@ "description": "Collect references and space contexts for saved objects.", "operationId": "post-spaces-get-shareable-references", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41575,7 +39956,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41619,18 +40000,6 @@ "description": "Overwrite saved objects that are returned as errors from the copy saved objects to space API.

[Required authorization] Route required privileges: ALL of [copySavedObjectsToSpaces].", "operationId": "post-spaces-resolve-copy-saved-objects-errors", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41644,7 +40013,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41740,18 +40109,6 @@ "description": "Update one or more saved objects to add or remove them from some spaces.", "operationId": "post-spaces-update-objects-spaces", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41765,7 +40122,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41826,18 +40183,6 @@ "get": { "operationId": "get-spaces-space", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "Specifies which authorization checks are applied to the API call. The default value is `any`.", "in": "query", @@ -41906,18 +40251,6 @@ "post": { "operationId": "post-spaces-space", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41931,7 +40264,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -42007,18 +40340,6 @@ "description": "When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.", "operationId": "delete-spaces-space-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -42055,18 +40376,6 @@ "get": { "operationId": "get-spaces-space-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The space identifier.", "in": "path", @@ -42090,18 +40399,6 @@ "put": { "operationId": "put-spaces-space-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -42124,7 +40421,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -42199,18 +40496,6 @@ "get": { "operationId": "get-status", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "Set to \"true\" to get the response in v7 format.", "in": "query", @@ -42233,7 +40518,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -42251,7 +40536,7 @@ }, "503": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index ff2a4b17661b9..b188ae0999b0d 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -349,18 +349,6 @@ "description": "WARNING: When you delete a connector, it cannot be recovered.", "operationId": "delete-actions-connector-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -394,18 +382,6 @@ "get": { "operationId": "get-actions-connector-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "An identifier for the connector.", "in": "path", @@ -419,7 +395,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -479,18 +455,6 @@ "post": { "operationId": "post-actions-connector-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -513,7 +477,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -548,7 +512,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -608,18 +572,6 @@ "put": { "operationId": "put-actions-connector-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -642,7 +594,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -672,7 +624,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -735,18 +687,6 @@ "description": "You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems.", "operationId": "post-actions-connector-id-execute", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -769,7 +709,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -789,7 +729,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -852,18 +792,6 @@ "description": "You do not need any Kibana feature privileges to run this API.", "operationId": "get-actions-connector-types", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases).", "in": "query", @@ -884,20 +812,7 @@ "/api/actions/connectors": { "get": { "operationId": "get-actions-connectors", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": {}, "summary": "Get all connectors", "tags": [ @@ -909,18 +824,6 @@ "delete": { "operationId": "delete-alerting-rule-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -963,18 +866,6 @@ "get": { "operationId": "get-alerting-rule-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The identifier for the rule.", "in": "path", @@ -988,7 +879,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -1844,18 +1735,6 @@ "post": { "operationId": "post-alerting-rule-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -1878,7 +1757,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -2174,7 +2053,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -3030,18 +2909,6 @@ "put": { "operationId": "put-alerting-rule-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -3064,7 +2931,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -3343,7 +3210,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -4204,18 +4071,6 @@ "post": { "operationId": "post-alerting-rule-id-disable", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4238,7 +4093,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -4278,18 +4133,6 @@ "post": { "operationId": "post-alerting-rule-id-enable", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4334,18 +4177,6 @@ "post": { "operationId": "post-alerting-rule-id-mute-all", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4390,18 +4221,6 @@ "post": { "operationId": "post-alerting-rule-id-unmute-all", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4446,18 +4265,6 @@ "post": { "operationId": "post-alerting-rule-id-update-api-key", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4505,18 +4312,6 @@ "post": { "operationId": "post-alerting-rule-rule-id-alert-alert-id-mute", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4570,18 +4365,6 @@ "post": { "operationId": "post-alerting-rule-rule-id-alert-alert-id-unmute", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -4635,18 +4418,6 @@ "get": { "operationId": "get-alerting-rules-find", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The number of rules to return per page.", "in": "query", @@ -4793,7 +4564,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -5649,18 +5420,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "get-dashboards-dashboard", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The page number to return. Default is \"1\".", "in": "query", @@ -5687,7 +5446,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -5836,18 +5595,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "delete-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -5879,18 +5626,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "get-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A unique identifier for the dashboard.", "in": "path", @@ -5904,7 +5639,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -6539,18 +6274,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "post-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -6573,7 +6296,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -7108,7 +6831,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -7715,18 +7438,6 @@ "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.", "operationId": "put-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -7749,7 +7460,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -8278,7 +7989,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -8885,24 +8596,11 @@ "/api/fleet/agent_download_sources": { "get": { "operationId": "get-fleet-agent-download-sources", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -8962,7 +8660,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -8994,18 +8692,6 @@ "post": { "operationId": "post-fleet-agent-download-sources", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -9019,7 +8705,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9055,7 +8741,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9100,7 +8786,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -9135,18 +8821,6 @@ "description": "Delete an agent binary download source by ID.", "operationId": "delete-fleet-agent-download-sources-sourceid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -9169,7 +8843,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9187,7 +8861,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -9220,18 +8894,6 @@ "description": "Get an agent binary download source by ID.", "operationId": "get-fleet-agent-download-sources-sourceid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "sourceId", @@ -9244,7 +8906,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9289,7 +8951,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -9322,18 +8984,6 @@ "description": "Update an agent binary download source by ID.", "operationId": "put-fleet-agent-download-sources-sourceid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -9355,7 +9005,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9391,7 +9041,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -9436,7 +9086,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -9470,18 +9120,6 @@ "get": { "operationId": "get-fleet-agent-policies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -9578,7 +9216,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -10287,7 +9925,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -10319,18 +9957,6 @@ "post": { "operationId": "post-fleet-agent-policies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -10352,7 +9978,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -10603,7 +10229,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -11297,7 +10923,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -11331,18 +10957,6 @@ "post": { "operationId": "post-fleet-agent-policies-bulk-get", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -11368,7 +10982,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -11398,7 +11012,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12095,7 +11709,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -12130,18 +11744,6 @@ "description": "Delete an agent policy by ID.", "operationId": "post-fleet-agent-policies-delete", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -12155,7 +11757,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12178,7 +11780,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12200,7 +11802,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -12235,18 +11837,6 @@ "description": "Get a list of outputs associated with agent policies.", "operationId": "post-fleet-agent-policies-outputs", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -12260,7 +11850,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12283,7 +11873,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -12385,7 +11975,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -12420,18 +12010,6 @@ "description": "Get an agent policy by ID.", "operationId": "get-fleet-agent-policies-agentpolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentPolicyId", @@ -12456,7 +12034,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -13150,7 +12728,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -13183,18 +12761,6 @@ "description": "Update an agent policy by ID.", "operationId": "put-fleet-agent-policies-agentpolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -13228,7 +12794,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -13479,7 +13045,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -14173,7 +13739,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -14208,18 +13774,6 @@ "description": "Copy an agent policy by ID.", "operationId": "post-fleet-agent-policies-agentpolicyid-copy", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -14253,7 +13807,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -14276,7 +13830,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -14970,7 +14524,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15005,18 +14559,6 @@ "description": "Download an agent policy by ID.", "operationId": "get-fleet-agent-policies-agentpolicyid-download", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentPolicyId", @@ -15053,7 +14595,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "type": "string" } @@ -15062,7 +14604,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15087,7 +14629,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15122,18 +14664,6 @@ "description": "Get a full agent policy by ID.", "operationId": "get-fleet-agent-policies-agentpolicyid-full", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentPolicyId", @@ -15170,7 +14700,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -15625,7 +15155,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15660,18 +15190,6 @@ "description": "Get a list of outputs associated with agent policy by policy id.", "operationId": "get-fleet-agent-policies-agentpolicyid-outputs", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentPolicyId", @@ -15684,7 +15202,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -15783,7 +15301,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15817,18 +15335,6 @@ "get": { "operationId": "get-fleet-agent-status", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "policyId", @@ -15867,7 +15373,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -15930,7 +15436,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -15964,18 +15470,6 @@ "get": { "operationId": "get-fleet-agent-status-data", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "agentsIds", @@ -16023,7 +15517,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16061,7 +15555,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -16095,18 +15589,6 @@ "get": { "operationId": "get-fleet-agents", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -16193,7 +15675,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16614,7 +16096,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -16646,18 +16128,6 @@ "post": { "operationId": "post-fleet-agents", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -16671,7 +16141,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16693,7 +16163,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16714,7 +16184,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -16748,18 +16218,6 @@ "get": { "operationId": "get-fleet-agents-action-status", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -16807,7 +16265,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -16949,7 +16407,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -16983,18 +16441,6 @@ "post": { "operationId": "post-fleet-agents-actions-actionid-cancel", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17017,7 +16463,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17090,7 +16536,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17123,24 +16569,11 @@ "/api/fleet/agents/available_versions": { "get": { "operationId": "get-fleet-agents-available-versions", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17161,7 +16594,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17195,18 +16628,6 @@ "post": { "operationId": "post-fleet-agents-bulk-reassign", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17220,7 +16641,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17260,7 +16681,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17278,7 +16699,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17312,18 +16733,6 @@ "post": { "operationId": "post-fleet-agents-bulk-request-diagnostics", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17337,7 +16746,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17378,7 +16787,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17396,7 +16805,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17430,18 +16839,6 @@ "post": { "operationId": "post-fleet-agents-bulk-unenroll", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17455,7 +16852,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17501,7 +16898,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17519,7 +16916,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17553,18 +16950,6 @@ "post": { "operationId": "post-fleet-agents-bulk-update-agent-tags", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17578,7 +16963,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17626,7 +17011,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17644,7 +17029,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17678,18 +17063,6 @@ "post": { "operationId": "post-fleet-agents-bulk-upgrade", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17703,7 +17076,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17759,7 +17132,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17777,7 +17150,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17812,18 +17185,6 @@ "description": "Delete a file uploaded by an agent.", "operationId": "delete-fleet-agents-files-fileid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -17846,7 +17207,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -17868,7 +17229,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17903,18 +17264,6 @@ "description": "Get a file uploaded by an agent.", "operationId": "get-fleet-agents-files-fileid-filename", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "fileId", @@ -17935,7 +17284,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "type": "object" } @@ -17944,7 +17293,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -17977,24 +17326,11 @@ "/api/fleet/agents/setup": { "get": { "operationId": "get-fleet-agents-setup", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "A summary of the agent setup status. `isReady` indicates whether the setup is ready. If the setup is not ready, `missing_requirements` lists which requirements are missing.", @@ -18046,7 +17382,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18078,18 +17414,6 @@ "post": { "operationId": "post-fleet-agents-setup", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -18104,7 +17428,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "A summary of the result of Fleet's `setup` lifecycle. If `isInitialized` is true, Fleet is ready to accept agent enrollment. `nonFatalErrors` may include useful insight into non-blocking issues with Fleet setup.", @@ -18143,7 +17467,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18177,18 +17501,6 @@ "get": { "operationId": "get-fleet-agents-tags", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "kuery", @@ -18210,7 +17522,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -18231,7 +17543,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18266,18 +17578,6 @@ "description": "Delete an agent by ID.", "operationId": "delete-fleet-agents-agentid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -18300,7 +17600,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -18321,7 +17621,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18354,18 +17654,6 @@ "description": "Get an agent by ID.", "operationId": "get-fleet-agents-agentid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentId", @@ -18387,7 +17675,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -18787,7 +18075,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -18820,18 +18108,6 @@ "description": "Update an agent by ID.", "operationId": "put-fleet-agents-agentid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -18853,7 +18129,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -18876,7 +18152,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19276,7 +18552,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19310,18 +18586,6 @@ "post": { "operationId": "post-fleet-agents-agentid-actions", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19343,7 +18607,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19419,7 +18683,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19492,7 +18756,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19526,18 +18790,6 @@ "post": { "operationId": "post-fleet-agents-agentid-reassign", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19559,7 +18811,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19578,7 +18830,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": {}, @@ -19589,7 +18841,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19623,18 +18875,6 @@ "post": { "operationId": "post-fleet-agents-agentid-request-diagnostics", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19656,7 +18896,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -19679,7 +18919,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19697,7 +18937,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19731,18 +18971,6 @@ "post": { "operationId": "post-fleet-agents-agentid-unenroll", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19764,7 +18992,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -19792,18 +19020,6 @@ "post": { "operationId": "post-fleet-agents-agentid-upgrade", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -19825,7 +19041,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19853,7 +19069,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": {}, @@ -19864,7 +19080,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -19898,18 +19114,6 @@ "get": { "operationId": "get-fleet-agents-agentid-uploads", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "agentId", @@ -19922,7 +19126,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -19983,7 +19187,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20017,18 +19221,6 @@ "get": { "operationId": "get-fleet-check-permissions", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "fleetServerSetup", @@ -20041,7 +19233,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20067,7 +19259,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20100,24 +19292,11 @@ "/api/fleet/data_streams": { "get": { "operationId": "get-fleet-data-streams", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20224,7 +19403,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20258,18 +19437,6 @@ "get": { "operationId": "get-fleet-enrollment-api-keys", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -20300,7 +19467,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20413,7 +19580,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20445,18 +19612,6 @@ "post": { "operationId": "post-fleet-enrollment-api-keys", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -20470,7 +19625,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20495,7 +19650,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20556,7 +19711,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20591,18 +19746,6 @@ "description": "Revoke an enrollment API key by ID by marking it as inactive.", "operationId": "delete-fleet-enrollment-api-keys-keyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -20625,7 +19768,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20646,7 +19789,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20679,18 +19822,6 @@ "description": "Get an enrollment API key by ID.", "operationId": "get-fleet-enrollment-api-keys-keyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "keyId", @@ -20703,7 +19834,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20757,7 +19888,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20791,18 +19922,6 @@ "post": { "operationId": "post-fleet-epm-bulk-assets", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -20816,7 +19935,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20851,7 +19970,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -20907,7 +20026,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -20941,18 +20060,6 @@ "get": { "operationId": "get-fleet-epm-categories", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "prerelease", @@ -20973,7 +20080,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21017,7 +20124,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -21051,18 +20158,6 @@ "post": { "operationId": "post-fleet-epm-custom-integrations", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -21076,7 +20171,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21125,7 +20220,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21225,7 +20320,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -21259,18 +20354,6 @@ "get": { "operationId": "get-fleet-epm-data-streams", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "type", @@ -21320,7 +20403,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21350,7 +20433,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -21384,18 +20467,6 @@ "get": { "operationId": "get-fleet-epm-packages", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "category", @@ -21424,7 +20495,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -21923,7 +20994,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -21955,18 +21026,6 @@ "post": { "operationId": "post-fleet-epm-packages", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -21998,7 +21057,7 @@ ], "requestBody": { "content": { - "application/gzip; application/zip; Elastic-Api-Version=2023-10-31": { + "application/gzip; application/zip": { "schema": { "format": "binary", "type": "string" @@ -22009,7 +21068,7 @@ "responses": { "200": { "content": { - "application/gzip; application/zip; Elastic-Api-Version=2023-10-31": { + "application/gzip; application/zip": { "schema": { "additionalProperties": false, "properties": { @@ -22109,7 +21168,7 @@ }, "400": { "content": { - "application/gzip; application/zip; Elastic-Api-Version=2023-10-31": { + "application/gzip; application/zip": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22143,18 +21202,6 @@ "post": { "operationId": "post-fleet-epm-packages-bulk", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -22176,7 +21223,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22226,7 +21273,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22386,7 +21433,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22420,18 +21467,6 @@ "get": { "operationId": "get-fleet-epm-packages-installed", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "dataStreamType", @@ -22507,7 +21542,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22626,7 +21661,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22659,24 +21694,11 @@ "/api/fleet/epm/packages/limited": { "get": { "operationId": "get-fleet-epm-packages-limited", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22697,7 +21719,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22731,18 +21753,6 @@ "get": { "operationId": "get-fleet-epm-packages-pkgname-stats", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "pkgName", @@ -22755,7 +21765,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22782,7 +21792,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22816,18 +21826,6 @@ "delete": { "operationId": "delete-fleet-epm-packages-pkgname-pkgversion", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -22866,7 +21864,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -22953,7 +21951,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -22985,18 +21983,6 @@ "get": { "operationId": "get-fleet-epm-packages-pkgname-pkgversion", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "pkgName", @@ -23050,7 +22036,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -23644,7 +22630,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -23676,18 +22662,6 @@ "post": { "operationId": "post-fleet-epm-packages-pkgname-pkgversion", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -23743,7 +22717,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -23765,7 +22739,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -23865,7 +22839,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -23897,18 +22871,6 @@ "put": { "operationId": "put-fleet-epm-packages-pkgname-pkgversion", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -23938,7 +22900,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -23957,7 +22919,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -24539,7 +23501,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -24573,18 +23535,6 @@ "post": { "operationId": "post-fleet-epm-packages-pkgname-pkgversion-transforms-authorize", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -24622,7 +23572,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -24653,7 +23603,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "items": { "additionalProperties": false, @@ -24682,7 +23632,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -24716,18 +23666,6 @@ "get": { "operationId": "get-fleet-epm-packages-pkgname-pkgversion-filepath", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "pkgName", @@ -24756,14 +23694,14 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": {} } } }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -24797,18 +23735,6 @@ "get": { "operationId": "get-fleet-epm-templates-pkgname-pkgversion-inputs", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "pkgName", @@ -24859,7 +23785,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -24931,7 +23857,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -24964,24 +23890,11 @@ "/api/fleet/epm/verification_key_id": { "get": { "operationId": "get-fleet-epm-verification-key-id", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25000,7 +23913,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25033,24 +23946,11 @@ "/api/fleet/fleet_server_hosts": { "get": { "operationId": "get-fleet-fleet-server-hosts", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25119,7 +24019,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25151,18 +24051,6 @@ "post": { "operationId": "post-fleet-fleet-server-hosts", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -25176,7 +24064,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25221,7 +24109,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25275,7 +24163,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25310,18 +24198,6 @@ "description": "Delete a Fleet Server host by ID.", "operationId": "delete-fleet-fleet-server-hosts-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -25344,7 +24220,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25362,7 +24238,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25395,18 +24271,6 @@ "description": "Get a Fleet Server host by ID.", "operationId": "get-fleet-fleet-server-hosts-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "itemId", @@ -25419,7 +24283,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25473,7 +24337,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25506,18 +24370,6 @@ "description": "Update a Fleet Server host by ID.", "operationId": "put-fleet-fleet-server-hosts-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -25539,7 +24391,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25575,7 +24427,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25629,7 +24481,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25663,18 +24515,6 @@ "post": { "operationId": "post-fleet-health-check", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -25688,7 +24528,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25707,7 +24547,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25731,7 +24571,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25756,7 +24596,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25790,18 +24630,6 @@ "get": { "operationId": "get-fleet-kubernetes", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "download", @@ -25830,7 +24658,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -25848,7 +24676,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25882,18 +24710,6 @@ "get": { "operationId": "get-fleet-kubernetes-download", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "download", @@ -25922,7 +24738,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "type": "string" } @@ -25931,7 +24747,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25956,7 +24772,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -25990,18 +24806,6 @@ "post": { "operationId": "post-fleet-logstash-api-keys", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -26016,7 +24820,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -26034,7 +24838,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -26068,18 +24872,6 @@ "post": { "operationId": "post-fleet-message-signing-service-rotate-key-pair", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -26103,7 +24895,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -26121,7 +24913,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -26146,7 +24938,7 @@ }, "500": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -26179,24 +24971,11 @@ "/api/fleet/outputs": { "get": { "operationId": "get-fleet-outputs", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -27244,7 +26023,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -27276,18 +26055,6 @@ "post": { "operationId": "post-fleet-outputs", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -27301,7 +26068,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -28326,7 +27093,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -29359,7 +28126,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -29394,18 +28161,6 @@ "description": "Delete output by ID.", "operationId": "delete-fleet-outputs-outputid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -29428,7 +28183,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -29446,7 +28201,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -29471,7 +28226,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -29504,18 +28259,6 @@ "description": "Get output by ID.", "operationId": "get-fleet-outputs-outputid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "outputId", @@ -29528,7 +28271,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -30561,7 +29304,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -30594,18 +29337,6 @@ "description": "Update output by ID.", "operationId": "put-fleet-outputs-outputid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -30627,7 +29358,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -31628,7 +30359,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -32661,7 +31392,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -32695,18 +31426,6 @@ "get": { "operationId": "get-fleet-outputs-outputid-health", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "outputId", @@ -32719,7 +31438,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -32748,7 +31467,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -32782,18 +31501,6 @@ "get": { "operationId": "get-fleet-package-policies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "query", "name": "page", @@ -32870,7 +31577,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -33470,7 +32177,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -33502,18 +32209,6 @@ "post": { "operationId": "post-fleet-package-policies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -33539,7 +32234,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -34149,7 +32844,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -34734,7 +33429,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -34759,7 +33454,7 @@ }, "409": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -34793,18 +33488,6 @@ "post": { "operationId": "post-fleet-package-policies-bulk-get", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -34830,7 +33513,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -34856,7 +33539,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35444,7 +34127,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -35469,7 +34152,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35496,18 +34179,6 @@ "post": { "operationId": "post-fleet-package-policies-delete", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -35521,7 +34192,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35546,7 +34217,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "items": { "additionalProperties": false, @@ -35665,7 +34336,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -35700,18 +34371,6 @@ "description": "Upgrade a package policy to a newer package version.", "operationId": "post-fleet-package-policies-upgrade", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -35725,7 +34384,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35747,7 +34406,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "items": { "additionalProperties": false, @@ -35790,7 +34449,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -35824,18 +34483,6 @@ "post": { "operationId": "post-fleet-package-policies-upgrade-dryrun", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -35849,7 +34496,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -35874,7 +34521,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "items": { "additionalProperties": false, @@ -36987,7 +35634,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -37022,18 +35669,6 @@ "description": "Delete a package policy by ID.", "operationId": "delete-fleet-package-policies-packagepolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -37064,7 +35699,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -37082,7 +35717,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -37115,18 +35750,6 @@ "description": "Get a package policy by ID.", "operationId": "get-fleet-package-policies-packagepolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "packagePolicyId", @@ -37151,7 +35774,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -37736,7 +36359,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -37761,7 +36384,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -37787,18 +36410,6 @@ "description": "Update a package policy by ID.", "operationId": "put-fleet-package-policies-packagepolicyid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -37832,7 +36443,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -38434,7 +37045,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39019,7 +37630,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39044,7 +37655,7 @@ }, "403": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39077,24 +37688,11 @@ "/api/fleet/proxies": { "get": { "operationId": "get-fleet-proxies", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39177,7 +37775,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39209,18 +37807,6 @@ "post": { "operationId": "post-fleet-proxies", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -39234,7 +37820,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39293,7 +37879,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39361,7 +37947,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39396,18 +37982,6 @@ "description": "Delete a proxy by ID", "operationId": "delete-fleet-proxies-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -39430,7 +38004,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39448,7 +38022,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39481,18 +38055,6 @@ "description": "Get a proxy by ID.", "operationId": "get-fleet-proxies-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "itemId", @@ -39505,7 +38067,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39573,7 +38135,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39606,18 +38168,6 @@ "description": "Update a proxy by ID.", "operationId": "put-fleet-proxies-itemid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -39639,7 +38189,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39693,7 +38243,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39761,7 +38311,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39795,18 +38345,6 @@ "post": { "operationId": "post-fleet-service-tokens", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -39820,7 +38358,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "nullable": true, @@ -39838,7 +38376,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39860,7 +38398,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -39893,24 +38431,11 @@ "/api/fleet/settings": { "get": { "operationId": "get-fleet-settings", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -39989,7 +38514,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40014,7 +38539,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40039,18 +38564,6 @@ "put": { "operationId": "put-fleet-settings", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -40064,7 +38577,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40112,7 +38625,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40191,7 +38704,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40216,7 +38729,7 @@ }, "404": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40243,18 +38756,6 @@ "post": { "operationId": "post-fleet-setup", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -40269,7 +38770,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "A summary of the result of Fleet's `setup` lifecycle. If `isInitialized` is true, Fleet is ready to accept agent enrollment. `nonFatalErrors` may include useful insight into non-blocking issues with Fleet setup.", @@ -40308,7 +38809,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40333,7 +38834,7 @@ }, "500": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Internal Server Error", @@ -40362,18 +38863,6 @@ "description": "List the metadata for the latest uninstall tokens per agent policy.", "operationId": "get-fleet-uninstall-tokens", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "Partial match filtering for policy IDs", "in": "query", @@ -40416,7 +38905,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40476,7 +38965,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40511,18 +39000,6 @@ "description": "Get one decrypted uninstall token by its ID.", "operationId": "get-fleet-uninstall-tokens-uninstalltokenid", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "in": "path", "name": "uninstallTokenId", @@ -40535,7 +39012,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -40584,7 +39061,7 @@ }, "400": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "description": "Generic Error", @@ -40618,18 +39095,6 @@ "get": { "operationId": "get-security-role", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges.", "in": "query", @@ -40655,18 +39120,6 @@ "delete": { "operationId": "delete-security-role-name", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -40700,18 +39153,6 @@ "get": { "operationId": "get-security-role-name", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The role name.", "in": "path", @@ -40746,18 +39187,6 @@ "description": "Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm.", "operationId": "put-security-role-name", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -40792,7 +39221,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41065,18 +39494,6 @@ "post": { "operationId": "post-security-roles", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41090,7 +39507,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41375,18 +39792,6 @@ "get": { "operationId": "get-spaces-space", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "Specifies which authorization checks are applied to the API call. The default value is `any`.", "in": "query", @@ -41455,18 +39860,6 @@ "post": { "operationId": "post-spaces-space", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41480,7 +39873,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41547,18 +39940,6 @@ "description": "When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.", "operationId": "delete-spaces-space-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41595,18 +39976,6 @@ "get": { "operationId": "get-spaces-space-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The space identifier.", "in": "path", @@ -41630,18 +39999,6 @@ "put": { "operationId": "put-spaces-space-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -41664,7 +40021,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -41730,18 +40087,6 @@ "get": { "operationId": "get-status", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "Set to \"true\" to get the response in v7 format.", "in": "query", @@ -41764,7 +40109,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { @@ -41782,7 +40127,7 @@ }, "503": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "anyOf": [ { diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 72fc1b093903a..bf3c74d906cef 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -154,14 +154,6 @@ paths: description: You do not need any Kibana feature privileges to run this API. operationId: get-actions-connector-types parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases). in: query name: feature_id @@ -185,14 +177,6 @@ paths: description: 'WARNING: When you delete a connector, it cannot be recovered.' operationId: delete-actions-connector-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -216,14 +200,6 @@ paths: get: operationId: get-actions-connector-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: An identifier for the connector. in: path name: id @@ -280,14 +256,6 @@ paths: post: operationId: post-actions-connector-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -435,14 +403,6 @@ paths: put: operationId: put-actions-connector-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -573,14 +533,6 @@ paths: description: You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. operationId: post-actions-connector-id-execute parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -697,15 +649,7 @@ paths: /api/actions/connectors: get: operationId: get-actions-connectors - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': description: Indicates a successful call. @@ -722,14 +666,6 @@ paths: delete: operationId: delete-alerting-rule-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -759,14 +695,6 @@ paths: get: operationId: get-alerting-rule-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The identifier for the rule. in: path name: id @@ -1420,14 +1348,6 @@ paths: post: operationId: post-alerting-rule-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -2344,14 +2264,6 @@ paths: put: operationId: put-alerting-rule-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3227,14 +3139,6 @@ paths: post: operationId: post-alerting-rule-id-disable parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3277,14 +3181,6 @@ paths: post: operationId: post-alerting-rule-id-enable parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3315,14 +3211,6 @@ paths: post: operationId: post-alerting-rule-id-mute-all parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3353,14 +3241,6 @@ paths: post: operationId: post-alerting-rule-id-unmute-all parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3391,14 +3271,6 @@ paths: post: operationId: post-alerting-rule-id-update-api-key parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3431,14 +3303,6 @@ paths: post: operationId: post-alerting-rule-rule-id-alert-alert-id-mute parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3475,14 +3339,6 @@ paths: post: operationId: post-alerting-rule-rule-id-alert-alert-id-unmute parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3519,14 +3375,6 @@ paths: get: operationId: get-alerting-rules-find parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The number of rules to return per page. in: query name: per_page @@ -5201,14 +5049,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: get-dashboards-dashboard parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The page number to return. Default is "1". in: query name: page @@ -5332,14 +5172,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: delete-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -5363,14 +5195,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: get-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A unique identifier for the dashboard. in: path name: id @@ -5835,14 +5659,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: post-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -6677,14 +6493,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: put-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -11330,15 +11138,7 @@ paths: /api/fleet/agent_download_sources: get: operationId: get-fleet-agent-download-sources - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -11405,14 +11205,6 @@ paths: post: operationId: post-fleet-agent-download-sources parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -11501,14 +11293,6 @@ paths: description: Delete an agent binary download source by ID. operationId: delete-fleet-agent-download-sources-sourceid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -11557,14 +11341,6 @@ paths: description: Get an agent binary download source by ID. operationId: get-fleet-agent-download-sources-sourceid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: sourceId required: true @@ -11626,14 +11402,6 @@ paths: description: Update an agent binary download source by ID. operationId: put-fleet-agent-download-sources-sourceid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -11726,14 +11494,6 @@ paths: get: operationId: get-fleet-agent-policies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -12313,14 +12073,6 @@ paths: post: operationId: post-fleet-agent-policies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -13014,14 +12766,6 @@ paths: post: operationId: post-fleet-agent-policies-bulk-get parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -13568,14 +13312,6 @@ paths: description: Get an agent policy by ID. operationId: get-fleet-agent-policies-agentpolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentPolicyId required: true @@ -14098,14 +13834,6 @@ paths: description: Update an agent policy by ID. operationId: put-fleet-agent-policies-agentpolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -14808,14 +14536,6 @@ paths: description: Copy an agent policy by ID. operationId: post-fleet-agent-policies-agentpolicyid-copy parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -15360,14 +15080,6 @@ paths: description: Download an agent policy by ID. operationId: get-fleet-agent-policies-agentpolicyid-download parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentPolicyId required: true @@ -15435,14 +15147,6 @@ paths: description: Get a full agent policy by ID. operationId: get-fleet-agent-policies-agentpolicyid-full parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentPolicyId required: true @@ -15792,14 +15496,6 @@ paths: description: Get a list of outputs associated with agent policy by policy id. operationId: get-fleet-agent-policies-agentpolicyid-outputs parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentPolicyId required: true @@ -15897,14 +15593,6 @@ paths: description: Delete an agent policy by ID. operationId: post-fleet-agent-policies-delete parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -15966,14 +15654,6 @@ paths: description: Get a list of outputs associated with agent policies. operationId: post-fleet-agent-policies-outputs parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -16088,14 +15768,6 @@ paths: get: operationId: get-fleet-agent-status parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: policyId required: false @@ -16184,14 +15856,6 @@ paths: get: operationId: get-fleet-agent-status-data parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: agentsIds required: true @@ -16267,14 +15931,6 @@ paths: get: operationId: get-fleet-agents parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -16654,14 +16310,6 @@ paths: post: operationId: post-fleet-agents parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -16721,14 +16369,6 @@ paths: description: Delete an agent by ID. operationId: delete-fleet-agents-agentid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -16779,14 +16419,6 @@ paths: description: Get an agent by ID. operationId: get-fleet-agents-agentid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentId required: true @@ -17109,14 +16741,6 @@ paths: description: Update an agent by ID. operationId: put-fleet-agents-agentid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -17454,14 +17078,6 @@ paths: post: operationId: post-fleet-agents-agentid-actions parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -17599,14 +17215,6 @@ paths: post: operationId: post-fleet-agents-agentid-reassign parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -17662,84 +17270,68 @@ paths: post: operationId: post-fleet-agents-agentid-request-diagnostics parameters: - - description: The version of the API to use + - description: A required header to protect against CSRF attacks in: header - name: elastic-api-version + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - in: path + name: agentId + required: true schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: agentId - required: true - schema: - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - nullable: true - type: object - properties: - additional_metrics: - items: - enum: - - CPU - type: string - type: array - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - actionId: - type: string - required: - - actionId - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - description: Generic Error - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - required: - - message - summary: Request agent diagnostics - tags: - - Elastic Agent actions - x-beta: true - /api/fleet/agents/{agentId}/unenroll: - post: - operationId: post-fleet-agents-agentid-unenroll - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' type: string + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + nullable: true + type: object + properties: + additional_metrics: + items: + enum: + - CPU + type: string + type: array + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + actionId: + type: string + required: + - actionId + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + description: Generic Error + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - message + summary: Request agent diagnostics + tags: + - Elastic Agent actions + x-beta: true + /api/fleet/agents/{agentId}/unenroll: + post: + operationId: post-fleet-agents-agentid-unenroll + parameters: - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -17773,14 +17365,6 @@ paths: post: operationId: post-fleet-agents-agentid-upgrade parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -17842,14 +17426,6 @@ paths: get: operationId: get-fleet-agents-agentid-uploads parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentId required: true @@ -17923,14 +17499,6 @@ paths: get: operationId: get-fleet-agents-action-status parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -18089,14 +17657,6 @@ paths: post: operationId: post-fleet-agents-actions-actionid-cancel parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18183,15 +17743,7 @@ paths: /api/fleet/agents/available_versions: get: operationId: get-fleet-agents-available-versions - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -18230,14 +17782,6 @@ paths: post: operationId: post-fleet-agents-bulk-reassign parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18304,14 +17848,6 @@ paths: post: operationId: post-fleet-agents-bulk-request-diagnostics parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18378,14 +17914,6 @@ paths: post: operationId: post-fleet-agents-bulk-unenroll parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18457,14 +17985,6 @@ paths: post: operationId: post-fleet-agents-bulk-update-agent-tags parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18536,14 +18056,6 @@ paths: post: operationId: post-fleet-agents-bulk-upgrade parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18622,14 +18134,6 @@ paths: description: Delete a file uploaded by an agent. operationId: delete-fleet-agents-files-fileid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18682,14 +18186,6 @@ paths: description: Get a file uploaded by an agent. operationId: get-fleet-agents-files-fileid-filename parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: fileId required: true @@ -18729,15 +18225,7 @@ paths: /api/fleet/agents/setup: get: operationId: get-fleet-agents-setup - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -18798,14 +18286,6 @@ paths: post: operationId: post-fleet-agents-setup parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18864,14 +18344,6 @@ paths: get: operationId: get-fleet-agents-tags parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: kuery required: false @@ -18921,14 +18393,6 @@ paths: get: operationId: get-fleet-check-permissions parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: fleetServerSetup required: false @@ -18975,15 +18439,7 @@ paths: /api/fleet/data_streams: get: operationId: get-fleet-data-streams - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -19081,14 +18537,6 @@ paths: get: operationId: get-fleet-enrollment-api-keys parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -19212,14 +18660,6 @@ paths: post: operationId: post-fleet-enrollment-api-keys parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -19311,14 +18751,6 @@ paths: description: Revoke an enrollment API key by ID by marking it as inactive. operationId: delete-fleet-enrollment-api-keys-keyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -19369,14 +18801,6 @@ paths: description: Get an enrollment API key by ID. operationId: get-fleet-enrollment-api-keys-keyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: keyId required: true @@ -19445,14 +18869,6 @@ paths: post: operationId: post-fleet-epm-bulk-assets parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -19544,14 +18960,6 @@ paths: get: operationId: get-fleet-epm-categories parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: prerelease required: false @@ -19616,14 +19024,6 @@ paths: post: operationId: post-fleet-epm-custom-integrations parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -19759,14 +19159,6 @@ paths: get: operationId: get-fleet-epm-data-streams parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: type required: false @@ -19842,14 +19234,6 @@ paths: get: operationId: get-fleet-epm-packages parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: category required: false @@ -20242,14 +19626,6 @@ paths: post: operationId: post-fleet-epm-packages parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -20370,14 +19746,6 @@ paths: post: operationId: post-fleet-epm-packages-bulk parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -20553,14 +19921,6 @@ paths: delete: operationId: delete-fleet-epm-packages-pkgname-pkgversion parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -20668,14 +20028,6 @@ paths: get: operationId: get-fleet-epm-packages-pkgname-pkgversion parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: pkgName required: true @@ -21148,14 +20500,6 @@ paths: post: operationId: post-fleet-epm-packages-pkgname-pkgversion parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21298,14 +20642,6 @@ paths: put: operationId: put-fleet-epm-packages-pkgname-pkgversion parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21768,14 +21104,6 @@ paths: get: operationId: get-fleet-epm-packages-pkgname-pkgversion-filepath parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: pkgName required: true @@ -21820,14 +21148,6 @@ paths: post: operationId: post-fleet-epm-packages-pkgname-pkgversion-transforms-authorize parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21913,14 +21233,6 @@ paths: get: operationId: get-fleet-epm-packages-pkgname-stats parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: pkgName required: true @@ -21968,14 +21280,6 @@ paths: get: operationId: get-fleet-epm-packages-installed parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: dataStreamType required: false @@ -22121,15 +21425,7 @@ paths: /api/fleet/epm/packages/limited: get: operationId: get-fleet-epm-packages-limited - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -22168,14 +21464,6 @@ paths: get: operationId: get-fleet-epm-templates-pkgname-pkgversion-inputs parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: pkgName required: true @@ -22275,15 +21563,7 @@ paths: /api/fleet/epm/verification_key_id: get: operationId: get-fleet-epm-verification-key-id - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -22320,15 +21600,7 @@ paths: /api/fleet/fleet_server_hosts: get: operationId: get-fleet-fleet-server-hosts - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -22401,14 +21673,6 @@ paths: post: operationId: post-fleet-fleet-server-hosts parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -22509,14 +21773,6 @@ paths: description: Delete a Fleet Server host by ID. operationId: delete-fleet-fleet-server-hosts-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -22565,14 +21821,6 @@ paths: description: Get a Fleet Server host by ID. operationId: get-fleet-fleet-server-hosts-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: itemId required: true @@ -22640,14 +21888,6 @@ paths: description: Update a Fleet Server host by ID. operationId: put-fleet-fleet-server-hosts-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -22745,14 +21985,6 @@ paths: post: operationId: post-fleet-health-check parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -22827,14 +22059,6 @@ paths: get: operationId: get-fleet-kubernetes parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: download required: false @@ -22886,14 +22110,6 @@ paths: get: operationId: get-fleet-kubernetes-download parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: download required: false @@ -22955,14 +22171,6 @@ paths: post: operationId: post-fleet-logstash-api-keys parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -23006,14 +22214,6 @@ paths: post: operationId: post-fleet-message-signing-service-rotate-key-pair parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -23078,15 +22278,7 @@ paths: /api/fleet/outputs: get: operationId: get-fleet-outputs - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -23812,14 +23004,6 @@ paths: post: operationId: post-fleet-outputs parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -25227,14 +24411,6 @@ paths: description: Delete output by ID. operationId: delete-fleet-outputs-outputid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -25299,14 +24475,6 @@ paths: description: Get output by ID. operationId: get-fleet-outputs-outputid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: outputId required: true @@ -26027,14 +25195,6 @@ paths: description: Update output by ID. operationId: put-fleet-outputs-outputid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -27425,14 +26585,6 @@ paths: get: operationId: get-fleet-outputs-outputid-health parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: outputId required: true @@ -27483,14 +26635,6 @@ paths: get: operationId: get-fleet-package-policies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -27956,14 +27100,6 @@ paths: post: operationId: post-fleet-package-policies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -28807,14 +27943,6 @@ paths: post: operationId: post-fleet-package-policies-bulk-get parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -29269,14 +28397,6 @@ paths: description: Delete a package policy by ID. operationId: delete-fleet-package-policies-packagepolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -29330,14 +28450,6 @@ paths: description: Get a package policy by ID. operationId: get-fleet-package-policies-packagepolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: packagePolicyId required: true @@ -29771,14 +28883,6 @@ paths: description: Update a package policy by ID. operationId: put-fleet-package-policies-packagepolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -30620,14 +29724,6 @@ paths: post: operationId: post-fleet-package-policies-delete parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -30758,14 +29854,6 @@ paths: description: Upgrade a package policy to a newer package version. operationId: post-fleet-package-policies-upgrade parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -30839,14 +29927,6 @@ paths: post: operationId: post-fleet-package-policies-upgrade-dryrun parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -31639,15 +30719,7 @@ paths: /api/fleet/proxies: get: operationId: get-fleet-proxies - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -31726,14 +30798,6 @@ paths: post: operationId: post-fleet-proxies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -31846,14 +30910,6 @@ paths: description: Delete a proxy by ID operationId: delete-fleet-proxies-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -31902,14 +30958,6 @@ paths: description: Get a proxy by ID. operationId: get-fleet-proxies-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: itemId required: true @@ -31983,14 +31031,6 @@ paths: description: Update a proxy by ID. operationId: put-fleet-proxies-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -32104,14 +31144,6 @@ paths: post: operationId: post-fleet-service-tokens parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -32168,15 +31200,7 @@ paths: /api/fleet/settings: get: operationId: get-fleet-settings - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -32265,14 +31289,6 @@ paths: put: operationId: put-fleet-settings parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -32400,14 +31416,6 @@ paths: post: operationId: post-fleet-setup parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -32479,14 +31487,6 @@ paths: description: List the metadata for the latest uninstall tokens per agent policy. operationId: get-fleet-uninstall-tokens parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: Partial match filtering for policy IDs in: query name: policyId @@ -32580,14 +31580,6 @@ paths: description: Get one decrypted uninstall token by its ID. operationId: get-fleet-uninstall-tokens-uninstalltokenid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: uninstallTokenId required: true @@ -35225,14 +34217,6 @@ paths: get: operationId: get-security-role parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. in: query name: replaceDeprecatedPrivileges @@ -35250,14 +34234,6 @@ paths: delete: operationId: delete-security-role-name parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -35281,14 +34257,6 @@ paths: get: operationId: get-security-role-name parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The role name. in: path name: name @@ -35313,14 +34281,6 @@ paths: description: Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm. operationId: put-security-role-name parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -35528,14 +34488,6 @@ paths: post: operationId: post-security-roles parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -35736,14 +34688,6 @@ paths: get: operationId: get-spaces-space parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: Specifies which authorization checks are applied to the API call. The default value is `any`. in: query name: purpose @@ -35791,14 +34735,6 @@ paths: post: operationId: post-spaces-space parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -35859,14 +34795,6 @@ paths: description: When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone. operationId: delete-spaces-space-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -35892,14 +34820,6 @@ paths: get: operationId: get-spaces-space-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The space identifier. in: path name: id @@ -35921,14 +34841,6 @@ paths: put: operationId: put-spaces-space-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -35994,14 +34906,6 @@ paths: get: operationId: get-status parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: Set to "true" to get the response in v7 format. in: query name: v7format diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 3c56597469133..aea9bacebd061 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -173,14 +173,6 @@ paths: description: You do not need any Kibana feature privileges to run this API. operationId: get-actions-connector-types parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases). in: query name: feature_id @@ -203,14 +195,6 @@ paths: description: 'WARNING: When you delete a connector, it cannot be recovered.' operationId: delete-actions-connector-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -233,14 +217,6 @@ paths: get: operationId: get-actions-connector-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: An identifier for the connector. in: path name: id @@ -296,14 +272,6 @@ paths: post: operationId: post-actions-connector-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -450,14 +418,6 @@ paths: put: operationId: put-actions-connector-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -587,14 +547,6 @@ paths: description: You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. operationId: post-actions-connector-id-execute parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -710,15 +662,7 @@ paths: /api/actions/connectors: get: operationId: get-actions-connectors - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': description: Indicates a successful call. @@ -1076,14 +1020,6 @@ paths: delete: operationId: delete-alerting-rule-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -1112,14 +1048,6 @@ paths: get: operationId: get-alerting-rule-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The identifier for the rule. in: path name: id @@ -1772,14 +1700,6 @@ paths: post: operationId: post-alerting-rule-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -2695,14 +2615,6 @@ paths: put: operationId: put-alerting-rule-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3577,14 +3489,6 @@ paths: post: operationId: post-alerting-rule-id-disable parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3626,14 +3530,6 @@ paths: post: operationId: post-alerting-rule-id-enable parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3663,14 +3559,6 @@ paths: post: operationId: post-alerting-rule-id-mute-all parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3700,14 +3588,6 @@ paths: post: operationId: post-alerting-rule-id-unmute-all parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3737,14 +3617,6 @@ paths: post: operationId: post-alerting-rule-id-update-api-key parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3776,14 +3648,6 @@ paths: post: operationId: post-alerting-rule-rule-id-alert-alert-id-mute parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3819,14 +3683,6 @@ paths: post: operationId: post-alerting-rule-rule-id-alert-alert-id-unmute parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -3862,14 +3718,6 @@ paths: get: operationId: get-alerting-rules-find parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The number of rules to return per page. in: query name: per_page @@ -7471,14 +7319,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: get-dashboards-dashboard parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The page number to return. Default is "1". in: query name: page @@ -7601,14 +7441,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: delete-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -7631,14 +7463,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: get-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A unique identifier for the dashboard. in: path name: id @@ -8102,14 +7926,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: post-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -8943,14 +8759,6 @@ paths: description: This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. operationId: put-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -14191,15 +13999,7 @@ paths: /api/fleet/agent_download_sources: get: operationId: get-fleet-agent-download-sources - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -14265,14 +14065,6 @@ paths: post: operationId: post-fleet-agent-download-sources parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -14360,14 +14152,6 @@ paths: description: Delete an agent binary download source by ID. operationId: delete-fleet-agent-download-sources-sourceid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -14415,14 +14199,6 @@ paths: description: Get an agent binary download source by ID. operationId: get-fleet-agent-download-sources-sourceid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: sourceId required: true @@ -14483,14 +14259,6 @@ paths: description: Update an agent binary download source by ID. operationId: put-fleet-agent-download-sources-sourceid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -14582,14 +14350,6 @@ paths: get: operationId: get-fleet-agent-policies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -15168,14 +14928,6 @@ paths: post: operationId: post-fleet-agent-policies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -15868,14 +15620,6 @@ paths: post: operationId: post-fleet-agent-policies-bulk-get parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -16421,14 +16165,6 @@ paths: description: Get an agent policy by ID. operationId: get-fleet-agent-policies-agentpolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentPolicyId required: true @@ -16950,14 +16686,6 @@ paths: description: Update an agent policy by ID. operationId: put-fleet-agent-policies-agentpolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -17659,14 +17387,6 @@ paths: description: Copy an agent policy by ID. operationId: post-fleet-agent-policies-agentpolicyid-copy parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18210,14 +17930,6 @@ paths: description: Download an agent policy by ID. operationId: get-fleet-agent-policies-agentpolicyid-download parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentPolicyId required: true @@ -18284,14 +17996,6 @@ paths: description: Get a full agent policy by ID. operationId: get-fleet-agent-policies-agentpolicyid-full parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentPolicyId required: true @@ -18640,14 +18344,6 @@ paths: description: Get a list of outputs associated with agent policy by policy id. operationId: get-fleet-agent-policies-agentpolicyid-outputs parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentPolicyId required: true @@ -18744,14 +18440,6 @@ paths: description: Delete an agent policy by ID. operationId: post-fleet-agent-policies-delete parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18812,14 +18500,6 @@ paths: description: Get a list of outputs associated with agent policies. operationId: post-fleet-agent-policies-outputs parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -18933,14 +18613,6 @@ paths: get: operationId: get-fleet-agent-status parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: policyId required: false @@ -19028,14 +18700,6 @@ paths: get: operationId: get-fleet-agent-status-data parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: agentsIds required: true @@ -19110,14 +18774,6 @@ paths: get: operationId: get-fleet-agents parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -19496,14 +19152,6 @@ paths: post: operationId: post-fleet-agents parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -19562,14 +19210,6 @@ paths: description: Delete an agent by ID. operationId: delete-fleet-agents-agentid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -19619,14 +19259,6 @@ paths: description: Get an agent by ID. operationId: get-fleet-agents-agentid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentId required: true @@ -19948,14 +19580,6 @@ paths: description: Update an agent by ID. operationId: put-fleet-agents-agentid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -20292,14 +19916,6 @@ paths: post: operationId: post-fleet-agents-agentid-actions parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -20436,14 +20052,6 @@ paths: post: operationId: post-fleet-agents-agentid-reassign parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -20498,14 +20106,6 @@ paths: post: operationId: post-fleet-agents-agentid-request-diagnostics parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -20567,14 +20167,6 @@ paths: post: operationId: post-fleet-agents-agentid-unenroll parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -20607,14 +20199,6 @@ paths: post: operationId: post-fleet-agents-agentid-upgrade parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -20675,14 +20259,6 @@ paths: get: operationId: get-fleet-agents-agentid-uploads parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: agentId required: true @@ -20755,14 +20331,6 @@ paths: get: operationId: get-fleet-agents-action-status parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -20920,14 +20488,6 @@ paths: post: operationId: post-fleet-agents-actions-actionid-cancel parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21013,15 +20573,7 @@ paths: /api/fleet/agents/available_versions: get: operationId: get-fleet-agents-available-versions - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -21059,14 +20611,6 @@ paths: post: operationId: post-fleet-agents-bulk-reassign parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21132,14 +20676,6 @@ paths: post: operationId: post-fleet-agents-bulk-request-diagnostics parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21205,14 +20741,6 @@ paths: post: operationId: post-fleet-agents-bulk-unenroll parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21283,14 +20811,6 @@ paths: post: operationId: post-fleet-agents-bulk-update-agent-tags parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21361,14 +20881,6 @@ paths: post: operationId: post-fleet-agents-bulk-upgrade parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21446,14 +20958,6 @@ paths: description: Delete a file uploaded by an agent. operationId: delete-fleet-agents-files-fileid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21505,14 +21009,6 @@ paths: description: Get a file uploaded by an agent. operationId: get-fleet-agents-files-fileid-filename parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: fileId required: true @@ -21551,15 +21047,7 @@ paths: /api/fleet/agents/setup: get: operationId: get-fleet-agents-setup - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -21619,14 +21107,6 @@ paths: post: operationId: post-fleet-agents-setup parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -21684,14 +21164,6 @@ paths: get: operationId: get-fleet-agents-tags parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: kuery required: false @@ -21740,14 +21212,6 @@ paths: get: operationId: get-fleet-check-permissions parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: fleetServerSetup required: false @@ -21793,15 +21257,7 @@ paths: /api/fleet/data_streams: get: operationId: get-fleet-data-streams - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -21898,14 +21354,6 @@ paths: get: operationId: get-fleet-enrollment-api-keys parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -22028,14 +21476,6 @@ paths: post: operationId: post-fleet-enrollment-api-keys parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -22126,14 +21566,6 @@ paths: description: Revoke an enrollment API key by ID by marking it as inactive. operationId: delete-fleet-enrollment-api-keys-keyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -22183,14 +21615,6 @@ paths: description: Get an enrollment API key by ID. operationId: get-fleet-enrollment-api-keys-keyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: keyId required: true @@ -22258,14 +21682,6 @@ paths: post: operationId: post-fleet-epm-bulk-assets parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -22356,14 +21772,6 @@ paths: get: operationId: get-fleet-epm-categories parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: prerelease required: false @@ -22427,14 +21835,6 @@ paths: post: operationId: post-fleet-epm-custom-integrations parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -22569,14 +21969,6 @@ paths: get: operationId: get-fleet-epm-data-streams parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: type required: false @@ -22651,14 +22043,6 @@ paths: get: operationId: get-fleet-epm-packages parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: category required: false @@ -23050,14 +22434,6 @@ paths: post: operationId: post-fleet-epm-packages parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -23177,14 +22553,6 @@ paths: post: operationId: post-fleet-epm-packages-bulk parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -23359,14 +22727,6 @@ paths: delete: operationId: delete-fleet-epm-packages-pkgname-pkgversion parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -23473,14 +22833,6 @@ paths: get: operationId: get-fleet-epm-packages-pkgname-pkgversion parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: pkgName required: true @@ -23952,14 +23304,6 @@ paths: post: operationId: post-fleet-epm-packages-pkgname-pkgversion parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -24101,14 +23445,6 @@ paths: put: operationId: put-fleet-epm-packages-pkgname-pkgversion parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -24570,14 +23906,6 @@ paths: get: operationId: get-fleet-epm-packages-pkgname-pkgversion-filepath parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: pkgName required: true @@ -24621,14 +23949,6 @@ paths: post: operationId: post-fleet-epm-packages-pkgname-pkgversion-transforms-authorize parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -24713,14 +24033,6 @@ paths: get: operationId: get-fleet-epm-packages-pkgname-stats parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: pkgName required: true @@ -24767,14 +24079,6 @@ paths: get: operationId: get-fleet-epm-packages-installed parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: dataStreamType required: false @@ -24919,15 +24223,7 @@ paths: /api/fleet/epm/packages/limited: get: operationId: get-fleet-epm-packages-limited - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -24965,14 +24261,6 @@ paths: get: operationId: get-fleet-epm-templates-pkgname-pkgversion-inputs parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: pkgName required: true @@ -25071,15 +24359,7 @@ paths: /api/fleet/epm/verification_key_id: get: operationId: get-fleet-epm-verification-key-id - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -25115,15 +24395,7 @@ paths: /api/fleet/fleet_server_hosts: get: operationId: get-fleet-fleet-server-hosts - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -25195,14 +24467,6 @@ paths: post: operationId: post-fleet-fleet-server-hosts parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -25302,14 +24566,6 @@ paths: description: Delete a Fleet Server host by ID. operationId: delete-fleet-fleet-server-hosts-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -25357,14 +24613,6 @@ paths: description: Get a Fleet Server host by ID. operationId: get-fleet-fleet-server-hosts-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: itemId required: true @@ -25431,14 +24679,6 @@ paths: description: Update a Fleet Server host by ID. operationId: put-fleet-fleet-server-hosts-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -25535,14 +24775,6 @@ paths: post: operationId: post-fleet-health-check parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -25616,14 +24848,6 @@ paths: get: operationId: get-fleet-kubernetes parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: download required: false @@ -25674,14 +24898,6 @@ paths: get: operationId: get-fleet-kubernetes-download parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: download required: false @@ -25742,14 +24958,6 @@ paths: post: operationId: post-fleet-logstash-api-keys parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -25792,14 +25000,6 @@ paths: post: operationId: post-fleet-message-signing-service-rotate-key-pair parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -25863,15 +25063,7 @@ paths: /api/fleet/outputs: get: operationId: get-fleet-outputs - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -26596,14 +25788,6 @@ paths: post: operationId: post-fleet-outputs parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -28010,14 +27194,6 @@ paths: description: Delete output by ID. operationId: delete-fleet-outputs-outputid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -28081,14 +27257,6 @@ paths: description: Get output by ID. operationId: get-fleet-outputs-outputid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: outputId required: true @@ -28808,14 +27976,6 @@ paths: description: Update output by ID. operationId: put-fleet-outputs-outputid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -30205,14 +29365,6 @@ paths: get: operationId: get-fleet-outputs-outputid-health parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: outputId required: true @@ -30262,14 +29414,6 @@ paths: get: operationId: get-fleet-package-policies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: query name: page required: false @@ -30734,14 +29878,6 @@ paths: post: operationId: post-fleet-package-policies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -31584,14 +30720,6 @@ paths: post: operationId: post-fleet-package-policies-bulk-get parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -32045,14 +31173,6 @@ paths: description: Delete a package policy by ID. operationId: delete-fleet-package-policies-packagepolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -32105,14 +31225,6 @@ paths: description: Get a package policy by ID. operationId: get-fleet-package-policies-packagepolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: packagePolicyId required: true @@ -32545,14 +31657,6 @@ paths: description: Update a package policy by ID. operationId: put-fleet-package-policies-packagepolicyid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -33393,14 +32497,6 @@ paths: post: operationId: post-fleet-package-policies-delete parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -33530,14 +32626,6 @@ paths: description: Upgrade a package policy to a newer package version. operationId: post-fleet-package-policies-upgrade parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -33610,14 +32698,6 @@ paths: post: operationId: post-fleet-package-policies-upgrade-dryrun parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -34409,15 +33489,7 @@ paths: /api/fleet/proxies: get: operationId: get-fleet-proxies - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -34495,14 +33567,6 @@ paths: post: operationId: post-fleet-proxies parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -34614,14 +33678,6 @@ paths: description: Delete a proxy by ID operationId: delete-fleet-proxies-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -34669,14 +33725,6 @@ paths: description: Get a proxy by ID. operationId: get-fleet-proxies-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: itemId required: true @@ -34749,14 +33797,6 @@ paths: description: Update a proxy by ID. operationId: put-fleet-proxies-itemid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -34869,14 +33909,6 @@ paths: post: operationId: post-fleet-service-tokens parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -34932,15 +33964,7 @@ paths: /api/fleet/settings: get: operationId: get-fleet-settings - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string + parameters: [] responses: '200': content: @@ -35028,14 +34052,6 @@ paths: put: operationId: put-fleet-settings parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -35162,14 +34178,6 @@ paths: post: operationId: post-fleet-setup parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -35240,14 +34248,6 @@ paths: description: List the metadata for the latest uninstall tokens per agent policy. operationId: get-fleet-uninstall-tokens parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: Partial match filtering for policy IDs in: query name: policyId @@ -35340,14 +34340,6 @@ paths: description: Get one decrypted uninstall token by its ID. operationId: get-fleet-uninstall-tokens-uninstalltokenid parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - in: path name: uninstallTokenId required: true @@ -38498,14 +37490,6 @@ paths: get: operationId: get-security-role parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. in: query name: replaceDeprecatedPrivileges @@ -38527,14 +37511,6 @@ paths: delete: operationId: delete-security-role-name parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -38557,14 +37533,6 @@ paths: get: operationId: get-security-role-name parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The role name. in: path name: name @@ -38593,14 +37561,6 @@ paths: description: Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm. operationId: put-security-role-name parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -38816,14 +37776,6 @@ paths: post: operationId: post-security-roles parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -39024,14 +37976,6 @@ paths: description: 'It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.

[Required authorization] Route required privileges: ALL of [copySavedObjectsToSpaces].' operationId: post-spaces-copy-saved-objects parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -39110,14 +38054,6 @@ paths: post: operationId: post-spaces-disable-legacy-url-aliases parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -39165,14 +38101,6 @@ paths: description: Collect references and space contexts for saved objects. operationId: post-spaces-get-shareable-references parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -39211,14 +38139,6 @@ paths: description: 'Overwrite saved objects that are returned as errors from the copy saved objects to space API.

[Required authorization] Route required privileges: ALL of [copySavedObjectsToSpaces].' operationId: post-spaces-resolve-copy-saved-objects-errors parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -39309,14 +38229,6 @@ paths: description: Update one or more saved objects to add or remove them from some spaces. operationId: post-spaces-update-objects-spaces parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -39377,14 +38289,6 @@ paths: get: operationId: get-spaces-space parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: Specifies which authorization checks are applied to the API call. The default value is `any`. in: query name: purpose @@ -39431,14 +38335,6 @@ paths: post: operationId: post-spaces-space parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -39505,14 +38401,6 @@ paths: description: When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone. operationId: delete-spaces-space-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -39537,14 +38425,6 @@ paths: get: operationId: get-spaces-space-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The space identifier. in: path name: id @@ -39565,14 +38445,6 @@ paths: put: operationId: put-spaces-space-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -39644,14 +38516,6 @@ paths: get: operationId: get-status parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: Set to "true" to get the response in v7 format. in: query name: v7format diff --git a/package.json b/package.json index c35b4daccb349..05f10169d5e81 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "@elastic/numeral": "^2.5.1", "@elastic/react-search-ui": "^1.20.2", "@elastic/react-search-ui-views": "^1.20.2", - "@elastic/request-converter": "^8.16.2", + "@elastic/request-converter": "^8.17.0", "@elastic/request-crypto": "^2.0.3", "@elastic/search-ui": "^1.20.2", "@elastic/search-ui-app-search-connector": "^1.20.2", @@ -460,7 +460,7 @@ "@kbn/discover-plugin": "link:src/plugins/discover", "@kbn/discover-shared-plugin": "link:src/plugins/discover_shared", "@kbn/discover-utils": "link:packages/kbn-discover-utils", - "@kbn/doc-links": "link:packages/kbn-doc-links", + "@kbn/doc-links": "link:src/platform/packages/shared/kbn-doc-links", "@kbn/dom-drag-drop": "link:packages/kbn-dom-drag-drop", "@kbn/ebt-tools": "link:packages/kbn-ebt-tools", "@kbn/ecs-data-quality-dashboard": "link:x-pack/packages/security-solution/ecs_data_quality_dashboard", diff --git a/packages/cloud/connection_details/kibana/global.ts b/packages/cloud/connection_details/kibana/global.ts index 40c883bc06375..5bd205c7bf459 100644 --- a/packages/cloud/connection_details/kibana/global.ts +++ b/packages/cloud/connection_details/kibana/global.ts @@ -21,6 +21,7 @@ export interface ConnectionDetailsGlobalDependencies { http: CoreStart['http']; application: CoreStart['application']; overlays: CoreStart['overlays']; + userProfile: CoreStart['userProfile']; }; plugins: { cloud?: CloudStart; diff --git a/packages/cloud/connection_details/kibana/open_connection_details.tsx b/packages/cloud/connection_details/kibana/open_connection_details.tsx index 8d231e2645ab0..f055a8ddaf70f 100644 --- a/packages/cloud/connection_details/kibana/open_connection_details.tsx +++ b/packages/cloud/connection_details/kibana/open_connection_details.tsx @@ -21,6 +21,7 @@ export interface OpenConnectionDetailsParams { i18n: CoreStart['i18n']; analytics?: CoreStart['analytics']; theme: CoreStart['theme']; + userProfile: CoreStart['userProfile']; }; }; } diff --git a/packages/content-management/content_editor/src/services.tsx b/packages/content-management/content_editor/src/services.tsx index ee0e66b10300c..7170940665188 100644 --- a/packages/content-management/content_editor/src/services.tsx +++ b/packages/content-management/content_editor/src/services.tsx @@ -20,6 +20,7 @@ import type { I18nStart } from '@kbn/core-i18n-browser'; import type { MountPoint, OverlayRef } from '@kbn/core-mount-utils-browser'; import type { OverlayFlyoutOpenOptions } from '@kbn/core-overlays-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { toMountPoint } from '@kbn/react-kibana-mount'; type NotifyFn = (title: JSX.Element, text?: string) => void; @@ -68,6 +69,7 @@ interface ContentEditorStartServices { analytics: Pick; i18n: I18nStart; theme: Pick; + userProfile: UserProfileService; } /** diff --git a/packages/content-management/content_editor/tsconfig.json b/packages/content-management/content_editor/tsconfig.json index 565535ec85b3e..832da409a06fd 100644 --- a/packages/content-management/content_editor/tsconfig.json +++ b/packages/content-management/content_editor/tsconfig.json @@ -30,6 +30,7 @@ "@kbn/test-jest-helpers", "@kbn/react-kibana-mount", "@kbn/content-management-user-profiles", + "@kbn/core-user-profile-browser", ], "exclude": [ "target/**/*" diff --git a/packages/content-management/table_list_view_table/src/services.tsx b/packages/content-management/table_list_view_table/src/services.tsx index ab6e875789278..a8c3d3cc9f60b 100644 --- a/packages/content-management/table_list_view_table/src/services.tsx +++ b/packages/content-management/table_list_view_table/src/services.tsx @@ -24,7 +24,7 @@ import type { I18nStart } from '@kbn/core-i18n-browser'; import type { MountPoint, OverlayRef } from '@kbn/core-mount-utils-browser'; import type { OverlayFlyoutOpenOptions } from '@kbn/core-overlays-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; -import type { UserProfileServiceStart } from '@kbn/core-user-profile-browser'; +import type { UserProfileService, UserProfileServiceStart } from '@kbn/core-user-profile-browser'; import type { FormattedRelative } from '@kbn/i18n-react'; import { toMountPoint } from '@kbn/react-kibana-mount'; import { RedirectAppLinksKibanaProvider } from '@kbn/shared-ux-link-redirect-app'; @@ -100,6 +100,7 @@ interface TableListViewStartServices { analytics: Pick; i18n: I18nStart; theme: Pick; + userProfile: UserProfileService; } /** diff --git a/packages/core/apps/core-apps-browser-internal/src/core_app.ts b/packages/core/apps/core-apps-browser-internal/src/core_app.ts index 419efaef039fe..87f921133421b 100644 --- a/packages/core/apps/core-apps-browser-internal/src/core_app.ts +++ b/packages/core/apps/core-apps-browser-internal/src/core_app.ts @@ -22,6 +22,7 @@ import type { import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { renderApp as renderStatusApp } from './status'; import { renderApp as renderErrorApp, @@ -45,6 +46,7 @@ export interface CoreAppsServiceStartDeps { analytics: AnalyticsServiceStart; i18n: I18nStart; theme: ThemeServiceStart; + userProfile: UserProfileService; } export class CoreAppsService { @@ -86,9 +88,7 @@ export class CoreAppsService { http, notifications, uiSettings, - analytics, - i18n, - theme, + ...startDeps }: CoreAppsServiceStartDeps) { if (!application.history) { return; @@ -101,7 +101,7 @@ export class CoreAppsService { uiSettings, }); - setupPublicBaseUrlConfigWarning({ docLinks, http, notifications, analytics, i18n, theme }); + setupPublicBaseUrlConfigWarning({ docLinks, http, notifications, ...startDeps }); } public stop() { diff --git a/packages/core/apps/core-apps-browser-internal/src/errors/public_base_url.test.tsx b/packages/core/apps/core-apps-browser-internal/src/errors/public_base_url.test.tsx index 58743f339accc..20159d54116a4 100644 --- a/packages/core/apps/core-apps-browser-internal/src/errors/public_base_url.test.tsx +++ b/packages/core/apps/core-apps-browser-internal/src/errors/public_base_url.test.tsx @@ -13,6 +13,7 @@ import { httpServiceMock } from '@kbn/core-http-browser-mocks'; import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; import { themeServiceMock } from '@kbn/core-theme-browser-mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; import { setupPublicBaseUrlConfigWarning } from './public_base_url'; @@ -22,12 +23,8 @@ describe('publicBaseUrl warning', () => { const i18nStart = i18nServiceMock.createStartContract(); const analytics = analyticsServiceMock.createAnalyticsServiceStart(); const theme = themeServiceMock.createStartContract(); - const startServices = { - notifications, - analytics, - i18n: i18nStart, - theme, - }; + const userProfile = userProfileServiceMock.createStart(); + const startServices = { notifications, analytics, i18n: i18nStart, theme, userProfile }; const addWarningToastSpy = jest.spyOn(notifications.toasts, 'addWarning'); beforeEach(() => { diff --git a/packages/core/apps/core-apps-browser-internal/src/errors/public_base_url.tsx b/packages/core/apps/core-apps-browser-internal/src/errors/public_base_url.tsx index 758c85ed04816..a0b8baf8e815c 100644 --- a/packages/core/apps/core-apps-browser-internal/src/errors/public_base_url.tsx +++ b/packages/core/apps/core-apps-browser-internal/src/errors/public_base_url.tsx @@ -16,6 +16,7 @@ import type { DocLinksStart } from '@kbn/core-doc-links-browser'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { InternalHttpStart } from '@kbn/core-http-browser-internal'; import type { NotificationsStart } from '@kbn/core-notifications-browser'; import { mountReactNode } from '@kbn/core-mount-utils-browser-internal'; @@ -35,6 +36,7 @@ interface Deps { analytics: AnalyticsServiceStart; i18n: I18nStart; theme: ThemeServiceStart; + userProfile: UserProfileService; } export const setupPublicBaseUrlConfigWarning = ({ diff --git a/packages/core/apps/core-apps-browser-internal/tsconfig.json b/packages/core/apps/core-apps-browser-internal/tsconfig.json index 9902b12732760..499f4b975f6d8 100644 --- a/packages/core/apps/core-apps-browser-internal/tsconfig.json +++ b/packages/core/apps/core-apps-browser-internal/tsconfig.json @@ -40,7 +40,9 @@ "@kbn/react-kibana-context-render", "@kbn/core-analytics-browser-mocks", "@kbn/core-i18n-browser-mocks", - "@kbn/core-theme-browser-mocks" + "@kbn/core-theme-browser-mocks", + "@kbn/core-user-profile-browser", + "@kbn/core-user-profile-browser-mocks" ], "exclude": [ "target/**/*" diff --git a/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.test.tsx b/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.test.tsx index 4994302c2e756..ade55365409cb 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.test.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.test.tsx @@ -24,6 +24,7 @@ import { customBrandingServiceMock } from '@kbn/core-custom-branding-browser-moc import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks'; import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; import { themeServiceMock } from '@kbn/core-theme-browser-mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; import { getAppInfo } from '@kbn/core-application-browser-internal'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import { findTestSubject } from '@kbn/test-jest-helpers'; @@ -55,6 +56,7 @@ function defaultStartDeps(availableApps?: App[], currentAppId?: string) { analytics: analyticsServiceMock.createAnalyticsServiceStart(), i18n: i18nServiceMock.createStartContract(), theme: themeServiceMock.createStartContract(), + userProfile: userProfileServiceMock.createStart(), application: applicationServiceMock.createInternalStartContract(currentAppId), docLinks: docLinksServiceMock.createStartContract(), http: httpServiceMock.createStartContract(), diff --git a/packages/core/chrome/core-chrome-browser-internal/tsconfig.json b/packages/core/chrome/core-chrome-browser-internal/tsconfig.json index d4512b515f640..ca9e5d5576ad9 100644 --- a/packages/core/chrome/core-chrome-browser-internal/tsconfig.json +++ b/packages/core/chrome/core-chrome-browser-internal/tsconfig.json @@ -55,6 +55,7 @@ "@kbn/core-theme-browser-mocks", "@kbn/react-kibana-context-render", "@kbn/recently-accessed", + "@kbn/core-user-profile-browser-mocks", ], "exclude": [ "target/**/*", diff --git a/packages/core/http/core-http-router-server-internal/index.ts b/packages/core/http/core-http-router-server-internal/index.ts index 6aa6ac117f533..0e048c59144df 100644 --- a/packages/core/http/core-http-router-server-internal/index.ts +++ b/packages/core/http/core-http-router-server-internal/index.ts @@ -11,7 +11,7 @@ export { filterHeaders } from './src/headers'; export { versionHandlerResolvers, CoreVersionedRouter, - ALLOWED_PUBLIC_VERSION, + BASE_PUBLIC_VERSION, unwrapVersionedResponseBodyValidation, type HandlerResolutionStrategy, } from './src/versioned_router'; diff --git a/packages/core/http/core-http-router-server-internal/src/router.ts b/packages/core/http/core-http-router-server-internal/src/router.ts index c3e44f8bc9d7b..d1640a4db6db1 100644 --- a/packages/core/http/core-http-router-server-internal/src/router.ts +++ b/packages/core/http/core-http-router-server-internal/src/router.ts @@ -35,7 +35,7 @@ import { validBodyOutput, getRequestValidation } from '@kbn/core-http-server'; import type { RouteSecurityGetter } from '@kbn/core-http-server'; import type { DeepPartial } from '@kbn/utility-types'; import { RouteValidator } from './validator'; -import { ALLOWED_PUBLIC_VERSION, CoreVersionedRouter } from './versioned_router'; +import { BASE_PUBLIC_VERSION, CoreVersionedRouter } from './versioned_router'; import { CoreKibanaRequest } from './request'; import { kibanaResponseFactory } from './response'; import { HapiResponseAdapter } from './response_adapter'; @@ -339,7 +339,7 @@ export class Router showErrorDialog({ title, error, openModal: overlays.openModal, - analytics, - i18n: i18nDep, - theme, + ...startDeps, }), }; } diff --git a/packages/core/notifications/core-notifications-browser-internal/src/toasts/__snapshots__/error_toast.test.tsx.snap b/packages/core/notifications/core-notifications-browser-internal/src/toasts/__snapshots__/error_toast.test.tsx.snap index cb82dd49db745..73b165848162e 100644 --- a/packages/core/notifications/core-notifications-browser-internal/src/toasts/__snapshots__/error_toast.test.tsx.snap +++ b/packages/core/notifications/core-notifications-browser-internal/src/toasts/__snapshots__/error_toast.test.tsx.snap @@ -29,6 +29,16 @@ exports[`renders matching snapshot 1`] = ` }, } } + userProfile={ + Object { + "bulkGet": [MockFunction], + "getCurrent": [MockFunction], + "getUserProfile$": [MockFunction], + "partialUpdate": [MockFunction], + "suggest": [MockFunction], + "update": [MockFunction], + } + } >

(openModal = jest.fn())); @@ -39,6 +41,7 @@ function render(props: ErrorToastProps = {}) { analytics={mockAnalytics} i18n={mockI18n} theme={mockTheme} + userProfile={mockUserProfile} /> ); } diff --git a/packages/core/notifications/core-notifications-browser-internal/src/toasts/error_toast.tsx b/packages/core/notifications/core-notifications-browser-internal/src/toasts/error_toast.tsx index c8c914f2ef9d7..2805fc2bc14a8 100644 --- a/packages/core/notifications/core-notifications-browser-internal/src/toasts/error_toast.tsx +++ b/packages/core/notifications/core-notifications-browser-internal/src/toasts/error_toast.tsx @@ -25,11 +25,13 @@ import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { OverlayStart } from '@kbn/core-overlays-browser'; import { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; interface StartServices { analytics: AnalyticsServiceStart; i18n: I18nStart; + userProfile: UserProfileService; theme: ThemeServiceStart; } @@ -62,7 +64,10 @@ export function showErrorDialog({ error, openModal, ...startServices -}: Pick) { +}: Pick< + ErrorToastProps, + 'error' | 'title' | 'openModal' | 'analytics' | 'i18n' | 'userProfile' | 'theme' +>) { let text = ''; if (isRequestError(error)) { diff --git a/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.test.ts b/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.test.ts index 503bdb63578da..253c6376eb9b1 100644 --- a/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.test.ts +++ b/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.test.ts @@ -12,8 +12,10 @@ import { firstValueFrom } from 'rxjs'; import { ToastsApi } from './toasts_api'; import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks'; +import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks'; import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; import { themeServiceMock } from '@kbn/core-theme-browser-mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; async function getCurrentToasts(toasts: ToastsApi) { return await firstValueFrom(toasts.get$()); @@ -45,8 +47,10 @@ function toastDeps() { function startDeps() { return { overlays: {} as any, + analytics: analyticsServiceMock.createAnalyticsServiceStart(), i18n: i18nServiceMock.createStartContract(), theme: themeServiceMock.createStartContract(), + userProfile: userProfileServiceMock.createStart(), }; } diff --git a/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx b/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx index 7d6ab2f93b88f..ece936f0cf6ce 100644 --- a/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx +++ b/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_api.tsx @@ -24,7 +24,8 @@ import type { ToastInputFields, ToastOptions, } from '@kbn/core-notifications-browser'; -import { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { ErrorToast } from './error_toast'; const normalizeToast = (toastOrTitle: ToastInput): ToastInputFields => { @@ -36,6 +37,14 @@ const normalizeToast = (toastOrTitle: ToastInput): ToastInputFields => { return omitBy(toastOrTitle, isUndefined); }; +interface StartDeps { + analytics: AnalyticsServiceStart; + overlays: OverlayStart; + i18n: I18nStart; + theme: ThemeServiceStart; + userProfile: UserProfileService; +} + /** * Methods for adding and removing global toast messages. * @public @@ -45,28 +54,15 @@ export class ToastsApi implements IToasts { private idCounter = 0; private uiSettings: IUiSettingsClient; - private overlays?: OverlayStart; - private analytics?: AnalyticsServiceStart; - private i18n?: I18nStart; - private theme?: ThemeServiceStart; + private startDeps?: StartDeps; constructor(deps: { uiSettings: IUiSettingsClient }) { this.uiSettings = deps.uiSettings; } /** @internal */ - public start({ - overlays, - i18n, - theme, - }: { - overlays: OverlayStart; - i18n: I18nStart; - theme: ThemeServiceStart; - }) { - this.overlays = overlays; - this.i18n = i18n; - this.theme = theme; + public start(startDeps: StartDeps) { + this.startDeps = startDeps; } /** Observable of the toast messages to show to the user. */ @@ -190,9 +186,7 @@ export class ToastsApi implements IToasts { error={error} title={options.title} toastMessage={message} - analytics={this.analytics!} - i18n={this.i18n!} - theme={this.theme!} + {...this.startDeps!} /> ), ...options, @@ -202,12 +196,13 @@ export class ToastsApi implements IToasts { private openModal( ...args: Parameters ): ReturnType { - if (!this.overlays) { + const { overlays } = this.startDeps ?? {}; + if (!overlays) { // This case should never happen because no rendering should be occurring // before the ToastService is started. throw new Error(`Modal opened before ToastService was started.`); } - return this.overlays.openModal(...args); + return overlays.openModal(...args); } } diff --git a/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_service.test.tsx b/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_service.test.tsx index 4fa2d6f27db73..d350b9b8d62ca 100644 --- a/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_service.test.tsx +++ b/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_service.test.tsx @@ -13,6 +13,7 @@ import { ToastsService } from './toasts_service'; import { ToastsApi } from './toasts_api'; import { overlayServiceMock } from '@kbn/core-overlays-browser-mocks'; import { themeServiceMock } from '@kbn/core-theme-browser-mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks'; import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks'; import { EventReporter } from './telemetry'; @@ -25,6 +26,7 @@ const mockI18n: any = { const mockOverlays = overlayServiceMock.createStartContract(); const mockTheme = themeServiceMock.createStartContract(); +const mockUserProfile = userProfileServiceMock.createStart(); const mockAnalytics = analyticsServiceMock.createAnalyticsServiceStart(); const eventReporter = new EventReporter({ analytics: mockAnalytics }); @@ -51,6 +53,7 @@ describe('#start()', () => { analytics: mockAnalytics, i18n: mockI18n, theme: mockTheme, + userProfile: mockUserProfile, targetDomElement, overlays: mockOverlays, eventReporter, @@ -70,6 +73,7 @@ describe('#start()', () => { analytics: mockAnalytics, i18n: mockI18n, theme: mockTheme, + userProfile: mockUserProfile, targetDomElement, overlays: mockOverlays, eventReporter, @@ -89,6 +93,7 @@ describe('#stop()', () => { analytics: mockAnalytics, i18n: mockI18n, theme: mockTheme, + userProfile: mockUserProfile, targetDomElement, overlays: mockOverlays, eventReporter, @@ -115,6 +120,7 @@ describe('#stop()', () => { analytics: mockAnalytics, i18n: mockI18n, theme: mockTheme, + userProfile: mockUserProfile, targetDomElement, overlays: mockOverlays, eventReporter, diff --git a/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_service.tsx b/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_service.tsx index 44166df388c4c..c37313e9613c1 100644 --- a/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_service.tsx +++ b/packages/core/notifications/core-notifications-browser-internal/src/toasts/toasts_service.tsx @@ -12,6 +12,7 @@ import { render, unmountComponentAtNode } from 'react-dom'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; import type { OverlayStart } from '@kbn/core-overlays-browser'; @@ -29,6 +30,7 @@ interface StartDeps { i18n: I18nStart; overlays: OverlayStart; theme: ThemeServiceStart; + userProfile: UserProfileService; eventReporter: EventReporter; targetDomElement: HTMLElement; } @@ -42,12 +44,12 @@ export class ToastsService { return this.api!; } - public start({ eventReporter, analytics, i18n, overlays, theme, targetDomElement }: StartDeps) { - this.api!.start({ overlays, i18n, theme }); + public start({ eventReporter, overlays, targetDomElement, ...startDeps }: StartDeps) { + this.api!.start({ overlays, ...startDeps }); this.targetDomElement = targetDomElement; render( - + this.api!.remove(toastId)} toasts$={this.api!.get$()} diff --git a/packages/core/notifications/core-notifications-browser-internal/tsconfig.json b/packages/core/notifications/core-notifications-browser-internal/tsconfig.json index c3582c1b8925b..0aa4081925399 100644 --- a/packages/core/notifications/core-notifications-browser-internal/tsconfig.json +++ b/packages/core/notifications/core-notifications-browser-internal/tsconfig.json @@ -30,7 +30,9 @@ "@kbn/core-mount-utils-browser", "@kbn/react-kibana-context-render", "@kbn/core-analytics-browser", - "@kbn/core-analytics-browser-mocks" + "@kbn/core-analytics-browser-mocks", + "@kbn/core-user-profile-browser", + "@kbn/core-user-profile-browser-mocks" ], "exclude": [ "target/**/*", diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_service.test.ts b/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_service.test.ts index 40174b5dcff42..d54902ed8ad9d 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_service.test.ts +++ b/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_service.test.ts @@ -13,6 +13,7 @@ import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks'; import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; import { themeServiceMock } from '@kbn/core-theme-browser-mocks'; import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; describe('OverlayBannersService', () => { let service: InternalOverlayBannersStart; @@ -22,6 +23,7 @@ describe('OverlayBannersService', () => { i18n: i18nServiceMock.createStartContract(), theme: themeServiceMock.createStartContract(), uiSettings: uiSettingsServiceMock.createStartContract(), + userProfile: userProfileServiceMock.createStart(), }); }); diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_service.tsx b/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_service.tsx index 31a43407ba8be..5147d49e897c7 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_service.tsx +++ b/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_service.tsx @@ -14,6 +14,7 @@ import { map } from 'rxjs'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; import type { MountPoint } from '@kbn/core-mount-utils-browser'; import type { OverlayBannersStart } from '@kbn/core-overlays-browser'; @@ -25,6 +26,7 @@ interface StartServices { analytics: AnalyticsServiceStart; i18n: I18nStart; theme: ThemeServiceStart; + userProfile: UserProfileService; } interface StartDeps extends StartServices { diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.test.ts b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.test.ts index 9297e645a033f..a9023f025d4ba 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.test.ts +++ b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.test.ts @@ -13,6 +13,7 @@ import { overlayBannersServiceMock } from './banners_service.test.mocks'; import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks'; import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; import { themeServiceMock } from '@kbn/core-theme-browser-mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; import { Subject } from 'rxjs'; describe('OverlayBannersService', () => { @@ -20,6 +21,7 @@ describe('OverlayBannersService', () => { let service: UserBannerService; let uiSettings: ReturnType; let banners: ReturnType; + let userProfile: ReturnType; const startService = (content?: string) => { bannerContent = content; @@ -40,6 +42,7 @@ describe('OverlayBannersService', () => { i18n: i18nServiceMock.createStartContract(), theme: themeServiceMock.createStartContract(), uiSettings, + userProfile, }); }; diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx index 7b7c2e45e8e39..94bc96c9b0c05 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx +++ b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx @@ -17,6 +17,7 @@ import { EuiCallOut, EuiButton, EuiLoadingSpinner } from '@elastic/eui'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; import type { OverlayBannersStart } from '@kbn/core-overlays-browser'; @@ -26,6 +27,7 @@ interface StartServices { analytics: AnalyticsServiceStart; i18n: I18nStart; theme: ThemeServiceStart; + userProfile: UserProfileService; } interface StartDeps extends StartServices { diff --git a/packages/core/overlays/core-overlays-browser-internal/src/flyout/__snapshots__/flyout_service.test.tsx.snap b/packages/core/overlays/core-overlays-browser-internal/src/flyout/__snapshots__/flyout_service.test.tsx.snap index a41da1f45af56..9df54435ba9a0 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/flyout/__snapshots__/flyout_service.test.tsx.snap +++ b/packages/core/overlays/core-overlays-browser-internal/src/flyout/__snapshots__/flyout_service.test.tsx.snap @@ -39,6 +39,16 @@ Array [ }, } } + userProfile={ + Object { + "bulkGet": [MockFunction], + "getCurrent": [MockFunction], + "getUserProfile$": [MockFunction], + "partialUpdate": [MockFunction], + "suggest": [MockFunction], + "update": [MockFunction], + } + } > { mockReactDomRender.mockClear(); @@ -39,6 +41,7 @@ const getServiceStart = () => { analytics: analyticsMock, i18n: i18nMock, theme: themeMock, + userProfile: userProfileMock, targetDomElement: document.createElement('div'), }); }; diff --git a/packages/core/overlays/core-overlays-browser-internal/src/flyout/flyout_service.tsx b/packages/core/overlays/core-overlays-browser-internal/src/flyout/flyout_service.tsx index 3cd9cc29c1001..b98e6c05ae50c 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/flyout/flyout_service.tsx +++ b/packages/core/overlays/core-overlays-browser-internal/src/flyout/flyout_service.tsx @@ -15,6 +15,7 @@ import { render, unmountComponentAtNode } from 'react-dom'; import { Subject } from 'rxjs'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { MountPoint, OverlayRef } from '@kbn/core-mount-utils-browser'; import { MountWrapper } from '@kbn/core-mount-utils-browser-internal'; @@ -65,6 +66,7 @@ interface StartDeps { analytics: AnalyticsServiceStart; i18n: I18nStart; theme: ThemeServiceStart; + userProfile: UserProfileService; targetDomElement: Element; } @@ -73,7 +75,13 @@ export class FlyoutService { private activeFlyout: FlyoutRef | null = null; private targetDomElement: Element | null = null; - public start({ analytics, i18n, theme, targetDomElement }: StartDeps): OverlayFlyoutStart { + public start({ + analytics, + i18n, + theme, + userProfile, + targetDomElement, + }: StartDeps): OverlayFlyoutStart { this.targetDomElement = targetDomElement; return { @@ -121,7 +129,12 @@ export class FlyoutService { }; render( - + {getWrapper()} , this.targetDomElement diff --git a/packages/core/overlays/core-overlays-browser-internal/src/modal/__snapshots__/modal_service.test.tsx.snap b/packages/core/overlays/core-overlays-browser-internal/src/modal/__snapshots__/modal_service.test.tsx.snap index 5b1bb22336493..cc2dc671f9210 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/modal/__snapshots__/modal_service.test.tsx.snap +++ b/packages/core/overlays/core-overlays-browser-internal/src/modal/__snapshots__/modal_service.test.tsx.snap @@ -108,6 +108,16 @@ Array [ }, } } + userProfile={ + Object { + "bulkGet": [MockFunction], + "getCurrent": [MockFunction], + "getUserProfile$": [MockFunction], + "partialUpdate": [MockFunction], + "suggest": [MockFunction], + "update": [MockFunction], + } + } > { mockReactDomRender.mockClear(); @@ -34,6 +36,7 @@ const getServiceStart = () => { analytics: analyticsMock, i18n: i18nMock, theme: themeMock, + userProfile: userProfileMock, targetDomElement: document.createElement('div'), }); }; diff --git a/packages/core/overlays/core-overlays-browser-internal/src/modal/modal_service.tsx b/packages/core/overlays/core-overlays-browser-internal/src/modal/modal_service.tsx index 8158f1c383116..d81c4cfdb41f5 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/modal/modal_service.tsx +++ b/packages/core/overlays/core-overlays-browser-internal/src/modal/modal_service.tsx @@ -16,6 +16,7 @@ import { render, unmountComponentAtNode } from 'react-dom'; import { Subject } from 'rxjs'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { MountPoint, OverlayRef } from '@kbn/core-mount-utils-browser'; import { MountWrapper } from '@kbn/core-mount-utils-browser-internal'; @@ -58,6 +59,7 @@ class ModalRef implements OverlayRef { interface StartDeps { i18n: I18nStart; theme: ThemeServiceStart; + userProfile: UserProfileService; analytics: AnalyticsServiceStart; targetDomElement: Element; } @@ -67,7 +69,7 @@ export class ModalService { private activeModal: ModalRef | null = null; private targetDomElement: Element | null = null; - public start({ analytics, i18n, theme, targetDomElement }: StartDeps): OverlayModalStart { + public start({ targetDomElement, ...startDeps }: StartDeps): OverlayModalStart { this.targetDomElement = targetDomElement; return { @@ -90,7 +92,7 @@ export class ModalService { this.activeModal = modal; render( - + modal.close()}> @@ -150,7 +152,7 @@ export class ModalService { }; render( - + , targetDomElement diff --git a/packages/core/overlays/core-overlays-browser-internal/src/overlay_service.ts b/packages/core/overlays/core-overlays-browser-internal/src/overlay_service.ts index 68b3eac75e3ee..1501cd19cf7d4 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/overlay_service.ts +++ b/packages/core/overlays/core-overlays-browser-internal/src/overlay_service.ts @@ -9,6 +9,7 @@ import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; import type { OverlayStart } from '@kbn/core-overlays-browser'; @@ -17,10 +18,11 @@ import { FlyoutService } from './flyout'; import { ModalService } from './modal'; interface StartDeps { + targetDomElement: HTMLElement; analytics: AnalyticsServiceStart; i18n: I18nStart; theme: ThemeServiceStart; - targetDomElement: HTMLElement; + userProfile: UserProfileService; uiSettings: IUiSettingsClient; } @@ -30,25 +32,21 @@ export class OverlayService { private modalService = new ModalService(); private flyoutService = new FlyoutService(); - public start({ analytics, i18n, targetDomElement, uiSettings, theme }: StartDeps): OverlayStart { + public start({ targetDomElement, ...startDeps }: StartDeps): OverlayStart { const flyoutElement = document.createElement('div'); targetDomElement.appendChild(flyoutElement); const flyouts = this.flyoutService.start({ - analytics, - i18n, - theme, targetDomElement: flyoutElement, + ...startDeps, }); - const banners = this.bannersService.start({ uiSettings, analytics, i18n, theme }); + const banners = this.bannersService.start(startDeps); const modalElement = document.createElement('div'); targetDomElement.appendChild(modalElement); const modals = this.modalService.start({ - analytics, - i18n, - theme, targetDomElement: modalElement, + ...startDeps, }); return { diff --git a/packages/core/overlays/core-overlays-browser-internal/tsconfig.json b/packages/core/overlays/core-overlays-browser-internal/tsconfig.json index 3a2034b6512ea..3604db4bc64f7 100644 --- a/packages/core/overlays/core-overlays-browser-internal/tsconfig.json +++ b/packages/core/overlays/core-overlays-browser-internal/tsconfig.json @@ -27,6 +27,8 @@ "@kbn/react-kibana-context-render", "@kbn/core-analytics-browser-mocks", "@kbn/core-analytics-browser", + "@kbn/core-user-profile-browser-mocks", + "@kbn/core-user-profile-browser", ], "exclude": [ "target/**/*", diff --git a/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.test.tsx b/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.test.tsx index f6e8685b122dc..993d1177ec2bf 100644 --- a/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.test.tsx +++ b/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.test.tsx @@ -15,6 +15,7 @@ import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks'; import { applicationServiceMock } from '@kbn/core-application-browser-mocks'; import { chromeServiceMock } from '@kbn/core-chrome-browser-mocks'; import { overlayServiceMock } from '@kbn/core-overlays-browser-mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; import { themeServiceMock } from '@kbn/core-theme-browser-mocks'; import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; import { RenderingService } from './rendering_service'; @@ -26,6 +27,7 @@ describe('RenderingService#start', () => { let overlays: ReturnType; let i18n: ReturnType; let theme: ReturnType; + let userProfile: ReturnType; let targetDomElement: HTMLDivElement; let rendering: RenderingService; @@ -41,8 +43,8 @@ describe('RenderingService#start', () => { overlays = overlayServiceMock.createStartContract(); overlays.banners.getComponent.mockReturnValue(

I'm a banner!
); + userProfile = userProfileServiceMock.createStart(); theme = themeServiceMock.createStartContract(); - i18n = i18nServiceMock.createStartContract(); targetDomElement = document.createElement('div'); @@ -58,6 +60,7 @@ describe('RenderingService#start', () => { overlays, i18n, theme, + userProfile, targetDomElement, }); }; diff --git a/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.tsx b/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.tsx index 12a597ba9318f..1995d6c013cf6 100644 --- a/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.tsx +++ b/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.tsx @@ -17,6 +17,7 @@ import type { InternalChromeStart } from '@kbn/core-chrome-browser-internal'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { OverlayStart } from '@kbn/core-overlays-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { KibanaRootContextProvider } from '@kbn/react-kibana-context-root'; import { APP_FIXED_VIEWPORT_ID } from '@kbn/core-rendering-browser'; import { AppWrapper } from './app_containers'; @@ -25,6 +26,7 @@ interface StartServices { analytics: AnalyticsServiceStart; i18n: I18nStart; theme: ThemeServiceStart; + userProfile: UserProfileService; } export interface StartDeps extends StartServices { diff --git a/packages/core/rendering/core-rendering-browser-internal/tsconfig.json b/packages/core/rendering/core-rendering-browser-internal/tsconfig.json index 4b0c009a0a033..02657e4e54b43 100644 --- a/packages/core/rendering/core-rendering-browser-internal/tsconfig.json +++ b/packages/core/rendering/core-rendering-browser-internal/tsconfig.json @@ -27,7 +27,9 @@ "@kbn/core-analytics-browser", "@kbn/core-i18n-browser", "@kbn/core-theme-browser", - "@kbn/core-rendering-browser" + "@kbn/core-rendering-browser", + "@kbn/core-user-profile-browser", + "@kbn/core-user-profile-browser-mocks" ], "exclude": [ "target/**/*", diff --git a/packages/core/root/core-root-browser-internal/src/core_system.test.ts b/packages/core/root/core-root-browser-internal/src/core_system.test.ts index 877795ff0b459..cb739ec7c8d41 100644 --- a/packages/core/root/core-root-browser-internal/src/core_system.test.ts +++ b/packages/core/root/core-root-browser-internal/src/core_system.test.ts @@ -469,6 +469,7 @@ describe('#start()', () => { i18n: expect.any(Object), overlays: expect.any(Object), theme: expect.any(Object), + userProfile: expect.any(Object), targetDomElement: expect.any(HTMLElement), analytics: expect.any(Object), }); @@ -494,6 +495,7 @@ describe('#start()', () => { overlays: expect.any(Object), i18n: expect.any(Object), theme: expect.any(Object), + userProfile: expect.any(Object), targetDomElement: expect.any(HTMLElement), }); }); diff --git a/packages/core/root/core-root-browser-internal/src/core_system.ts b/packages/core/root/core-root-browser-internal/src/core_system.ts index 44e25b257e32c..38532948ea505 100644 --- a/packages/core/root/core-root-browser-internal/src/core_system.ts +++ b/packages/core/root/core-root-browser-internal/src/core_system.ts @@ -319,6 +319,7 @@ export class CoreSystem { analytics, theme, uiSettings, + userProfile, targetDomElement: overlayTargetDomElement, }); const notifications = this.notifications.start({ @@ -326,6 +327,7 @@ export class CoreSystem { i18n, overlays, theme, + userProfile, targetDomElement: notificationsTargetDomElement, }); const customBranding = this.customBranding.start(); @@ -360,6 +362,7 @@ export class CoreSystem { analytics, i18n, theme, + userProfile, }); const featureFlags = await this.featureFlags.start(); @@ -404,6 +407,7 @@ export class CoreSystem { overlays, theme, targetDomElement: coreUiTargetDomElement, + userProfile, }); performance.mark(KBN_LOAD_MARKS, { diff --git a/packages/core/theme/core-theme-browser-internal/src/core_theme_provider.test.tsx b/packages/core/theme/core-theme-browser-internal/src/core_theme_provider.test.tsx index a3e4516b07510..584d917ac953d 100644 --- a/packages/core/theme/core-theme-browser-internal/src/core_theme_provider.test.tsx +++ b/packages/core/theme/core-theme-browser-internal/src/core_theme_provider.test.tsx @@ -14,14 +14,20 @@ import { of, BehaviorSubject } from 'rxjs'; import { useEuiTheme } from '@elastic/eui'; import type { UseEuiTheme } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test-jest-helpers'; + +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; + import type { CoreTheme } from '@kbn/core-theme-browser'; import { CoreThemeProvider } from './core_theme_provider'; describe('CoreThemeProvider', () => { let euiTheme: UseEuiTheme | undefined; + let userProfile: UserProfileService; beforeEach(() => { euiTheme = undefined; + userProfile = userProfileServiceMock.createStart(); }); const flushPromises = async () => { @@ -53,7 +59,7 @@ describe('CoreThemeProvider', () => { const coreTheme: CoreTheme = { darkMode: true, name: 'amsterdam' }; const wrapper = mountWithIntl( - + ); @@ -67,7 +73,7 @@ describe('CoreThemeProvider', () => { const coreTheme$ = new BehaviorSubject({ darkMode: true, name: 'amsterdam' }); const wrapper = mountWithIntl( - + ); diff --git a/packages/core/theme/core-theme-browser-internal/src/core_theme_provider.tsx b/packages/core/theme/core-theme-browser-internal/src/core_theme_provider.tsx index 7a77928fecfa1..0cef81aeca618 100644 --- a/packages/core/theme/core-theme-browser-internal/src/core_theme_provider.tsx +++ b/packages/core/theme/core-theme-browser-internal/src/core_theme_provider.tsx @@ -10,10 +10,12 @@ import React, { type FC, type PropsWithChildren } from 'react'; import { CoreTheme } from '@kbn/core-theme-browser/src/types'; import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { Observable } from 'rxjs'; interface CoreThemeProviderProps { theme$: Observable; + userProfile: UserProfileService; globalStyles?: boolean; } @@ -24,8 +26,11 @@ interface CoreThemeProviderProps { */ export const CoreThemeProvider: FC> = ({ theme$, + userProfile, globalStyles, children, }) => ( - {children} + + {children} + ); diff --git a/packages/core/theme/core-theme-browser-internal/tsconfig.json b/packages/core/theme/core-theme-browser-internal/tsconfig.json index 8bd8824eb872b..0289639ddbf83 100644 --- a/packages/core/theme/core-theme-browser-internal/tsconfig.json +++ b/packages/core/theme/core-theme-browser-internal/tsconfig.json @@ -20,6 +20,8 @@ "@kbn/react-kibana-context-theme", "@kbn/core-injected-metadata-common-internal", "@kbn/ui-theme", + "@kbn/core-user-profile-browser", + "@kbn/core-user-profile-browser-mocks", ], "exclude": [ "target/**/*", diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/src/settings/theme.ts b/packages/core/ui-settings/core-ui-settings-server-internal/src/settings/theme.ts index 36324f951952e..7ee214fa5d071 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/src/settings/theme.ts +++ b/packages/core/ui-settings/core-ui-settings-server-internal/src/settings/theme.ts @@ -65,6 +65,12 @@ export const getThemeSettings = ( defaultMessage: `Sync with system`, }), }, + deprecation: { + message: i18n.translate('core.ui_settings.params.darkModeDeprecation', { + defaultMessage: 'This setting is deprecated and will be removed in Kibana 10.0.', + }), + docLinksKey: 'generalSettings', + }, requiresPageReload: true, schema: schema.oneOf([ schema.literal('enabled'), diff --git a/packages/core/user-profile/core-user-profile-browser-mocks/src/user_profile_service.mock.ts b/packages/core/user-profile/core-user-profile-browser-mocks/src/user_profile_service.mock.ts index 7a84f59a5414a..8f86d8ac6555f 100644 --- a/packages/core/user-profile/core-user-profile-browser-mocks/src/user_profile_service.mock.ts +++ b/packages/core/user-profile/core-user-profile-browser-mocks/src/user_profile_service.mock.ts @@ -7,6 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import { of } from 'rxjs'; import type { UserProfileServiceSetup, UserProfileServiceStart, @@ -26,7 +27,7 @@ const createSetupMock = () => { const createStartMock = () => { const mock: jest.Mocked = { - getUserProfile$: jest.fn(), + getUserProfile$: jest.fn().mockReturnValue(of(null)), getCurrent: jest.fn(), bulkGet: jest.fn(), suggest: jest.fn(), @@ -47,7 +48,7 @@ const createInternalSetupMock = () => { const createInternalStartMock = () => { const mock: jest.Mocked = { - getUserProfile$: jest.fn(), + getUserProfile$: jest.fn().mockReturnValue(of(null)), getCurrent: jest.fn(), bulkGet: jest.fn(), suggest: jest.fn(), diff --git a/packages/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx b/packages/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx index 19c6a190485e1..0b00f86e23f7b 100644 --- a/packages/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx +++ b/packages/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx @@ -15,7 +15,6 @@ import { CoreStart, I18nStart, NotificationsSetup, - ThemeServiceSetup, } from '@kbn/core/public'; import { DataPublicPluginStart, SerializedSearchSourceFields } from '@kbn/data-plugin/public'; import { @@ -59,6 +58,7 @@ type StartServices = [ | 'analytics' | 'i18n' | 'theme' + | 'userProfile' // used extensively in Reporting share panel action | 'application' | 'uiSettings' @@ -101,14 +101,12 @@ export class ReportingCsvPanelAction implements ActionDefinition; private readonly notifications: NotificationsSetup; private readonly apiClient: ReportingAPIClient; - private readonly theme: ThemeServiceSetup; - private readonly startServices$: Params['startServices$']; + private readonly startServices$: Observable; constructor({ core, apiClient, startServices$ }: Params) { this.isDownloading = false; this.apiClient = apiClient; this.notifications = core.notifications; - this.theme = core.theme; this.startServices$ = startServices$; this.i18nStrings = getI18nStrings(apiClient); } @@ -148,7 +146,8 @@ export class ReportingCsvPanelAction implements ActionDefinition { - const { searchSource, columns, title, analytics, i18nStart } = params; + const [startServices] = await firstValueFrom(this.startServices$); + const { searchSource, columns, title } = params; const csvJobParams = this.apiClient.getDecoratedJobParams({ searchSource, columns, @@ -162,11 +161,7 @@ export class ReportingCsvPanelAction implements ActionDefinition, diff --git a/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap b/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap index ccf5fad20a71a..a2d43079bfd8d 100644 --- a/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap +++ b/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap @@ -46,18 +46,6 @@ Object { "get": Object { "operationId": "get-foo-id", "parameters": Array [ - Object { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": Object { - "default": "2023-10-31", - "enum": Array [ - "2023-10-31", - ], - "type": "string", - }, - }, Object { "description": "test", "in": "path", @@ -71,7 +59,7 @@ Object { ], "requestBody": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object { "$ref": "#/components/schemas/foo", }, @@ -81,7 +69,7 @@ Object { "responses": Object { "200": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object { "maxLength": 10, "minLength": 1, @@ -139,24 +127,10 @@ Object { "get": Object { "deprecated": true, "operationId": "get-bar", - "parameters": Array [ - Object { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": Object { - "default": "oas-test-version-2", - "enum": Array [ - "oas-test-version-1", - "oas-test-version-2", - ], - "type": "string", - }, - }, - ], + "parameters": Array [], "requestBody": Object { "content": Object { - "application/json; Elastic-Api-Version=oas-test-version-1": Object { + "application/json": Object { "schema": Object { "additionalProperties": false, "properties": Object { @@ -176,26 +150,12 @@ Object { "type": "object", }, }, - "application/json; Elastic-Api-Version=oas-test-version-2": Object { - "schema": Object { - "additionalProperties": false, - "properties": Object { - "foo": Object { - "type": "string", - }, - }, - "required": Array [ - "foo", - ], - "type": "object", - }, - }, }, }, "responses": Object { "200": Object { "content": Object { - "application/json; Elastic-Api-Version=oas-test-version-1": Object { + "application/json": Object { "schema": Object { "additionalProperties": false, "description": "fooResponse", @@ -210,15 +170,8 @@ Object { "type": "object", }, }, - "application/octet-stream; Elastic-Api-Version=oas-test-version-2": Object { - "schema": Object { - "description": "stream response", - "type": "object", - }, - }, }, - "description": "OK response oas-test-version-1 -OK response oas-test-version-2", + "description": "OK response 2023-10-31", }, }, "summary": "versioned route", @@ -233,18 +186,6 @@ OK response oas-test-version-2", "description": "route description", "operationId": "delete-foo-id-path", "parameters": Array [ - Object { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": Object { - "default": "2023-10-31", - "enum": Array [ - "2023-10-31", - ], - "type": "string", - }, - }, Object { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -271,18 +212,6 @@ OK response oas-test-version-2", "description": "route description", "operationId": "get-foo-id-path", "parameters": Array [ - Object { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": Object { - "default": "2023-10-31", - "enum": Array [ - "2023-10-31", - ], - "type": "string", - }, - }, Object { "description": "id", "in": "path", @@ -318,7 +247,7 @@ OK response oas-test-version-2", ], "requestBody": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object { "additionalProperties": false, "properties": Object { @@ -397,7 +326,7 @@ OK response oas-test-version-2", "responses": Object { "200": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object { "maxLength": 10, "minLength": 1, @@ -417,18 +346,6 @@ OK response oas-test-version-2", "description": "route description", "operationId": "post-foo-id-path", "parameters": Array [ - Object { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": Object { - "default": "2023-10-31", - "enum": Array [ - "2023-10-31", - ], - "type": "string", - }, - }, Object { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -474,7 +391,7 @@ OK response oas-test-version-2", ], "requestBody": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object { "additionalProperties": false, "properties": Object { @@ -553,7 +470,7 @@ OK response oas-test-version-2", "responses": Object { "200": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object { "maxLength": 10, "minLength": 1, @@ -573,25 +490,11 @@ OK response oas-test-version-2", "/no-xsrf/{id}/{path}": Object { "post": Object { "deprecated": true, - "operationId": "post-no-xsrf-id-path-2", - "parameters": Array [ - Object { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": Object { - "default": "oas-test-version-2", - "enum": Array [ - "oas-test-version-1", - "oas-test-version-2", - ], - "type": "string", - }, - }, - ], + "operationId": "post-no-xsrf-id-path", + "parameters": Array [], "requestBody": Object { "content": Object { - "application/json; Elastic-Api-Version=oas-test-version-1": Object { + "application/json": Object { "schema": Object { "additionalProperties": false, "properties": Object { @@ -611,26 +514,12 @@ OK response oas-test-version-2", "type": "object", }, }, - "application/json; Elastic-Api-Version=oas-test-version-2": Object { - "schema": Object { - "additionalProperties": false, - "properties": Object { - "foo": Object { - "type": "string", - }, - }, - "required": Array [ - "foo", - ], - "type": "object", - }, - }, }, }, "responses": Object { "200": Object { "content": Object { - "application/json; Elastic-Api-Version=oas-test-version-1": Object { + "application/json": Object { "schema": Object { "additionalProperties": false, "description": "fooResponse", @@ -645,15 +534,8 @@ OK response oas-test-version-2", "type": "object", }, }, - "application/octet-stream; Elastic-Api-Version=oas-test-version-2": Object { - "schema": Object { - "description": "stream response", - "type": "object", - }, - }, }, - "description": "OK response oas-test-version-1 -OK response oas-test-version-2", + "description": "OK response 2023-10-31", }, }, "summary": "", @@ -726,23 +608,10 @@ Object { "/recursive": Object { "get": Object { "operationId": "get-recursive", - "parameters": Array [ - Object { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": Object { - "default": "2023-10-31", - "enum": Array [ - "2023-10-31", - ], - "type": "string", - }, - }, - ], + "parameters": Array [], "requestBody": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object { "$ref": "#/components/schemas/recursive", }, @@ -752,7 +621,7 @@ Object { "responses": Object { "200": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object { "maxLength": 10, "minLength": 1, @@ -809,23 +678,10 @@ Object { "/foo/{id}": Object { "get": Object { "operationId": "get-foo-id", - "parameters": Array [ - Object { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": Object { - "default": "2023-10-31", - "enum": Array [ - "2023-10-31", - ], - "type": "string", - }, - }, - ], + "parameters": Array [], "requestBody": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object {}, }, }, @@ -833,7 +689,7 @@ Object { "responses": Object { "200": Object { "content": Object { - "application/json; Elastic-Api-Version=2023-10-31": Object { + "application/json": Object { "schema": Object {}, }, }, @@ -847,23 +703,10 @@ Object { "/test": Object { "get": Object { "operationId": "get-test", - "parameters": Array [ - Object { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": Object { - "default": "123", - "enum": Array [ - "123", - ], - "type": "string", - }, - }, - ], + "parameters": Array [], "requestBody": Object { "content": Object { - "application/json; Elastic-Api-Version=123": Object { + "application/json": Object { "schema": Object {}, }, }, @@ -871,7 +714,7 @@ Object { "responses": Object { "200": Object { "content": Object { - "application/json; Elastic-Api-Version=123": Object { + "application/json": Object { "schema": Object {}, }, }, diff --git a/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts b/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts index dedba5036d7ef..265afdc3ed92b 100644 --- a/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts +++ b/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts @@ -36,21 +36,10 @@ export const sharedOas = { deprecated: true, 'x-discontinued': 'route discontinued version or date', operationId: 'get-bar', - parameters: [ - { - description: 'The version of the API to use', - in: 'header', - name: 'elastic-api-version', - schema: { - default: 'oas-test-version-2', - enum: ['oas-test-version-1', 'oas-test-version-2'], - type: 'string', - }, - }, - ], + parameters: [], requestBody: { content: { - 'application/json; Elastic-Api-Version=oas-test-version-1': { + 'application/json': { schema: { additionalProperties: false, properties: { @@ -107,25 +96,13 @@ export const sharedOas = { type: 'object', }, }, - 'application/json; Elastic-Api-Version=oas-test-version-2': { - schema: { - additionalProperties: false, - properties: { - foo: { - type: 'string', - }, - }, - required: ['foo'], - type: 'object', - }, - }, }, }, responses: { '200': { - description: 'OK response oas-test-version-1\nOK response oas-test-version-2', + description: 'OK response 2023-10-31', content: { - 'application/json; Elastic-Api-Version=oas-test-version-1': { + 'application/json': { schema: { additionalProperties: false, description: 'fooResponse', @@ -138,12 +115,6 @@ export const sharedOas = { type: 'object', }, }, - 'application/octet-stream; Elastic-Api-Version=oas-test-version-2': { - schema: { - description: 'stream response', - type: 'object', - }, - }, }, }, }, @@ -156,16 +127,6 @@ export const sharedOas = { description: 'route description', operationId: 'get-foo-id-path', parameters: [ - { - description: 'The version of the API to use', - in: 'header', - name: 'elastic-api-version', - schema: { - default: '2023-10-31', - enum: ['2023-10-31'], - type: 'string', - }, - }, { description: 'id', in: 'path', @@ -201,7 +162,7 @@ export const sharedOas = { ], requestBody: { content: { - 'application/json; Elastic-Api-Version=2023-10-31': { + 'application/json': { schema: { additionalProperties: false, properties: { @@ -263,7 +224,7 @@ export const sharedOas = { responses: { '200': { content: { - 'application/json; Elastic-Api-Version=2023-10-31': { + 'application/json': { schema: { maxLength: 10, minLength: 1, @@ -280,16 +241,6 @@ export const sharedOas = { description: 'route description', operationId: 'post-foo-id-path', parameters: [ - { - description: 'The version of the API to use', - in: 'header', - name: 'elastic-api-version', - schema: { - default: '2023-10-31', - enum: ['2023-10-31'], - type: 'string', - }, - }, { description: 'A required header to protect against CSRF attacks', in: 'header', @@ -335,7 +286,7 @@ export const sharedOas = { ], requestBody: { content: { - 'application/json; Elastic-Api-Version=2023-10-31': { + 'application/json': { schema: { additionalProperties: false, properties: { @@ -397,7 +348,7 @@ export const sharedOas = { responses: { '200': { content: { - 'application/json; Elastic-Api-Version=2023-10-31': { + 'application/json': { schema: { maxLength: 10, minLength: 1, diff --git a/packages/kbn-router-to-openapispec/src/generate_oas.test.ts b/packages/kbn-router-to-openapispec/src/generate_oas.test.ts index 76a4f560006b3..603010926a515 100644 --- a/packages/kbn-router-to-openapispec/src/generate_oas.test.ts +++ b/packages/kbn-router-to-openapispec/src/generate_oas.test.ts @@ -25,7 +25,11 @@ describe('generateOpenApiDocument', () => { describe('@kbn/config-schema', () => { it('generates the expected OpenAPI document for the shared schema', () => { const [routers, versionedRouters] = createTestRouters({ - routers: { testRouter: { routes: [{ method: 'get' }, { method: 'post' }] } }, + routers: { + testRouter: { + routes: [{ method: 'get' }, { method: 'post' }], + }, + }, versionedRouters: { testVersionedRouter: { routes: [{}] } }, bodySchema: createSharedConfigSchema(), }); @@ -118,7 +122,7 @@ describe('generateOpenApiDocument', () => { }, }, }, - options: { tags: ['foo'] }, + options: { tags: ['foo'], access: 'public' }, handler: jest.fn(), }, ], @@ -164,7 +168,7 @@ describe('generateOpenApiDocument', () => { }, }, }, - options: { tags: ['foo'] }, + options: { tags: ['foo'], access: 'public' }, handler: jest.fn(), }, ], @@ -229,7 +233,7 @@ describe('generateOpenApiDocument', () => { }, }, }, - options: { tags: ['foo'] }, + options: { tags: ['foo'], access: 'public' }, handler: jest.fn(), }, ], @@ -251,7 +255,7 @@ describe('generateOpenApiDocument', () => { request: { body: () => ({ value: {} }) }, response: { 200: { body: (() => {}) as any } }, }, - version: '123', + version: '2023-10-31', }, }, ], @@ -276,11 +280,19 @@ describe('generateOpenApiDocument', () => { routers: { testRouter1: { routes: [ - { path: '/1-1/{id}/{path*}', options: { tags: ['oas-tag:1', 'oas-tag:2', 'foo'] } }, - { path: '/1-2/{id}/{path*}', options: { tags: ['oas-tag:1', 'foo'] } }, + { + path: '/1-1/{id}/{path*}', + options: { tags: ['oas-tag:1', 'oas-tag:2', 'foo'], access: 'public' }, + }, + { + path: '/1-2/{id}/{path*}', + options: { tags: ['oas-tag:1', 'foo'], access: 'public' }, + }, ], }, - testRouter2: { routes: [{ path: '/2-1/{id}/{path*}', options: { tags: undefined } }] }, + testRouter2: { + routes: [{ path: '/2-1/{id}/{path*}', options: { tags: undefined, access: 'public' } }], + }, }, versionedRouters: { testVersionedRouter1: { @@ -332,15 +344,15 @@ describe('generateOpenApiDocument', () => { routes: [ { path: '/1-1/{id}/{path*}', - options: { availability: { stability: 'experimental' } }, + options: { availability: { stability: 'experimental' }, access: 'public' }, }, { path: '/1-2/{id}/{path*}', - options: { availability: { stability: 'beta' } }, + options: { availability: { stability: 'beta' }, access: 'public' }, }, { path: '/1-3/{id}/{path*}', - options: { availability: { stability: 'stable' } }, + options: { availability: { stability: 'stable' }, access: 'public' }, }, ], }, diff --git a/packages/kbn-router-to-openapispec/src/generate_oas.test.util.ts b/packages/kbn-router-to-openapispec/src/generate_oas.test.util.ts index a39afb6357bfc..96d427aacb197 100644 --- a/packages/kbn-router-to-openapispec/src/generate_oas.test.util.ts +++ b/packages/kbn-router-to-openapispec/src/generate_oas.test.util.ts @@ -36,6 +36,7 @@ export const getRouterDefaults = (bodySchema?: RuntimeSchema): RouterRoute => ({ tags: ['foo', 'oas-tag:bar'], summary: 'route summary', description: 'route description', + access: 'public', }, validationSchemas: { request: { @@ -100,7 +101,7 @@ export const getVersionedRouterDefaults = (bodySchema?: RuntimeSchema): Versione }, response: { [200]: { - description: 'OK response oas-test-version-1', + description: 'OK response 2023-10-31', body: () => schema.object( { fooResponseWithDescription: schema.string() }, @@ -109,7 +110,7 @@ export const getVersionedRouterDefaults = (bodySchema?: RuntimeSchema): Versione }, }, }, - version: 'oas-test-version-1', + version: '2023-10-31', }, }, { @@ -119,14 +120,14 @@ export const getVersionedRouterDefaults = (bodySchema?: RuntimeSchema): Versione request: { body: schema.object({ foo: schema.string() }) }, response: { [200]: { - description: 'OK response oas-test-version-2', + description: 'OK response 9999-99-99', body: () => schema.stream({ meta: { description: 'stream response' } }), bodyContentType: 'application/octet-stream', }, unsafe: { body: true }, }, }, - version: 'oas-test-version-2', + version: '9999-99-99', }, }, ], diff --git a/packages/kbn-router-to-openapispec/src/generate_oas.ts b/packages/kbn-router-to-openapispec/src/generate_oas.ts index 9c7423147721b..d16cdd14953a9 100644 --- a/packages/kbn-router-to-openapispec/src/generate_oas.ts +++ b/packages/kbn-router-to-openapispec/src/generate_oas.ts @@ -8,6 +8,7 @@ */ import type { CoreVersionedRouter, Router } from '@kbn/core-http-router-server-internal'; +import { BASE_PUBLIC_VERSION as SERVERLESS_VERSION_2023_10_31 } from '@kbn/core-http-router-server-internal'; import type { OpenAPIV3 } from 'openapi-types'; import { OasConverter } from './oas_converter'; import { processRouter } from './process_router'; @@ -19,7 +20,12 @@ export const openApiVersion = '3.0.0'; export interface GenerateOpenApiDocumentOptionsFilters { pathStartsWith?: string[]; excludePathsMatching?: string[]; - access?: 'public' | 'internal'; + /** @default 'public' */ + access: 'public' | 'internal'; + /** + * We generate spec for one version at a time + * @default '2023-10-31' if access is public, otherwise undefined + */ version?: string; } @@ -37,7 +43,10 @@ export const generateOpenApiDocument = ( appRouters: { routers: Router[]; versionedRouters: CoreVersionedRouter[] }, opts: GenerateOpenApiDocumentOptions ): OpenAPIV3.Document => { - const { filters } = opts; + let { filters = { access: 'public' } } = opts; + if (filters.access === 'public' && !filters.version) { + filters = { ...filters, version: SERVERLESS_VERSION_2023_10_31 }; + } const converter = new OasConverter(); const paths: OpenAPIV3.PathsObject = {}; const getOpId = createOpIdGenerator(); diff --git a/packages/kbn-router-to-openapispec/src/process_router.test.ts b/packages/kbn-router-to-openapispec/src/process_router.test.ts index 2ce135a378789..a7bcfc7506485 100644 --- a/packages/kbn-router-to-openapispec/src/process_router.test.ts +++ b/packages/kbn-router-to-openapispec/src/process_router.test.ts @@ -51,7 +51,7 @@ describe('extractResponses', () => { 200: { description: 'OK response', content: { - 'application/test+json; Elastic-Api-Version=2023-10-31': { + 'application/test+json': { schema: { type: 'object', additionalProperties: false, @@ -66,7 +66,7 @@ describe('extractResponses', () => { 404: { description: 'Not Found response', content: { - 'application/test2+json; Elastic-Api-Version=2023-10-31': { + 'application/test2+json': { schema: { type: 'object', additionalProperties: false, @@ -88,28 +88,28 @@ describe('processRouter', () => { { method: 'get', path: '/foo', - options: { access: 'internal', deprecated: true, discontinued: 'discontinued router' }, + options: { access: 'public', deprecated: true, discontinued: 'discontinued router' }, handler: jest.fn(), validationSchemas: { request: { body: schema.object({}) } }, }, { method: 'get', path: '/bar', - options: {}, + options: { access: 'public' }, handler: jest.fn(), validationSchemas: { request: { body: schema.object({}) } }, }, { method: 'get', path: '/baz', - options: {}, + options: { access: 'public' }, handler: jest.fn(), validationSchemas: { request: { body: schema.object({}) } }, }, { path: '/qux', method: 'post', - options: {}, + options: { access: 'public' }, handler: jest.fn(), validationSchemas: { request: { body: schema.object({}) } }, security: { @@ -129,6 +129,7 @@ describe('processRouter', () => { method: 'post', options: { description: 'This a test route description.', + access: 'public', }, handler: jest.fn(), validationSchemas: { request: { body: schema.object({}) } }, @@ -150,12 +151,14 @@ describe('processRouter', () => { it('only provides routes for version 2023-10-31', () => { const result1 = processRouter(testRouter, new OasConverter(), createOpIdGenerator(), { version: '2023-10-31', + access: 'public', }); expect(Object.keys(result1.paths!)).toHaveLength(5); const result2 = processRouter(testRouter, new OasConverter(), createOpIdGenerator(), { version: '2024-10-31', + access: 'public', }); expect(Object.keys(result2.paths!)).toHaveLength(0); }); @@ -163,6 +166,7 @@ describe('processRouter', () => { it('updates description with privileges required', () => { const result = processRouter(testRouter, new OasConverter(), createOpIdGenerator(), { version: '2023-10-31', + access: 'public', }); expect(result.paths['/qux']?.post).toBeDefined(); diff --git a/packages/kbn-router-to-openapispec/src/process_router.ts b/packages/kbn-router-to-openapispec/src/process_router.ts index b808f9bed84d5..f47888808772f 100644 --- a/packages/kbn-router-to-openapispec/src/process_router.ts +++ b/packages/kbn-router-to-openapispec/src/process_router.ts @@ -9,7 +9,7 @@ import type { Router } from '@kbn/core-http-router-server-internal'; import { getResponseValidation } from '@kbn/core-http-server'; -import { ALLOWED_PUBLIC_VERSION as SERVERLESS_VERSION_2023_10_31 } from '@kbn/core-http-router-server-internal'; +import { BASE_PUBLIC_VERSION as SERVERLESS_VERSION_2023_10_31 } from '@kbn/core-http-router-server-internal'; import type { OpenAPIV3 } from 'openapi-types'; import type { OasConverter } from './oas_converter'; import { @@ -20,7 +20,6 @@ import { extractValidationSchemaFromRoute, getPathParameters, getVersionedContentTypeString, - getVersionedHeaderParam, mergeResponseContent, prepareRoutes, setXState, @@ -34,7 +33,7 @@ export const processRouter = ( appRouter: Router, converter: OasConverter, getOpId: GetOpId, - filters?: GenerateOpenApiDocumentOptionsFilters + filters: GenerateOpenApiDocumentOptionsFilters ) => { const paths: OpenAPIV3.PathsObject = {}; if (filters?.version && filters.version !== SERVERLESS_VERSION_2023_10_31) return { paths }; @@ -47,7 +46,6 @@ export const processRouter = ( const contentType = extractContentType(route.options?.body); const parameters: OpenAPIV3.ParameterObject[] = [ - getVersionedHeaderParam(SERVERLESS_VERSION_2023_10_31, [SERVERLESS_VERSION_2023_10_31]), ...getXsrfHeaderForMethod(route.method, route.options), ]; if (validationSchemas) { @@ -84,7 +82,11 @@ export const processRouter = ( requestBody: !!validationSchemas?.body ? { content: { - [getVersionedContentTypeString(SERVERLESS_VERSION_2023_10_31, contentType)]: { + [getVersionedContentTypeString( + SERVERLESS_VERSION_2023_10_31, + 'public', + contentType + )]: { schema: converter.convert(validationSchemas.body), }, }, @@ -124,6 +126,7 @@ export const extractResponses = (route: InternalRouterRoute, converter: OasConve ? { [getVersionedContentTypeString( SERVERLESS_VERSION_2023_10_31, + 'public', schema.bodyContentType ? [schema.bodyContentType] : contentType )]: { schema: converter.convert(schema.body()), diff --git a/packages/kbn-router-to-openapispec/src/process_versioned_router.test.ts b/packages/kbn-router-to-openapispec/src/process_versioned_router.test.ts index b7a4827e4f365..af426b5f0c4f9 100644 --- a/packages/kbn-router-to-openapispec/src/process_versioned_router.test.ts +++ b/packages/kbn-router-to-openapispec/src/process_versioned_router.test.ts @@ -12,9 +12,9 @@ import type { CoreVersionedRouter } from '@kbn/core-http-router-server-internal' import { get } from 'lodash'; import { OasConverter } from './oas_converter'; import { - processVersionedRouter, - extractVersionedResponses, extractVersionedRequestBodies, + extractVersionedResponses, + processVersionedRouter, } from './process_versioned_router'; import { VersionedRouterRoute } from '@kbn/core-http-server'; import { createOpIdGenerator } from './util'; @@ -27,9 +27,9 @@ beforeEach(() => { describe('extractVersionedRequestBodies', () => { test('handles full request config as expected', () => { expect( - extractVersionedRequestBodies(createTestRoute(), oasConverter, ['application/json']) + extractVersionedRequestBodies(createInternalTestRoute(), oasConverter, ['application/json']) ).toEqual({ - 'application/json; Elastic-Api-Version=2023-10-31': { + 'application/json; Elastic-Api-Version=1': { schema: { additionalProperties: false, properties: { @@ -41,7 +41,7 @@ describe('extractVersionedRequestBodies', () => { type: 'object', }, }, - 'application/json; Elastic-Api-Version=2024-12-31': { + 'application/json; Elastic-Api-Version=2': { schema: { additionalProperties: false, properties: { @@ -60,12 +60,12 @@ describe('extractVersionedRequestBodies', () => { describe('extractVersionedResponses', () => { test('handles full response config as expected', () => { expect( - extractVersionedResponses(createTestRoute(), oasConverter, ['application/test+json']) + extractVersionedResponses(createInternalTestRoute(), oasConverter, ['application/test+json']) ).toEqual({ 200: { - description: 'OK response 2023-10-31\nOK response 2024-12-31', // merge multiple version descriptions + description: 'OK response 1\nOK response 2', // merge multiple version descriptions content: { - 'application/test+json; Elastic-Api-Version=2023-10-31': { + 'application/test+json; Elastic-Api-Version=1': { schema: { type: 'object', additionalProperties: false, @@ -75,7 +75,7 @@ describe('extractVersionedResponses', () => { required: ['bar'], }, }, - 'application/test+json; Elastic-Api-Version=2024-12-31': { + 'application/test+json; Elastic-Api-Version=2': { schema: { type: 'object', additionalProperties: false, @@ -88,9 +88,9 @@ describe('extractVersionedResponses', () => { }, }, 404: { - description: 'Not Found response 2023-10-31', + description: 'Not Found response 1', content: { - 'application/test2+json; Elastic-Api-Version=2023-10-31': { + 'application/test2+json; Elastic-Api-Version=1': { schema: { type: 'object', additionalProperties: false, @@ -104,7 +104,7 @@ describe('extractVersionedResponses', () => { }, 500: { content: { - 'application/test2+json; Elastic-Api-Version=2024-12-31': { + 'application/test2+json; Elastic-Api-Version=2': { schema: { type: 'object', additionalProperties: false, @@ -126,22 +126,21 @@ describe('processVersionedRouter', () => { { getRoutes: () => [createTestRoute()] } as unknown as CoreVersionedRouter, new OasConverter(), createOpIdGenerator(), - {} + { access: 'public', version: '2023-10-31' } ); expect(Object.keys(get(baseCase, 'paths["/foo"].get.responses.200.content')!)).toEqual([ - 'application/test+json; Elastic-Api-Version=2023-10-31', - 'application/test+json; Elastic-Api-Version=2024-12-31', + 'application/test+json', ]); const filteredCase = processVersionedRouter( { getRoutes: () => [createTestRoute()] } as unknown as CoreVersionedRouter, new OasConverter(), createOpIdGenerator(), - { version: '2023-10-31' } + { version: '2024-12-31', access: 'public' } ); expect(Object.keys(get(filteredCase, 'paths["/foo"].get.responses.200.content')!)).toEqual([ - 'application/test+json; Elastic-Api-Version=2023-10-31', + 'application/test+json', ]); }); @@ -150,7 +149,7 @@ describe('processVersionedRouter', () => { { getRoutes: () => [createTestRoute()] } as unknown as CoreVersionedRouter, new OasConverter(), createOpIdGenerator(), - {} + { version: '2023-10-31', access: 'public' } ); expect(results.paths['/foo']).toBeDefined(); @@ -228,3 +227,70 @@ const createTestRoute: () => VersionedRouterRoute = () => ({ }, ], }); + +const createInternalTestRoute: () => VersionedRouterRoute = () => ({ + path: '/foo', + method: 'get', + isVersioned: true, + options: { + access: 'internal', + deprecated: true, + discontinued: 'discontinued versioned router', + options: { body: { access: ['application/test+json'] } as any }, + security: { + authz: { + requiredPrivileges: ['manage_spaces'], + }, + }, + description: 'This is a test route description.', + }, + handlers: [ + { + fn: jest.fn(), + options: { + version: '1', + validate: () => ({ + request: { + body: schema.object({ foo: schema.string() }), + }, + response: { + 200: { + description: 'OK response 1', + bodyContentType: 'application/test+json', + body: () => schema.object({ bar: schema.number({ min: 1, max: 99 }) }), + }, + 404: { + description: 'Not Found response 1', + bodyContentType: 'application/test2+json', + body: () => schema.object({ ok: schema.literal(false) }), + }, + unsafe: { body: false }, + }, + }), + }, + }, + { + fn: jest.fn(), + options: { + version: '2', + validate: () => ({ + request: { + body: schema.object({ foo2: schema.string() }), + }, + response: { + 200: { + description: 'OK response 2', + bodyContentType: 'application/test+json', + body: () => schema.object({ bar2: schema.number({ min: 1, max: 99 }) }), + }, + 500: { + bodyContentType: 'application/test2+json', + body: () => schema.object({ ok: schema.literal(false) }), + }, + unsafe: { body: false }, + }, + }), + }, + }, + ], +}); diff --git a/packages/kbn-router-to-openapispec/src/process_versioned_router.ts b/packages/kbn-router-to-openapispec/src/process_versioned_router.ts index eab2dfef78a21..7c16e5673cebb 100644 --- a/packages/kbn-router-to-openapispec/src/process_versioned_router.ts +++ b/packages/kbn-router-to-openapispec/src/process_versioned_router.ts @@ -17,7 +17,6 @@ import type { OpenAPIV3 } from 'openapi-types'; import { extractAuthzDescription } from './extract_authz_description'; import type { GenerateOpenApiDocumentOptionsFilters } from './generate_oas'; import type { OasConverter } from './oas_converter'; -import { isReferenceObject } from './oas_converter/common'; import { prepareRoutes, getPathParameters, @@ -31,12 +30,13 @@ import { setXState, GetOpId, } from './util'; +import { isReferenceObject } from './oas_converter/common'; export const processVersionedRouter = ( appRouter: CoreVersionedRouter, converter: OasConverter, getOpId: GetOpId, - filters?: GenerateOpenApiDocumentOptionsFilters + filters: GenerateOpenApiDocumentOptionsFilters ) => { const routes = prepareRoutes(appRouter.getRoutes(), filters); const paths: OpenAPIV3.PathsObject = {}; @@ -44,8 +44,8 @@ export const processVersionedRouter = ( const pathParams = getPathParameters(route.path); let parameters: OpenAPIV3.ParameterObject[] = []; - let version: undefined | string; let handler: undefined | VersionedRouterRoute['handlers'][0]; + let version: undefined | string; let versions: string[] = versionHandlerResolvers.sort( route.handlers.map(({ options: { version: v } }) => v), route.options.access @@ -84,12 +84,16 @@ export const processVersionedRouter = ( queryObjects = converter.convertQuery(reqQuery); } parameters = [ - getVersionedHeaderParam(version, versions), ...getXsrfHeaderForMethod(route.method as RouteMethod, route.options.options), ...pathObjects, ...queryObjects, ]; } + parameters = [ + ...(route.options.access === 'internal' + ? [getVersionedHeaderParam(version, versions)] + : ([] as OpenAPIV3.ParameterObject[])), + ].concat(...parameters); let description = `${route.options.description ?? ''}`; if (route.options.security) { const authzDescription = extractAuthzDescription(route.options.security); @@ -101,9 +105,9 @@ export const processVersionedRouter = ( const hasBody = Boolean(extractValidationSchemaFromVersionedHandler(handler)?.request?.body); const contentType = extractContentType(route.options.options?.body); - const hasVersionFilter = Boolean(filters?.version); // If any handler is deprecated we show deprecated: true in the spec const hasDeprecations = route.handlers.some(({ options }) => !!options.options?.deprecated); + const hasVersionFilter = Boolean(filters?.version); const operation: OpenAPIV3.OperationObject = { summary: route.options.summary ?? '', tags: route.options.options?.tags ? extractTags(route.options.options.tags) : [], @@ -113,12 +117,12 @@ export const processVersionedRouter = ( requestBody: hasBody ? { content: hasVersionFilter - ? extractVersionedRequestBody(handler, converter, contentType) + ? extractVersionedRequestBody(handler, route.options.access, converter, contentType) : extractVersionedRequestBodies(route, converter, contentType), } : undefined, responses: hasVersionFilter - ? extractVersionedResponse(handler, converter, contentType) + ? extractVersionedResponse(handler, route.options.access, converter, contentType) : extractVersionedResponses(route, converter, contentType), parameters, operationId: getOpId({ path: route.path, method: route.method }), @@ -140,8 +144,22 @@ export const processVersionedRouter = ( return { paths }; }; +export const extractVersionedRequestBodies = ( + route: VersionedRouterRoute, + converter: OasConverter, + contentType: string[] +): OpenAPIV3.RequestBodyObject['content'] => { + return route.handlers.reduce((acc, handler) => { + return { + ...acc, + ...extractVersionedRequestBody(handler, route.options.access, converter, contentType), + }; + }, {}); +}; + export const extractVersionedRequestBody = ( handler: VersionedRouterRoute['handlers'][0], + access: 'public' | 'internal', converter: OasConverter, contentType: string[] ) => { @@ -149,27 +167,15 @@ export const extractVersionedRequestBody = ( if (!schemas?.request) return {}; const schema = converter.convert(schemas.request.body); return { - [getVersionedContentTypeString(handler.options.version, contentType)]: { + [getVersionedContentTypeString(handler.options.version, access, contentType)]: { schema, }, }; }; -export const extractVersionedRequestBodies = ( - route: VersionedRouterRoute, - converter: OasConverter, - contentType: string[] -): OpenAPIV3.RequestBodyObject['content'] => { - return route.handlers.reduce((acc, handler) => { - return { - ...acc, - ...extractVersionedRequestBody(handler, converter, contentType), - }; - }, {}); -}; - export const extractVersionedResponse = ( handler: VersionedRouterRoute['handlers'][0], + access: 'public' | 'internal', converter: OasConverter, contentType: string[] ) => { @@ -184,6 +190,7 @@ export const extractVersionedResponse = ( const schema = converter.convert(maybeSchema); const contentTypeString = getVersionedContentTypeString( handler.options.version, + access, responseSchema.bodyContentType ? [responseSchema.bodyContentType] : contentType ); newContent = { @@ -237,7 +244,12 @@ export const extractVersionedResponses = ( contentType: string[] ): OpenAPIV3.ResponsesObject => { return route.handlers.reduce((acc, handler) => { - const responses = extractVersionedResponse(handler, converter, contentType); + const responses = extractVersionedResponse( + handler, + route.options.access, + converter, + contentType + ); return mergeVersionedResponses(acc, responses); }, {}); }; diff --git a/packages/kbn-router-to-openapispec/src/util.test.ts b/packages/kbn-router-to-openapispec/src/util.test.ts index ee34976e47152..80314ae55f179 100644 --- a/packages/kbn-router-to-openapispec/src/util.test.ts +++ b/packages/kbn-router-to-openapispec/src/util.test.ts @@ -134,7 +134,7 @@ describe('prepareRoutes', () => { { input: [{ path: '/api/foo', options: { access: internal } }], output: [{ path: '/api/foo', options: { access: internal } }], - filters: {}, + filters: { access: internal }, }, { input: [ @@ -142,7 +142,7 @@ describe('prepareRoutes', () => { { path: '/api/bar', options: { access: internal } }, ], output: [{ path: '/api/bar', options: { access: internal } }], - filters: { pathStartsWith: ['/api/bar'] }, + filters: { pathStartsWith: ['/api/bar'], access: internal }, }, { input: [ diff --git a/packages/kbn-router-to-openapispec/src/util.ts b/packages/kbn-router-to-openapispec/src/util.ts index 61c69caf538f9..ac3a47125e5b0 100644 --- a/packages/kbn-router-to-openapispec/src/util.ts +++ b/packages/kbn-router-to-openapispec/src/util.ts @@ -78,9 +78,15 @@ export const extractContentType = (body: undefined | RouteConfigOptionsBody) => export const getVersionedContentTypeString = ( version: string, + access: 'public' | 'internal', acceptedContentTypes: string[] ): string => { - return `${acceptedContentTypes.join('; ')}; Elastic-Api-Version=${version}`; + if (access === 'internal') { + return `${acceptedContentTypes.join('; ')}; Elastic-Api-Version=${version}`; + } + // Exclude Elastic-Api-Version header for public routes for now, this means public routes + // can only generate spec for one version at a time. + return `${acceptedContentTypes.join('; ')}`; }; export const extractValidationSchemaFromRoute = ( @@ -108,7 +114,7 @@ export const prepareRoutes = < R extends { path: string; options: { access?: 'public' | 'internal'; excludeFromOAS?: boolean } } >( routes: R[], - filters: GenerateOpenApiDocumentOptionsFilters = {} + filters: GenerateOpenApiDocumentOptionsFilters ): R[] => { if (Object.getOwnPropertyNames(filters).length === 0) return routes; return routes.filter((route) => { @@ -122,7 +128,16 @@ export const prepareRoutes = < if (filters.pathStartsWith && !filters.pathStartsWith.some((p) => route.path.startsWith(p))) { return false; } - if (filters.access && route.options.access !== filters.access) return false; + if (filters.access === 'public' && route.options.access !== 'public') { + return false; + } + if ( + filters.access === 'internal' && + route.options.access != null && + route.options.access !== 'internal' + ) { + return false; + } return true; }); }; diff --git a/packages/kbn-search-connectors/components/configuration/connector_configuration.tsx b/packages/kbn-search-connectors/components/configuration/connector_configuration.tsx index cd80b2489012e..8adc6ac2e38c4 100644 --- a/packages/kbn-search-connectors/components/configuration/connector_configuration.tsx +++ b/packages/kbn-search-connectors/components/configuration/connector_configuration.tsx @@ -47,6 +47,7 @@ interface ConnectorConfigurationProps { isLoading: boolean; saveConfig: (configuration: Record) => void; saveAndSync?: (configuration: Record) => void; + onEditStateChange?: (isEdit: boolean) => void; stackManagementLink?: string; subscriptionLink?: string; children?: React.ReactNode; @@ -94,6 +95,7 @@ export const ConnectorConfigurationComponent: FC< isLoading, saveConfig, saveAndSync, + onEditStateChange, subscriptionLink, stackManagementLink, }) => { @@ -110,6 +112,15 @@ export const ConnectorConfigurationComponent: FC< ); const [isEditing, setIsEditing] = useState(false); + useEffect( + function propogateEditState() { + if (onEditStateChange) { + onEditStateChange(isEditing); + } + }, + [isEditing, onEditStateChange] + ); + useEffect(() => { if (!isDeepEqual(configuration, configurationRef.current)) { configurationRef.current = configuration; diff --git a/packages/kbn-storybook/src/lib/decorators.tsx b/packages/kbn-storybook/src/lib/decorators.tsx index 270da371172eb..162200e83ef41 100644 --- a/packages/kbn-storybook/src/lib/decorators.tsx +++ b/packages/kbn-storybook/src/lib/decorators.tsx @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { Subject } from 'rxjs'; +import { of, Subject } from 'rxjs'; import React, { useEffect } from 'react'; import { action } from '@storybook/addon-actions'; import type { DecoratorFn } from '@storybook/react'; @@ -22,6 +22,7 @@ import { KibanaRootContextProvider } from '@kbn/react-kibana-context-root'; import { i18n } from '@kbn/i18n'; const theme$ = new BehaviorSubject({ darkMode: false, name: 'amsterdam' }); +const userProfile = { getUserProfile$: () => of(null) }; const i18nStart: I18nStart = { Context: ({ children }) => {children}, @@ -47,7 +48,7 @@ const KibanaContextDecorator: DecoratorFn = (storyFn, { globals }) => { }, [colorMode]); return ( - + {storyFn()} ); diff --git a/packages/react/kibana_context/root/eui_provider.test.tsx b/packages/react/kibana_context/root/eui_provider.test.tsx index d7486be2d4798..11d83f0affc41 100644 --- a/packages/react/kibana_context/root/eui_provider.test.tsx +++ b/packages/react/kibana_context/root/eui_provider.test.tsx @@ -7,24 +7,28 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { useEuiTheme } from '@elastic/eui'; import type { ReactWrapper } from 'enzyme'; import type { FC } from 'react'; import React, { useEffect } from 'react'; import { act } from 'react-dom/test-utils'; import { BehaviorSubject, of } from 'rxjs'; +import { useEuiTheme } from '@elastic/eui'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; +import type { KibanaTheme } from '@kbn/react-kibana-context-common'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -import type { KibanaTheme } from '@kbn/react-kibana-context-common'; import { KibanaEuiProvider } from './eui_provider'; describe('KibanaEuiProvider', () => { let euiTheme: ReturnType | undefined; + let userProfile: UserProfileService; let consoleWarnMock: jest.SpyInstance; beforeEach(() => { euiTheme = undefined; + userProfile = userProfileServiceMock.createStart(); consoleWarnMock = jest.spyOn(global.console, 'warn').mockImplementation(() => {}); }); @@ -57,7 +61,11 @@ describe('KibanaEuiProvider', () => { const coreTheme: KibanaTheme = { darkMode: true, name: 'amsterdam' }; const wrapper = mountWithIntl( - + ); @@ -73,7 +81,7 @@ describe('KibanaEuiProvider', () => { const coreTheme$ = new BehaviorSubject({ darkMode: true, name: 'amsterdam' }); const wrapper = mountWithIntl( - + ); diff --git a/packages/react/kibana_context/root/eui_provider.tsx b/packages/react/kibana_context/root/eui_provider.tsx index 1e4e45c9f36f1..fa1d92e897800 100644 --- a/packages/react/kibana_context/root/eui_provider.tsx +++ b/packages/react/kibana_context/root/eui_provider.tsx @@ -19,13 +19,15 @@ import { getThemeConfigByName, DEFAULT_THEME_CONFIG, } from '@kbn/react-kibana-context-common'; -import { ThemeServiceStart } from '@kbn/react-kibana-context-common'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +import type { ThemeServiceStart } from '@kbn/react-kibana-context-common'; /** * Props for the KibanaEuiProvider. */ export interface KibanaEuiProviderProps extends Pick, 'modify' | 'colorMode'> { theme: ThemeServiceStart; + userProfile?: Pick; // TODO: use this to access a "high contrast mode" flag from user settings. Pass the flag to EuiProvider, when it is supported in EUI. globalStyles?: boolean; } @@ -87,7 +89,14 @@ export const KibanaEuiProvider: FC> = return ( {children} diff --git a/packages/react/kibana_context/root/root_provider.test.tsx b/packages/react/kibana_context/root/root_provider.test.tsx index 919adb09581d5..312b366797a36 100644 --- a/packages/react/kibana_context/root/root_provider.test.tsx +++ b/packages/react/kibana_context/root/root_provider.test.tsx @@ -18,18 +18,22 @@ import type { KibanaTheme } from '@kbn/react-kibana-context-common'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks'; import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; -import { KibanaRootContextProvider } from './root_provider'; import { I18nStart } from '@kbn/core-i18n-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; +import { KibanaRootContextProvider } from './root_provider'; describe('KibanaRootContextProvider', () => { let euiTheme: UseEuiTheme | undefined; let i18nMock: I18nStart; let analytics: AnalyticsServiceStart; + let userProfile: UserProfileService; beforeEach(() => { euiTheme = undefined; analytics = analyticsServiceMock.createAnalyticsServiceStart(); i18nMock = i18nServiceMock.createStartContract(); + userProfile = userProfileServiceMock.createStart(); }); const flushPromises = async () => { @@ -64,6 +68,7 @@ describe('KibanaRootContextProvider', () => { @@ -82,6 +87,7 @@ describe('KibanaRootContextProvider', () => { diff --git a/packages/react/kibana_context/root/tsconfig.json b/packages/react/kibana_context/root/tsconfig.json index 27ea0566f36a7..6c67c97861c11 100644 --- a/packages/react/kibana_context/root/tsconfig.json +++ b/packages/react/kibana_context/root/tsconfig.json @@ -23,5 +23,7 @@ "@kbn/core-base-common", "@kbn/core-analytics-browser", "@kbn/core-analytics-browser-mocks", + "@kbn/core-user-profile-browser", + "@kbn/core-user-profile-browser-mocks", ] } diff --git a/packages/react/kibana_context/theme/theme_provider.test.tsx b/packages/react/kibana_context/theme/theme_provider.test.tsx index 9889da9a689a3..8023c0cbf7e5f 100644 --- a/packages/react/kibana_context/theme/theme_provider.test.tsx +++ b/packages/react/kibana_context/theme/theme_provider.test.tsx @@ -16,14 +16,19 @@ import { BehaviorSubject } from 'rxjs'; import { mountWithIntl } from '@kbn/test-jest-helpers'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; + import type { KibanaTheme } from '@kbn/react-kibana-context-common'; import { KibanaThemeProvider } from './theme_provider'; describe('KibanaThemeProvider', () => { let euiTheme: ReturnType | undefined; + let userProfile: UserProfileService; beforeEach(() => { euiTheme = undefined; + userProfile = userProfileServiceMock.createStart(); }); const flushPromises = async () => { @@ -55,7 +60,7 @@ describe('KibanaThemeProvider', () => { const coreTheme$ = new BehaviorSubject({ darkMode: true, name: 'amsterdam' }); const wrapper = mountWithIntl( - + ); @@ -72,7 +77,7 @@ describe('KibanaThemeProvider', () => { }); const wrapper = mountWithIntl( - + ); diff --git a/packages/react/kibana_context/theme/theme_provider.tsx b/packages/react/kibana_context/theme/theme_provider.tsx index 41915824b128a..b962687199ea7 100644 --- a/packages/react/kibana_context/theme/theme_provider.tsx +++ b/packages/react/kibana_context/theme/theme_provider.tsx @@ -17,6 +17,7 @@ import { useIsNestedEuiProvider } from '@elastic/eui/lib/components/provider/nes // @ts-expect-error EUI exports this component internally, but Kibana isn't picking it up its types import { emitEuiProviderWarning } from '@elastic/eui/lib/services/theme/warning'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { KibanaEuiProvider } from '@kbn/react-kibana-context-root'; import { @@ -40,6 +41,8 @@ interface EuiProps extends Omit, 'theme' | 'col export interface KibanaThemeProviderProps extends EuiProps { /** The `ThemeServiceStart` API. */ theme: ThemeServiceStart; + /** The `UserProfileService` start API. */ + userProfile?: Pick; } /** @@ -70,12 +73,17 @@ const KibanaThemeProviderOnly = ({ * TODO: clintandrewhall - We can remove this and revert to only exporting the above component * once all out-of-band renders are using `KibanaRenderContextProvider`. */ -const KibanaThemeProviderCheck = ({ theme, children, ...props }: KibanaThemeProviderProps) => { +const KibanaThemeProviderCheck = ({ + theme, + userProfile, + children, + ...props +}: KibanaThemeProviderProps) => { const hasEuiProvider = useIsNestedEuiProvider(); if (hasEuiProvider) { return ( - + {children} ); @@ -84,7 +92,7 @@ const KibanaThemeProviderCheck = ({ theme, children, ...props }: KibanaThemeProv 'KibanaThemeProvider requires a parent KibanaRenderContextProvider. Check your React tree and ensure that they are wrapped in a KibanaRenderContextProvider.' ); return ( - + {children} ); diff --git a/packages/react/kibana_context/theme/tsconfig.json b/packages/react/kibana_context/theme/tsconfig.json index 491ef1a5c09f8..cfc672666e4c0 100644 --- a/packages/react/kibana_context/theme/tsconfig.json +++ b/packages/react/kibana_context/theme/tsconfig.json @@ -19,5 +19,7 @@ "@kbn/test-jest-helpers", "@kbn/react-kibana-context-common", "@kbn/react-kibana-context-root", + "@kbn/core-user-profile-browser", + "@kbn/core-user-profile-browser-mocks", ] } diff --git a/packages/react/kibana_context/theme/with_theme.tsx b/packages/react/kibana_context/theme/with_theme.tsx index 226b3c04c638b..3cffe8ddd1b21 100644 --- a/packages/react/kibana_context/theme/with_theme.tsx +++ b/packages/react/kibana_context/theme/with_theme.tsx @@ -8,6 +8,7 @@ */ import { ThemeServiceStart } from '@kbn/react-kibana-context-common'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import React from 'react'; import { KibanaThemeProvider } from './theme_provider'; @@ -17,6 +18,8 @@ import { KibanaThemeProvider } from './theme_provider'; * @param node The node to wrap. * @param theme The `ThemeServiceStart` API. */ -export const wrapWithTheme = (node: React.ReactNode, theme: ThemeServiceStart) => ( - {node} -); +export const wrapWithTheme = ( + node: React.ReactNode, + theme: ThemeServiceStart, + userProfile?: UserProfileService +) => {node}; diff --git a/packages/react/kibana_mount/to_mount_point.test.tsx b/packages/react/kibana_mount/to_mount_point.test.tsx index 50a49263e2532..5dafefa8453ef 100644 --- a/packages/react/kibana_mount/to_mount_point.test.tsx +++ b/packages/react/kibana_mount/to_mount_point.test.tsx @@ -15,12 +15,14 @@ import type { UseEuiTheme } from '@elastic/eui'; import type { CoreTheme } from '@kbn/core/public'; import { toMountPoint } from './to_mount_point'; import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; describe('toMountPoint', () => { let euiTheme: UseEuiTheme; const i18n = i18nServiceMock.createStartContract(); const analytics = analyticsServiceMock.createAnalyticsServiceStart(); + const userProfile = userProfileServiceMock.createStart(); const InnerComponent: FC = () => { const theme = useEuiTheme(); @@ -42,7 +44,7 @@ describe('toMountPoint', () => { it('exposes the euiTheme when `theme$` is provided', async () => { const theme = { theme$: of({ darkMode: true, name: 'amsterdam' }) }; - const mount = toMountPoint(, { theme, i18n, analytics }); + const mount = toMountPoint(, { theme, i18n, analytics, userProfile }); const targetEl = document.createElement('div'); mount(targetEl); @@ -55,7 +57,12 @@ describe('toMountPoint', () => { it('propagates changes of the theme$ observable', async () => { const theme$ = new BehaviorSubject({ darkMode: true, name: 'amsterdam' }); - const mount = toMountPoint(, { theme: { theme$ }, i18n, analytics }); + const mount = toMountPoint(, { + theme: { theme$ }, + i18n, + analytics, + userProfile, + }); const targetEl = document.createElement('div'); mount(targetEl); diff --git a/packages/react/kibana_mount/to_mount_point.tsx b/packages/react/kibana_mount/to_mount_point.tsx index 45a2f788c850d..8968decee726a 100644 --- a/packages/react/kibana_mount/to_mount_point.tsx +++ b/packages/react/kibana_mount/to_mount_point.tsx @@ -17,7 +17,7 @@ import { export type ToMountPointParams = Pick< KibanaRenderContextProviderProps, - 'analytics' | 'i18n' | 'theme' + 'analytics' | 'i18n' | 'theme' | 'userProfile' >; /** diff --git a/packages/react/kibana_mount/tsconfig.json b/packages/react/kibana_mount/tsconfig.json index 36036d379b7e1..8294fad813c28 100644 --- a/packages/react/kibana_mount/tsconfig.json +++ b/packages/react/kibana_mount/tsconfig.json @@ -21,5 +21,6 @@ "@kbn/core-i18n-browser-mocks", "@kbn/react-kibana-context-render", "@kbn/core-analytics-browser-mocks", + "@kbn/core-user-profile-browser-mocks", ] } diff --git a/packages/response-ops/rule_form/src/rule_definition/rule_definition.test.tsx b/packages/response-ops/rule_form/src/rule_definition/rule_definition.test.tsx index ca01bbc484570..9ee39ca93f1be 100644 --- a/packages/response-ops/rule_form/src/rule_definition/rule_definition.test.tsx +++ b/packages/response-ops/rule_form/src/rule_definition/rule_definition.test.tsx @@ -236,6 +236,34 @@ describe('Rule Definition', () => { expect(screen.queryByTestId('ruleConsumerSelection')).not.toBeInTheDocument(); }); + test('Hides consumer selection if there are irrelevant consumers and only 1 consumer to select', () => { + useRuleFormState.mockReturnValue({ + plugins, + formData: { + id: 'test-id', + params: {}, + schedule: { + interval: '1m', + }, + alertDelay: { + active: 5, + }, + notifyWhen: null, + consumer: 'stackAlerts', + ruleTypeId: '.es-query', + }, + selectedRuleType: ruleType, + selectedRuleTypeModel: ruleModel, + availableRuleTypes: [ruleType], + canShowConsumerSelect: true, + validConsumers: ['logs', 'observability'], + }); + + render(); + + expect(screen.queryByTestId('ruleConsumerSelection')).not.toBeInTheDocument(); + }); + test('Hides consumer selection if valid consumers contain observability', () => { useRuleFormState.mockReturnValue({ plugins, diff --git a/packages/response-ops/rule_form/src/rule_definition/rule_definition.tsx b/packages/response-ops/rule_form/src/rule_definition/rule_definition.tsx index eaa608ab42434..5cedd0d117527 100644 --- a/packages/response-ops/rule_form/src/rule_definition/rule_definition.tsx +++ b/packages/response-ops/rule_form/src/rule_definition/rule_definition.tsx @@ -30,7 +30,6 @@ import { RuleSettingsFlappingTitleTooltip, } from '@kbn/alerts-ui-shared/lib'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; -import { AlertConsumers } from '@kbn/rule-data-utils'; import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react'; import { ALERTING_FEATURE_ID, MULTI_CONSUMER_RULE_TYPE_IDS } from '../constants'; import { IS_RULE_SPECIFIC_FLAPPING_ENABLED } from '../constants/rule_flapping'; @@ -41,6 +40,7 @@ import { ALERT_DELAY_HELP_TEXT, ALERT_DELAY_TITLE, ALERT_FLAPPING_DETECTION_DESCRIPTION, + FEATURE_NAME_MAP, ALERT_FLAPPING_DETECTION_TITLE, DOC_LINK_TITLE, LOADING_RULE_TYPE_PARAMS_TITLE, @@ -116,15 +116,18 @@ export const RuleDefinition = () => { if (!canShowConsumerSelection) { return false; } - if (!authorizedConsumers.length) { - return false; - } - if ( - authorizedConsumers.length <= 1 || - authorizedConsumers.includes(AlertConsumers.OBSERVABILITY) - ) { + + /* + * This will filter out values like 'alerts' and 'observability' that will not be displayed + * in the drop down. It will allow us to hide the consumer select when there is only one + * selectable value. + */ + const authorizedValidConsumers = authorizedConsumers.filter((c) => c in FEATURE_NAME_MAP); + + if (authorizedValidConsumers.length <= 1) { return false; } + return !!(ruleTypeId && MULTI_CONSUMER_RULE_TYPE_IDS.includes(ruleTypeId)); }, [ruleTypeId, authorizedConsumers, canShowConsumerSelection]); diff --git a/src/core/server/integration_tests/http/oas.test.ts b/src/core/server/integration_tests/http/oas.test.ts index 413b8b01754b5..9aeffe884a203 100644 --- a/src/core/server/integration_tests/http/oas.test.ts +++ b/src/core/server/integration_tests/http/oas.test.ts @@ -17,6 +17,7 @@ import type { } from '@kbn/core-http-context-server-internal'; import { InternalExecutionContextSetup } from '@kbn/core-execution-context-server-internal'; import { IRouter } from '@kbn/core-http-server'; +import { schema } from '@kbn/config-schema'; let prebootDeps: { context: jest.Mocked; @@ -81,14 +82,14 @@ it('handles requests when enabled', async () => { it.each([ { - queryParam: { pathStartsWith: '/api/include-test' }, + queryParam: { pathStartsWith: '/api/public-test' }, includes: { paths: { - '/api/include-test': { + '/api/public-test': { get: {}, post: {}, }, - '/api/include-test/{id}': {}, + '/api/public-test/{id}': {}, }, }, excludes: ['/my-other-plugin'], @@ -97,11 +98,11 @@ it.each([ queryParam: { pluginId: 'myPlugin' }, includes: { paths: { - '/api/include-test': { + '/api/public-test': { get: {}, post: {}, }, - '/api/include-test/{id}': {}, + '/api/public-test/{id}': {}, }, }, excludes: ['/my-other-plugin'], @@ -109,12 +110,13 @@ it.each([ { queryParam: { pluginId: 'nonExistant' }, includes: {}, - excludes: ['/my-include-test', '/my-other-plugin'], + excludes: ['/my-public-test', '/my-other-plugin'], }, { queryParam: { pluginId: 'myOtherPlugin', - pathStartsWith: ['/api/my-other-plugin', '/api/versioned'], + access: 'internal', + pathStartsWith: ['/api/my-other-plugin'], }, includes: { paths: { @@ -125,13 +127,13 @@ it.each([ }, }, }, - excludes: ['/my-include-test'], + excludes: ['/my-public-test'], }, { queryParam: { access: 'public', version: '2023-10-31' }, includes: { paths: { - '/api/include-test': { + '/api/public-test': { get: {}, }, '/api/versioned': { @@ -139,13 +141,13 @@ it.each([ }, }, }, - excludes: ['/api/my-include-test/{id}', '/api/exclude-test', '/api/my-other-plugin'], + excludes: ['/api/my-public-test/{id}', '/api/my-other-plugin'], }, { - queryParam: { excludePathsMatching: ['/api/exclude-test', '/api/my-other-plugin'] }, + queryParam: { excludePathsMatching: ['/api/internal-test', '/api/my-other-plugin'] }, includes: { paths: { - '/api/include-test': { + '/api/public-test': { get: {}, }, '/api/versioned': { @@ -153,7 +155,37 @@ it.each([ }, }, }, - excludes: ['/api/exclude-test', '/api/my-other-plugin'], + excludes: ['/api/internal-test', '/api/my-other-plugin'], + }, + { + queryParam: { access: 'internal', pathStartsWith: ['/api/versioned-internal'] }, + includes: { + paths: { + '/api/versioned-internal': { + get: { + parameters: [ + { + description: 'The version of the API to use', + in: 'header', + name: 'elastic-api-version', + schema: { + default: '2', + enum: ['1', '2'], + type: 'string', + }, + }, + ], + requestBody: { + content: { + 'application/json; Elastic-Api-Version=1': {}, // Multiple body types + 'application/json; Elastic-Api-Version=2': {}, + }, + }, + }, + }, + }, + }, + excludes: ['/api/internal-test', '/api/my-other-plugin'], }, ])( 'can filter paths based on query params $queryParam', @@ -163,17 +195,49 @@ it.each([ createRoutes: (getRouter) => { const router1 = getRouter(Symbol('myPlugin')); router1.get( - { path: '/api/include-test', validate: false, options: { access: 'public' } }, + { path: '/api/public-test', validate: false, options: { access: 'public' } }, + (_, __, res) => res.ok() + ); + router1.post( + { path: '/api/public-test', validate: false, options: { access: 'public' } }, + (_, __, res) => res.ok() + ); + router1.get( + { path: '/api/public-test/{id}', validate: false, options: { access: 'public' } }, + (_, __, res) => res.ok() + ); + router1.get( + { + path: '/api/internal-test', + validate: false, + options: { + /* empty */ + }, + }, (_, __, res) => res.ok() ); - router1.post({ path: '/api/include-test', validate: false }, (_, __, res) => res.ok()); - router1.get({ path: '/api/include-test/{id}', validate: false }, (_, __, res) => res.ok()); - router1.get({ path: '/api/exclude-test', validate: false }, (_, __, res) => res.ok()); router1.versioned .get({ path: '/api/versioned', access: 'public' }) .addVersion({ version: '2023-10-31', validate: false }, (_, __, res) => res.ok()); + router1.versioned + .get({ path: '/api/versioned-internal', access: 'internal' }) + .addVersion( + { + version: '1', + validate: { request: { body: schema.object({ foo: schema.string() }) } }, + }, + (_, __, res) => res.ok() + ) + .addVersion( + { + version: '2', + validate: { request: { body: schema.object({ bar: schema.string() }) } }, + }, + (_, __, res) => res.ok() + ); + const router2 = getRouter(Symbol('myOtherPlugin')); router2.get({ path: '/api/my-other-plugin', validate: false }, (_, __, res) => res.ok()); router2.post({ path: '/api/my-other-plugin', validate: false }, (_, __, res) => res.ok()); diff --git a/packages/kbn-doc-links/README.md b/src/platform/packages/shared/kbn-doc-links/README.md similarity index 100% rename from packages/kbn-doc-links/README.md rename to src/platform/packages/shared/kbn-doc-links/README.md diff --git a/packages/kbn-doc-links/index.ts b/src/platform/packages/shared/kbn-doc-links/index.ts similarity index 100% rename from packages/kbn-doc-links/index.ts rename to src/platform/packages/shared/kbn-doc-links/index.ts diff --git a/packages/kbn-doc-links/jest.config.js b/src/platform/packages/shared/kbn-doc-links/jest.config.js similarity index 84% rename from packages/kbn-doc-links/jest.config.js rename to src/platform/packages/shared/kbn-doc-links/jest.config.js index c2430a3758092..2e9989c26f744 100644 --- a/packages/kbn-doc-links/jest.config.js +++ b/src/platform/packages/shared/kbn-doc-links/jest.config.js @@ -9,6 +9,6 @@ module.exports = { preset: '@kbn/test', - rootDir: '../..', - roots: ['/packages/kbn-doc-links'], + rootDir: '../../../../..', + roots: ['/src/platform/packages/shared/kbn-doc-links'], }; diff --git a/packages/kbn-doc-links/kibana.jsonc b/src/platform/packages/shared/kbn-doc-links/kibana.jsonc similarity index 100% rename from packages/kbn-doc-links/kibana.jsonc rename to src/platform/packages/shared/kbn-doc-links/kibana.jsonc diff --git a/packages/kbn-doc-links/package.json b/src/platform/packages/shared/kbn-doc-links/package.json similarity index 100% rename from packages/kbn-doc-links/package.json rename to src/platform/packages/shared/kbn-doc-links/package.json diff --git a/packages/kbn-doc-links/src/get_doc_links.test.ts b/src/platform/packages/shared/kbn-doc-links/src/get_doc_links.test.ts similarity index 100% rename from packages/kbn-doc-links/src/get_doc_links.test.ts rename to src/platform/packages/shared/kbn-doc-links/src/get_doc_links.test.ts diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts similarity index 100% rename from packages/kbn-doc-links/src/get_doc_links.ts rename to src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts diff --git a/packages/kbn-doc-links/src/get_doc_meta.test.ts b/src/platform/packages/shared/kbn-doc-links/src/get_doc_meta.test.ts similarity index 100% rename from packages/kbn-doc-links/src/get_doc_meta.test.ts rename to src/platform/packages/shared/kbn-doc-links/src/get_doc_meta.test.ts diff --git a/packages/kbn-doc-links/src/get_doc_meta.ts b/src/platform/packages/shared/kbn-doc-links/src/get_doc_meta.ts similarity index 100% rename from packages/kbn-doc-links/src/get_doc_meta.ts rename to src/platform/packages/shared/kbn-doc-links/src/get_doc_meta.ts diff --git a/packages/kbn-doc-links/src/types.ts b/src/platform/packages/shared/kbn-doc-links/src/types.ts similarity index 100% rename from packages/kbn-doc-links/src/types.ts rename to src/platform/packages/shared/kbn-doc-links/src/types.ts diff --git a/packages/kbn-doc-links/tsconfig.json b/src/platform/packages/shared/kbn-doc-links/tsconfig.json similarity index 81% rename from packages/kbn-doc-links/tsconfig.json rename to src/platform/packages/shared/kbn-doc-links/tsconfig.json index df789404c43f2..9cd6452185ddf 100644 --- a/packages/kbn-doc-links/tsconfig.json +++ b/src/platform/packages/shared/kbn-doc-links/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", "types": [ diff --git a/src/plugins/discover/public/embeddable/__mocks__/get_mocked_api.ts b/src/plugins/discover/public/embeddable/__mocks__/get_mocked_api.ts index fdc9cba8a5bfa..592cf3d80faef 100644 --- a/src/plugins/discover/public/embeddable/__mocks__/get_mocked_api.ts +++ b/src/plugins/discover/public/embeddable/__mocks__/get_mocked_api.ts @@ -8,7 +8,7 @@ */ import { BehaviorSubject } from 'rxjs'; - +import type { Adapters } from '@kbn/inspector-plugin/common'; import { SearchSource } from '@kbn/data-plugin/common'; import type { DataView } from '@kbn/data-views-plugin/common'; import { DataTableRecord } from '@kbn/discover-utils'; @@ -58,6 +58,7 @@ export const getMockedSearchApi = ({ rows: new BehaviorSubject([]), totalHitCount: new BehaviorSubject(0), columnsMeta: new BehaviorSubject | undefined>(undefined), + inspectorAdapters: new BehaviorSubject({}), }, }; }; diff --git a/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx b/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx index 4117a36a4e048..c1b5cf9f7695f 100644 --- a/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx +++ b/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx @@ -196,6 +196,7 @@ export const getSearchEmbeddableFactory = ({ savedObjectId: savedObjectId$.getValue(), discoverServices, }), + getInspectorAdapters: () => searchEmbeddable.stateManager.inspectorAdapters.getValue(), }, { ...titleComparators, diff --git a/src/plugins/discover/public/embeddable/initialize_fetch.test.ts b/src/plugins/discover/public/embeddable/initialize_fetch.test.ts index 6fa66115da6e0..061a934dfa2b5 100644 --- a/src/plugins/discover/public/embeddable/initialize_fetch.test.ts +++ b/src/plugins/discover/public/embeddable/initialize_fetch.test.ts @@ -69,6 +69,7 @@ describe('initialize fetch', () => { ].map((hit) => buildDataTableRecord(hit, dataViewMock)) ); expect(stateManager.totalHitCount.getValue()).toEqual(2); + expect(stateManager.inspectorAdapters.getValue().requests).toBeDefined(); }); it('should catch and emit error', async () => { diff --git a/src/plugins/discover/public/embeddable/initialize_fetch.ts b/src/plugins/discover/public/embeddable/initialize_fetch.ts index b502ea94bd371..9ef2a3c167272 100644 --- a/src/plugins/discover/public/embeddable/initialize_fetch.ts +++ b/src/plugins/discover/public/embeddable/initialize_fetch.ts @@ -90,7 +90,7 @@ export function initializeFetch({ stateManager: SearchEmbeddableStateManager; discoverServices: DiscoverServices; }) { - const requestAdapter = new RequestAdapter(); + const inspectorAdapters = { requests: new RequestAdapter() }; let abortController: AbortController | undefined; const fetchSubscription = combineLatest([fetch$(api), api.savedSearch$, api.dataViews]) @@ -127,7 +127,7 @@ export function initializeFetch({ const searchSourceQuery = savedSearch.searchSource.getField('query'); // Log request to inspector - requestAdapter.reset(); + inspectorAdapters.requests.reset(); try { api.dataLoading.next(true); @@ -156,7 +156,7 @@ export function initializeFetch({ filters: fetchContext.filters, dataView, abortSignal: currentAbortController.signal, - inspectorAdapters: discoverServices.inspector, + inspectorAdapters, data: discoverServices.data, expressions: discoverServices.expressions, profilesManager: discoverServices.profilesManager, @@ -181,9 +181,9 @@ export function initializeFetch({ abortSignal: currentAbortController.signal, sessionId: searchSessionId, inspector: { - adapter: requestAdapter, - title: i18n.translate('discover.embeddable.inspectorRequestDataTitle', { - defaultMessage: 'Data', + adapter: inspectorAdapters.requests, + title: i18n.translate('discover.embeddable.inspectorTableRequestTitle', { + defaultMessage: 'Table', }), description: i18n.translate('discover.embeddable.inspectorRequestDescription', { defaultMessage: @@ -195,7 +195,7 @@ export function initializeFetch({ }) ); const interceptedWarnings: SearchResponseWarning[] = []; - discoverServices.data.search.showWarnings(requestAdapter, (warning) => { + discoverServices.data.search.showWarnings(inspectorAdapters.requests, (warning) => { interceptedWarnings.push(warning); return true; // suppress the default behaviour }); @@ -225,6 +225,8 @@ export function initializeFetch({ stateManager.rows.next(next.rows ?? []); stateManager.totalHitCount.next(next.hitCount); + stateManager.inspectorAdapters.next(inspectorAdapters); + api.fetchWarnings$.next(next.warnings ?? []); api.fetchContext$.next(next.fetchContext); if (Object.hasOwn(next, 'columnsMeta')) { diff --git a/src/plugins/discover/public/embeddable/initialize_search_embeddable_api.tsx b/src/plugins/discover/public/embeddable/initialize_search_embeddable_api.tsx index 7b6f20927d347..f5ff51930096f 100644 --- a/src/plugins/discover/public/embeddable/initialize_search_embeddable_api.tsx +++ b/src/plugins/discover/public/embeddable/initialize_search_embeddable_api.tsx @@ -10,7 +10,7 @@ import { pick } from 'lodash'; import deepEqual from 'react-fast-compare'; import { BehaviorSubject, combineLatest, map, Observable, skip } from 'rxjs'; - +import type { Adapters } from '@kbn/inspector-plugin/common'; import { ISearchSource, SerializedSearchSourceFields } from '@kbn/data-plugin/common'; import { DataView } from '@kbn/data-views-plugin/common'; import { DataTableRecord } from '@kbn/discover-utils/types'; @@ -116,6 +116,7 @@ export const initializeSearchEmbeddableApi = async ( const rows$ = new BehaviorSubject([]); const columnsMeta$ = new BehaviorSubject(undefined); const totalHitCount$ = new BehaviorSubject(undefined); + const inspectorAdapters$ = new BehaviorSubject({}); /** * The state manager is used to modify the state of the saved search - this should never be @@ -134,6 +135,7 @@ export const initializeSearchEmbeddableApi = async ( totalHitCount: totalHitCount$, viewMode: savedSearchViewMode$, density: density$, + inspectorAdapters: inspectorAdapters$, }; /** The saved search should be the source of truth for all state */ diff --git a/src/plugins/discover/public/embeddable/types.ts b/src/plugins/discover/public/embeddable/types.ts index 64cf5a390da3a..94d0b10cc3f64 100644 --- a/src/plugins/discover/public/embeddable/types.ts +++ b/src/plugins/discover/public/embeddable/types.ts @@ -9,6 +9,7 @@ import { DataTableRecord } from '@kbn/discover-utils/types'; import type { DefaultEmbeddableApi } from '@kbn/embeddable-plugin/public'; +import { HasInspectorAdapters } from '@kbn/inspector-plugin/public'; import { EmbeddableApiContext, HasEditCapabilities, @@ -47,6 +48,7 @@ export type SearchEmbeddableState = Pick< rows: DataTableRecord[]; columnsMeta: DataTableColumnsMeta | undefined; totalHitCount: number | undefined; + inspectorAdapters: Record; }; export type SearchEmbeddableStateManager = { @@ -55,7 +57,7 @@ export type SearchEmbeddableStateManager = { export type SearchEmbeddableSerializedAttributes = Omit< SearchEmbeddableState, - 'rows' | 'columnsMeta' | 'totalHitCount' | 'searchSource' + 'rows' | 'columnsMeta' | 'totalHitCount' | 'searchSource' | 'inspectorAdapters' > & Pick; @@ -98,6 +100,7 @@ export type SearchEmbeddableApi = DefaultEmbeddableApi< PublishesWritableUnifiedSearch & HasInPlaceLibraryTransforms & HasTimeRange & + HasInspectorAdapters & Partial; export interface PublishesSavedSearch { diff --git a/src/plugins/home/public/application/application.tsx b/src/plugins/home/public/application/application.tsx index a8459279080bc..b45ab670954e0 100644 --- a/src/plugins/home/public/application/application.tsx +++ b/src/plugins/home/public/application/application.tsx @@ -44,7 +44,7 @@ export const renderApp = async ( ); render( - + & +export type KibanaThemeProviderProps = Pick< + KbnThemeProviderProps, + 'children' | 'modify' | 'userProfile' +> & KbnThemeProviderProps['theme']; /** @deprecated Use `KibanaThemeProvider` from `@kbn/react-kibana-context-theme` */ -export const KibanaThemeProvider = ({ children, theme$, modify }: KibanaThemeProviderProps) => ( - +export const KibanaThemeProvider = ({ + children, + theme$, + userProfile, + modify, +}: KibanaThemeProviderProps) => ( + {children} ); type Theme = KbnThemeProviderProps['theme']['theme$']; -export const wrapWithTheme = (node: React.ReactNode, theme$: Theme) => - kbnWrapWithTheme(node, { theme$ }); +/** @deprecated Use `wrapWithTheme` from `@kbn/react-kibana-context-theme` */ +export const wrapWithTheme = ( + node: React.ReactNode, + theme$: Theme, + userProfile?: UserProfileService +) => kbnWrapWithTheme(node, { theme$ }, userProfile); diff --git a/src/plugins/kibana_react/public/util/index.tsx b/src/plugins/kibana_react/public/util/index.tsx index f58affa049dc5..963dba824a0c4 100644 --- a/src/plugins/kibana_react/public/util/index.tsx +++ b/src/plugins/kibana_react/public/util/index.tsx @@ -15,6 +15,7 @@ import type { MountPoint } from '@kbn/core/public'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { CoreTheme, ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { defaultTheme } from '@kbn/react-kibana-context-common'; import { toMountPoint as _toMountPoint } from '@kbn/react-kibana-mount'; @@ -40,6 +41,7 @@ const i18n: I18nStart = { export interface ToMountPointOptions { analytics?: AnalyticsServiceStart; theme$?: Observable; + userProfile?: UserProfileService; } /** @@ -47,8 +49,8 @@ export interface ToMountPointOptions { */ export const toMountPoint = ( node: React.ReactNode, - { analytics, theme$ }: ToMountPointOptions = {} + { analytics, theme$, userProfile }: ToMountPointOptions = {} ): MountPoint => { const theme = theme$ ? { theme$ } : themeStart; - return _toMountPoint(node, { analytics, theme, i18n }); + return _toMountPoint(node, { analytics, theme, i18n, userProfile }); }; diff --git a/src/plugins/kibana_react/tsconfig.json b/src/plugins/kibana_react/tsconfig.json index cff9a2ce19312..2394c7bfe5250 100644 --- a/src/plugins/kibana_react/tsconfig.json +++ b/src/plugins/kibana_react/tsconfig.json @@ -25,6 +25,7 @@ "@kbn/code-editor", "@kbn/core-analytics-browser", "@kbn/shared-ux-link-redirect-app", + "@kbn/core-user-profile-browser", ], "exclude": [ "target/**/*", diff --git a/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx b/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx index 89619fc287046..becfb9d0da404 100644 --- a/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx +++ b/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx @@ -15,6 +15,7 @@ import ReactDOM from 'react-dom'; import { ApplicationStart, HttpStart, ToastsSetup } from '@kbn/core/public'; import type { ThemeServiceStart } from '@kbn/core/public'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { SavedObjectNotFound } from '..'; import { KibanaThemeProvider } from '../theme'; @@ -49,6 +50,7 @@ export function redirectWhenMissing({ toastNotifications, onBeforeRedirect, theme, + userProfile, }: { history: History; navigateToApp: ApplicationStart['navigateToApp']; @@ -67,6 +69,7 @@ export function redirectWhenMissing({ */ onBeforeRedirect?: (error: SavedObjectNotFound) => void; theme: ThemeServiceStart; + userProfile?: UserProfileService; }) { let localMappingObject: Mapping; @@ -98,7 +101,7 @@ export function redirectWhenMissing({ }), text: (element: HTMLElement) => { ReactDOM.render( - + {error.message} , element diff --git a/src/plugins/kibana_utils/public/theme/kibana_theme_provider.test.tsx b/src/plugins/kibana_utils/public/theme/kibana_theme_provider.test.tsx index 93511354b19ad..c3c2be931d411 100644 --- a/src/plugins/kibana_utils/public/theme/kibana_theme_provider.test.tsx +++ b/src/plugins/kibana_utils/public/theme/kibana_theme_provider.test.tsx @@ -14,6 +14,7 @@ import React, { useEffect } from 'react'; import { act } from 'react-dom/test-utils'; import { BehaviorSubject, of } from 'rxjs'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { CoreTheme } from '@kbn/core/public'; @@ -21,6 +22,7 @@ import { KibanaThemeProvider } from './kibana_theme_provider'; describe('KibanaThemeProvider', () => { let euiTheme: ReturnType | undefined; + const userProfile = userProfileServiceMock.createStart(); beforeEach(() => { euiTheme = undefined; @@ -55,7 +57,7 @@ describe('KibanaThemeProvider', () => { const coreTheme: CoreTheme = { darkMode: true, name: 'amsterdam' }; const wrapper = mountWithIntl( - + ); @@ -69,7 +71,7 @@ describe('KibanaThemeProvider', () => { const coreTheme$ = new BehaviorSubject({ darkMode: true, name: 'amsterdam' }); const wrapper = mountWithIntl( - + ); diff --git a/src/plugins/kibana_utils/public/theme/kibana_theme_provider.tsx b/src/plugins/kibana_utils/public/theme/kibana_theme_provider.tsx index bc104836e2780..3550a34781da2 100644 --- a/src/plugins/kibana_utils/public/theme/kibana_theme_provider.tsx +++ b/src/plugins/kibana_utils/public/theme/kibana_theme_provider.tsx @@ -12,10 +12,12 @@ import { Observable } from 'rxjs'; import { EuiProviderProps } from '@elastic/eui'; import { CoreTheme } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { KibanaThemeProvider as KbnThemeProvider } from '@kbn/react-kibana-context-theme'; export interface KibanaThemeProviderProps { theme$: Observable; + userProfile?: UserProfileService; modify?: EuiProviderProps<{}>['modify']; children: React.ReactNode; } @@ -23,6 +25,11 @@ export interface KibanaThemeProviderProps { /** @deprecated use `KibanaThemeProvider` from `@kbn/react-kibana-context-theme */ export const KibanaThemeProvider: FC> = ({ theme$, + userProfile, modify, children, -}) => {children}; +}) => ( + + {children} + +); diff --git a/src/plugins/kibana_utils/tsconfig.json b/src/plugins/kibana_utils/tsconfig.json index ceb0d705d5780..0b45dc44ed994 100644 --- a/src/plugins/kibana_utils/tsconfig.json +++ b/src/plugins/kibana_utils/tsconfig.json @@ -23,6 +23,8 @@ "@kbn/core-notifications-browser-mocks", "@kbn/react-kibana-context-theme", "@kbn/core-theme-browser", + "@kbn/core-user-profile-browser", + "@kbn/core-user-profile-browser-mocks", ], "exclude": [ "target/**/*", diff --git a/src/plugins/saved_objects/public/kibana_services.ts b/src/plugins/saved_objects/public/kibana_services.ts index 60c4eb9da457b..8c37ef8b6e046 100644 --- a/src/plugins/saved_objects/public/kibana_services.ts +++ b/src/plugins/saved_objects/public/kibana_services.ts @@ -17,3 +17,4 @@ export function setStartServices(core: CoreStart) { export const getAnalytics = () => coreStart.analytics; export const getI18n = () => coreStart.i18n; export const getTheme = () => coreStart.theme; +export const getUserProfile = () => coreStart.userProfile; diff --git a/src/plugins/saved_objects/public/save_modal/show_saved_object_save_modal.tsx b/src/plugins/saved_objects/public/save_modal/show_saved_object_save_modal.tsx index 70ab2a39b7bfb..85b4ce3a5d03b 100644 --- a/src/plugins/saved_objects/public/save_modal/show_saved_object_save_modal.tsx +++ b/src/plugins/saved_objects/public/save_modal/show_saved_object_save_modal.tsx @@ -10,7 +10,7 @@ import React, { FC, PropsWithChildren } from 'react'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { getAnalytics, getI18n, getTheme } from '../kibana_services'; +import { getAnalytics, getI18n, getTheme, getUserProfile } from '../kibana_services'; /** * Represents the result of trying to persist the saved object. @@ -68,7 +68,7 @@ export function showSaveModal( children: augmentedElement, }); }), - { analytics: getAnalytics(), theme: getTheme(), i18n: getI18n() } + { analytics: getAnalytics(), theme: getTheme(), i18n: getI18n(), userProfile: getUserProfile() } ); unmount = mount(document.createElement('div')); diff --git a/src/plugins/saved_objects/public/types.ts b/src/plugins/saved_objects/public/types.ts index 0919c24ab2c62..4a8ac83921266 100644 --- a/src/plugins/saved_objects/public/types.ts +++ b/src/plugins/saved_objects/public/types.ts @@ -54,7 +54,7 @@ export interface SavedObjectCreationOpts { overwrite?: boolean; } -export type StartServices = Pick; +export type StartServices = Pick; export interface SavedObjectAttributesAndRefs { attributes: SavedObjectAttributes; diff --git a/src/plugins/share/public/services/share_menu_manager.tsx b/src/plugins/share/public/services/share_menu_manager.tsx index e5d838691f66c..14644d7664bfd 100644 --- a/src/plugins/share/public/services/share_menu_manager.tsx +++ b/src/plugins/share/public/services/share_menu_manager.tsx @@ -10,7 +10,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { CoreStart, ThemeServiceStart, ToastsSetup } from '@kbn/core/public'; +import { CoreStart, ThemeServiceStart, ToastsSetup, UserProfileService } from '@kbn/core/public'; import { ShowShareMenuOptions } from '../types'; import { ShareMenuRegistryStart } from './share_menu_registry'; import { AnonymousAccessServiceContract } from '../../common/anonymous_access'; @@ -49,10 +49,9 @@ export class ShareMenuManager { menuItems, urlService, anonymousAccess, - theme: core.theme, - i18n: core.i18n, toasts: core.notifications.toasts, publicAPIEnabled: !disableEmbed, + ...core, }); }, }; @@ -75,28 +74,28 @@ export class ShareMenuManager { shareableUrl, shareableUrlLocatorParams, embedUrlParamExtensions, - theme, showPublicUrlSwitch, urlService, anonymousAccess, snapshotShareWarning, onClose, disabledShareUrl, - i18n, isDirty, toasts, delegatedShareUrlHandler, publicAPIEnabled, + ...startServices }: ShowShareMenuOptions & { anchorElement: HTMLElement; menuItems: ShareMenuItemV2[]; urlService: BrowserUrlService; anonymousAccess: AnonymousAccessServiceContract | undefined; - theme: ThemeServiceStart; onClose: () => void; - i18n: CoreStart['i18n']; isDirty: boolean; toasts: ToastsSetup; + userProfile: UserProfileService; + theme: ThemeServiceStart; + i18n: CoreStart['i18n']; }) { if (this.isOpen) { onClose(); @@ -135,11 +134,10 @@ export class ShareMenuManager { onClose(); unmount(); }, - theme, - i18n, + ...startServices, }} />, - { i18n, theme } + startServices ); const openModal = () => { diff --git a/src/plugins/share/public/url_service/redirect/components/page.tsx b/src/plugins/share/public/url_service/redirect/components/page.tsx index d2722a1976038..c5f2a93450092 100644 --- a/src/plugins/share/public/url_service/redirect/components/page.tsx +++ b/src/plugins/share/public/url_service/redirect/components/page.tsx @@ -14,6 +14,7 @@ import { EuiPageTemplate } from '@elastic/eui'; import type { CustomBrandingSetup } from '@kbn/core-custom-branding-browser'; import type { ChromeDocTitle, ThemeServiceSetup } from '@kbn/core/public'; import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { RedirectManager } from '../redirect_manager'; import { RedirectEmptyPrompt } from './empty_prompt'; @@ -25,6 +26,7 @@ export interface PageProps { customBranding: CustomBrandingSetup; manager: Pick; theme: ThemeServiceSetup; + userProfile: UserProfileService; } export const Page: React.FC = ({ @@ -32,14 +34,14 @@ export const Page: React.FC = ({ homeHref, customBranding, docTitle, - theme, + ...startServices }) => { const error = useObservable(manager.error$); const hasCustomBranding = useObservable(customBranding.hasCustomBranding$); if (error) { return ( - + @@ -48,7 +50,7 @@ export const Page: React.FC = ({ } return ( - + diff --git a/src/plugins/share/public/url_service/redirect/redirect_manager.ts b/src/plugins/share/public/url_service/redirect/redirect_manager.ts index 18d909808ef3c..c4dd843deed00 100644 --- a/src/plugins/share/public/url_service/redirect/redirect_manager.ts +++ b/src/plugins/share/public/url_service/redirect/redirect_manager.ts @@ -39,13 +39,14 @@ export class RedirectManager { mount: async (params) => { const { render } = await import('./render'); const [start] = await core.getStartServices(); - const { chrome, uiSettings } = start; + const { chrome, uiSettings, userProfile } = start; const unmount = render(params.element, { manager: this, customBranding, docTitle: chrome.docTitle, theme, + userProfile, homeHref: getHomeHref(http, uiSettings), }); diff --git a/src/plugins/share/tsconfig.json b/src/plugins/share/tsconfig.json index 8bc8474a84eef..acd84ebc97a83 100644 --- a/src/plugins/share/tsconfig.json +++ b/src/plugins/share/tsconfig.json @@ -25,6 +25,7 @@ "@kbn/core-theme-browser-mocks", "@kbn/core-i18n-browser-mocks", "@kbn/core-notifications-browser-mocks", + "@kbn/core-user-profile-browser", ], "exclude": [ "target/**/*", diff --git a/src/plugins/telemetry/public/mocks.ts b/src/plugins/telemetry/public/mocks.ts index 6461c2e154e88..ad7926cc4211f 100644 --- a/src/plugins/telemetry/public/mocks.ts +++ b/src/plugins/telemetry/public/mocks.ts @@ -15,6 +15,7 @@ import { notificationServiceMock, themeServiceMock, } from '@kbn/core/public/mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; import type { TelemetryConstants } from '.'; import type { TelemetryPluginStart, TelemetryPluginSetup, TelemetryPluginConfig } from './plugin'; import { TelemetryService, TelemetryNotifications } from './services'; @@ -82,6 +83,7 @@ export function mockTelemetryNotifications({ analytics: analyticsServiceMock.createAnalyticsServiceStart(), i18n: i18nServiceMock.createStartContract(), theme: themeServiceMock.createStartContract(), + userProfile: userProfileServiceMock.createStart(), telemetryService, telemetryConstants: mockTelemetryConstants(), }); diff --git a/src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.test.ts b/src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.test.ts index 6f2d29371df65..8eedf9fc02b67 100644 --- a/src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.test.ts +++ b/src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.test.ts @@ -15,6 +15,7 @@ import { overlayServiceMock, themeServiceMock, } from '@kbn/core/public/mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; import { mockTelemetryConstants, mockTelemetryService } from '../../mocks'; describe('renderOptInStatusNoticeBanner', () => { @@ -25,6 +26,7 @@ describe('renderOptInStatusNoticeBanner', () => { const analytics = analyticsServiceMock.createAnalyticsServiceStart(); const i18n = i18nServiceMock.createStartContract(); const theme = themeServiceMock.createStartContract(); + const userProfile = userProfileServiceMock.createStart(); const telemetryConstants = mockTelemetryConstants(); const telemetryService = mockTelemetryService(); overlays.banners.add.mockReturnValue(bannerID); @@ -36,6 +38,7 @@ describe('renderOptInStatusNoticeBanner', () => { analytics, i18n, theme, + userProfile, telemetryConstants, telemetryService, }); diff --git a/src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.tsx b/src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.tsx index 4227319b0f65a..4d54de430e954 100644 --- a/src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.tsx +++ b/src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.tsx @@ -14,7 +14,8 @@ import { withSuspense } from '@kbn/shared-ux-utility'; import { TelemetryService } from '..'; import type { TelemetryConstants } from '../..'; -interface RenderBannerConfig extends Pick { +interface RenderBannerConfig + extends Pick { http: HttpStart; overlays: OverlayStart; onSeen: () => void; diff --git a/src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts b/src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts index b830ef6872df8..99195f9b32589 100644 --- a/src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts +++ b/src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts @@ -12,8 +12,9 @@ import type { TelemetryService } from '../telemetry_service'; import type { TelemetryConstants } from '../..'; import { renderOptInStatusNoticeBanner } from './render_opt_in_status_notice_banner'; -interface TelemetryNotificationsConstructor - extends Pick { +type StartServices = Pick; + +interface TelemetryNotificationsConstructor extends StartServices { http: HttpStart; overlays: OverlayStart; telemetryService: TelemetryService; @@ -26,7 +27,7 @@ interface TelemetryNotificationsConstructor export class TelemetryNotifications { private readonly http: HttpStart; private readonly overlays: OverlayStart; - private readonly startServices: Pick; + private readonly startServices: StartServices; private readonly telemetryConstants: TelemetryConstants; private readonly telemetryService: TelemetryService; private optInStatusNoticeBannerId?: string; diff --git a/src/plugins/telemetry/tsconfig.json b/src/plugins/telemetry/tsconfig.json index c23b4fea26b89..68a9e0118e0fc 100644 --- a/src/plugins/telemetry/tsconfig.json +++ b/src/plugins/telemetry/tsconfig.json @@ -35,6 +35,7 @@ "@kbn/react-kibana-mount", "@kbn/core-node-server", "@kbn/security-plugin-types-server", + "@kbn/core-user-profile-browser-mocks", ], "exclude": [ "target/**/*", diff --git a/src/plugins/ui_actions/public/context_menu/open_context_menu.tsx b/src/plugins/ui_actions/public/context_menu/open_context_menu.tsx index ab8a12374a605..1321ad9fd3803 100644 --- a/src/plugins/ui_actions/public/context_menu/open_context_menu.tsx +++ b/src/plugins/ui_actions/public/context_menu/open_context_menu.tsx @@ -13,7 +13,7 @@ import { EuiContextMenu, EuiContextMenuPanelDescriptor, EuiPopover } from '@elas import { EventEmitter } from 'events'; import ReactDOM from 'react-dom'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; -import { getAnalytics, getI18n, getTheme } from '../services'; +import { getAnalytics, getI18n, getTheme, getUserProfile } from '../services'; let activeSession: ContextMenuSession | null = null; @@ -171,7 +171,12 @@ export function openContextMenu( }; ReactDOM.render( - + | undefined' diff --git a/src/plugins/ui_actions/public/plugin.ts b/src/plugins/ui_actions/public/plugin.ts index 988ef1116e715..4ffea25313b29 100644 --- a/src/plugins/ui_actions/public/plugin.ts +++ b/src/plugins/ui_actions/public/plugin.ts @@ -16,7 +16,7 @@ import { addPanelMenuTrigger, } from '@kbn/ui-actions-browser/src/triggers'; import { UiActionsService } from './service'; -import { setAnalytics, setI18n, setNotifications, setTheme } from './services'; +import { setAnalytics, setI18n, setNotifications, setTheme, setUserProfile } from './services'; export type UiActionsPublicSetup = Pick< UiActionsService, @@ -62,6 +62,7 @@ export class UiActionsPlugin setI18n(core.i18n); setNotifications(core.notifications); setTheme(core.theme); + setUserProfile(core.userProfile); return this.service; } diff --git a/src/plugins/ui_actions/public/services.ts b/src/plugins/ui_actions/public/services.ts index ccb9520c3bcfb..981d3c9c78976 100644 --- a/src/plugins/ui_actions/public/services.ts +++ b/src/plugins/ui_actions/public/services.ts @@ -7,7 +7,13 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { AnalyticsServiceStart, CoreStart, I18nStart, ThemeServiceSetup } from '@kbn/core/public'; +import { + AnalyticsServiceStart, + CoreStart, + I18nStart, + ThemeServiceSetup, + UserProfileService, +} from '@kbn/core/public'; import { createGetterSetter } from '@kbn/kibana-utils-plugin/public'; export const [getAnalytics, setAnalytics] = createGetterSetter('Analytics'); @@ -15,3 +21,5 @@ export const [getI18n, setI18n] = createGetterSetter('I18n'); export const [getNotifications, setNotifications] = createGetterSetter('Notifications'); export const [getTheme, setTheme] = createGetterSetter('Theme'); +export const [getUserProfile, setUserProfile] = + createGetterSetter('UserProfile'); diff --git a/src/plugins/ui_actions/public/tests/test_samples/hello_world_action.tsx b/src/plugins/ui_actions/public/tests/test_samples/hello_world_action.tsx index 25296929e10fd..aa087eb524b46 100644 --- a/src/plugins/ui_actions/public/tests/test_samples/hello_world_action.tsx +++ b/src/plugins/ui_actions/public/tests/test_samples/hello_world_action.tsx @@ -14,7 +14,7 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import { ActionDefinition } from '../../actions'; -type StartServices = Pick; +type StartServices = Pick; const getMenuItem = (core: StartServices) => { return () => { diff --git a/test/plugin_functional/plugins/core_plugin_helpmenu/public/application.tsx b/test/plugin_functional/plugins/core_plugin_helpmenu/public/application.tsx index f3d64605f1fc3..a2f48362ebe7d 100644 --- a/test/plugin_functional/plugins/core_plugin_helpmenu/public/application.tsx +++ b/test/plugin_functional/plugins/core_plugin_helpmenu/public/application.tsx @@ -18,6 +18,7 @@ import { EuiTitle, } from '@elastic/eui'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; @@ -26,6 +27,7 @@ interface StartServices { analytics: Pick; i18n: I18nStart; theme: Pick; + userProfile: UserProfileService; } import { AppMountParameters } from '@kbn/core/public'; diff --git a/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json b/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json index de2437f09fa9b..fd21ffba5d3d6 100644 --- a/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json @@ -17,6 +17,7 @@ "@kbn/core-analytics-browser", "@kbn/core-i18n-browser", "@kbn/core-theme-browser", - "@kbn/react-kibana-context-render" + "@kbn/react-kibana-context-render", + "@kbn/core-user-profile-browser" ] } diff --git a/tsconfig.base.json b/tsconfig.base.json index c73ebc1e6b599..85eaafc729e61 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -786,8 +786,8 @@ "@kbn/discover-shared-plugin/*": ["src/plugins/discover_shared/*"], "@kbn/discover-utils": ["packages/kbn-discover-utils"], "@kbn/discover-utils/*": ["packages/kbn-discover-utils/*"], - "@kbn/doc-links": ["packages/kbn-doc-links"], - "@kbn/doc-links/*": ["packages/kbn-doc-links/*"], + "@kbn/doc-links": ["src/platform/packages/shared/kbn-doc-links"], + "@kbn/doc-links/*": ["src/platform/packages/shared/kbn-doc-links/*"], "@kbn/docs-utils": ["packages/kbn-docs-utils"], "@kbn/docs-utils/*": ["packages/kbn-docs-utils/*"], "@kbn/dom-drag-drop": ["packages/kbn-dom-drag-drop"], diff --git a/x-pack/examples/screenshotting_example/public/app/http_context.ts b/x-pack/examples/screenshotting_example/public/app/http_context.ts index 7bc0b2b4f2870..1c3b6c164440c 100644 --- a/x-pack/examples/screenshotting_example/public/app/http_context.ts +++ b/x-pack/examples/screenshotting_example/public/app/http_context.ts @@ -11,6 +11,7 @@ import type { HttpStart, I18nStart, ThemeServiceStart, + UserProfileService, } from '@kbn/core/public'; export interface StartServices { @@ -18,6 +19,7 @@ export interface StartServices { analytics: Pick; i18n: I18nStart; theme: Pick; + userProfile: UserProfileService; } export const AppContext = createContext(undefined); diff --git a/x-pack/examples/screenshotting_example/public/plugin.tsx b/x-pack/examples/screenshotting_example/public/plugin.tsx index 6dd07b992b1c3..b020424cc5d76 100644 --- a/x-pack/examples/screenshotting_example/public/plugin.tsx +++ b/x-pack/examples/screenshotting_example/public/plugin.tsx @@ -26,8 +26,8 @@ export class ScreenshottingExamplePlugin implements Plugin { title: APPLICATION_NAME, visibleIn: [], mount: async ({ element }: AppMountParameters) => { - const [{ http, analytics, i18n, theme }] = await getStartServices(); - const startServices = { analytics, http, i18n, theme }; + const [{ http, analytics, i18n, theme, userProfile }] = await getStartServices(); + const startServices = { analytics, http, i18n, theme, userProfile }; ReactDOM.render( diff --git a/x-pack/packages/ml/cancellable_search/src/use_cancellable_search.ts b/x-pack/packages/ml/cancellable_search/src/use_cancellable_search.ts index 375fd6e44b435..5d144cc82ea9c 100644 --- a/x-pack/packages/ml/cancellable_search/src/use_cancellable_search.ts +++ b/x-pack/packages/ml/cancellable_search/src/use_cancellable_search.ts @@ -6,13 +6,16 @@ */ import { useCallback, useRef, useState } from 'react'; -import type { IKibanaSearchResponse } from '@kbn/search-types'; +import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/search-types'; import { isRunningResponse } from '@kbn/data-plugin/common'; import { tap } from 'rxjs'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; export interface UseCancellableSearch { - runRequest: ( + runRequest: < + RequestBody extends IKibanaSearchRequest, + ResponseType extends IKibanaSearchResponse + >( requestBody: RequestBody, options?: object ) => Promise; @@ -26,13 +29,12 @@ export function useCancellableSearch(data: DataPublicPluginStart) { const [isLoading, setIsFetching] = useState(false); const runRequest = useCallback( - ( + ( requestBody: RequestBody, options = {} ): Promise => { return new Promise((resolve, reject) => { data.search - // @ts-expect-error upgrade typescript v4.9.5 .search(requestBody, { abortSignal: abortController.current.signal, ...options, diff --git a/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.test.tsx b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.test.tsx index a217bbc4fb2cf..8c383b6439ef4 100644 --- a/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.test.tsx +++ b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.test.tsx @@ -9,7 +9,8 @@ import moment from 'moment'; import React from 'react'; import { act, render, fireEvent } from '@testing-library/react'; -import type { Query } from '@kbn/es-query'; +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; + import type { DataView } from '@kbn/data-views-plugin/public'; import type { TimefilterContract } from '@kbn/data-plugin/public'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; @@ -48,9 +49,10 @@ describe('FullTimeRangeSelector', () => { timeFieldName: '@timestamp', } as unknown as DataView; - const query: Query = { - language: 'kuery', - query: 'region:us-east-1', + const query: QueryDslQueryContainer = { + term: { + region: 'us-east-1', + }, }; const props = { @@ -70,7 +72,6 @@ describe('FullTimeRangeSelector', () => { const { getByText } = render( - {/* @ts-expect-error upgrade typescript v4.9.5*/} @@ -99,7 +100,6 @@ describe('FullTimeRangeSelector', () => { const { getByText } = render( - {/* @ts-expect-error upgrade typescript v4.9.5*/} diff --git a/x-pack/packages/ml/inference_integration_flyout/components/flyout_layout.tsx b/x-pack/packages/ml/inference_integration_flyout/components/flyout_layout.tsx index 22c904e63561e..77b7f623099a3 100644 --- a/x-pack/packages/ml/inference_integration_flyout/components/flyout_layout.tsx +++ b/x-pack/packages/ml/inference_integration_flyout/components/flyout_layout.tsx @@ -51,7 +51,7 @@ export const InferenceFlyout: React.FC = ({ }, [inferenceEndpointError]); const onChangingInferenceEndpoint = useCallback( - (value: any) => { + (value: string) => { setInferenceEndpointId(value); onInferenceEndpointChange(value); }, diff --git a/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx b/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx index e9072c2929f14..ded175a89dfbc 100644 --- a/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx +++ b/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx @@ -10,7 +10,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { orderBy, isEqual } from 'lodash'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { EuiTableSortingType } from '@elastic/eui'; +import type { Criteria, EuiTableSortingType } from '@elastic/eui'; import { useEuiBackgroundColor, EuiBasicTable } from '@elastic/eui'; import type { SignificantItem } from '@kbn/ml-agg-utils'; @@ -109,7 +109,7 @@ export const LogRateAnalysisResultsTable: FC = groupFilter !== undefined ); - const onChange = useCallback((tableSettings: any) => { + const onChange = useCallback((tableSettings: Criteria) => { if (tableSettings.page) { const { index, size } = tableSettings.page; setPageIndex(index); diff --git a/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table_groups.tsx b/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table_groups.tsx index 6bd0a5e4ce213..ceeeb79c1232c 100644 --- a/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table_groups.tsx +++ b/x-pack/plugins/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table_groups.tsx @@ -9,7 +9,7 @@ import type { FC } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { orderBy, isEqual } from 'lodash'; -import type { EuiBasicTableColumn, EuiTableSortingType } from '@elastic/eui'; +import type { EuiBasicTableColumn, EuiTableSortingType, Criteria } from '@elastic/eui'; import { useEuiBackgroundColor, EuiBadge, @@ -77,7 +77,7 @@ export const LogRateAnalysisResultsGroupsTable: FC( + const [sortField, setSortField] = useState( zeroDocsFallback ? DEFAULT_SORT_FIELD_ZERO_DOCS_FALLBACK : DEFAULT_SORT_FIELD ); const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>( @@ -247,7 +247,7 @@ export const LogRateAnalysisResultsGroupsTable: FC { + const onChange = useCallback((tableSettings: Criteria) => { if (tableSettings.page) { const { index, size } = tableSettings.page; setPageIndex(index); diff --git a/x-pack/plugins/aiops/public/hooks/use_cancellable_search.ts b/x-pack/plugins/aiops/public/hooks/use_cancellable_search.ts index 4d721d64c987f..77373a7d490e9 100644 --- a/x-pack/plugins/aiops/public/hooks/use_cancellable_search.ts +++ b/x-pack/plugins/aiops/public/hooks/use_cancellable_search.ts @@ -6,7 +6,7 @@ */ import { useCallback, useRef, useState } from 'react'; -import type { IKibanaSearchResponse } from '@kbn/search-types'; +import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/search-types'; import { isRunningResponse } from '@kbn/data-plugin/common'; import { tap } from 'rxjs'; import { useAiopsAppContext } from './use_aiops_app_context'; @@ -17,12 +17,11 @@ export function useCancellableSearch() { const [isLoading, setIsFetching] = useState(false); const runRequest = useCallback( - ( + ( requestBody: RequestBody ): Promise => { return new Promise((resolve, reject) => { data.search - // @ts-expect-error upgrade typescript v4.9.5 .search(requestBody, { abortSignal: abortController.current.signal, }) diff --git a/x-pack/plugins/data_visualizer/public/application/data_drift/use_data_drift_result.ts b/x-pack/plugins/data_visualizer/public/application/data_drift/use_data_drift_result.ts index 158b3477b5cb1..e8d2a48f56d08 100644 --- a/x-pack/plugins/data_visualizer/public/application/data_drift/use_data_drift_result.ts +++ b/x-pack/plugins/data_visualizer/public/application/data_drift/use_data_drift_result.ts @@ -506,9 +506,7 @@ const fetchComparisonDriftedData = async ({ ); fieldsWithNoOverlap.forEach((field) => { - // @ts-expect-error upgrade typescript v4.9.5 - if (driftedResp.aggregations) { - // @ts-expect-error upgrade typescript v4.9.5 + if (driftedResp?.aggregations) { driftedResp.aggregations[`${field}_ks_test`] = { // Setting -Infinity to represent astronomically small number // which would be represented as < 0.000001 in table diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/connectors.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/connectors.tsx index ed6ff07c0cafd..47f2226fe976e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/connectors.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/connectors.tsx @@ -53,7 +53,7 @@ export const connectorsBreadcrumbs = [ export const crawlersBreadcrumbs = [ i18n.translate('xpack.enterpriseSearch.content.crawlers.breadcrumb', { - defaultMessage: 'Web crawlers', + defaultMessage: 'Web Crawlers', }), ]; @@ -93,7 +93,7 @@ export const Connectors: React.FC = ({ isCrawler }) => { defaultMessage: 'Elasticsearch connectors', }) : i18n.translate('xpack.enterpriseSearch.crawlers.title', { - defaultMessage: 'Elasticsearch web crawlers', + defaultMessage: 'Elastic Web Crawler', }), rightSideGroupProps: { gutterSize: 's', diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/crawler_empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/crawler_empty_state.tsx index 6be21dd8c63a7..2dc97fb86c04f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/crawler_empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/crawler_empty_state.tsx @@ -49,6 +49,7 @@ export const CrawlerEmptyState: React.FC = () => { fill iconType={GithubIcon} href={'https://github.com/elastic/crawler'} + target="_blank" > {i18n.translate( 'xpack.enterpriseSearch.crawlerEmptyState.openSourceCrawlerButtonLabel', diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/configuration_step.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/configuration_step.tsx index 9749c49ea4d68..f8bff23aa56a1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/configuration_step.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/configuration_step.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { useActions, useValues } from 'kea'; @@ -21,6 +21,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; import { ConnectorConfigurationComponent, ConnectorStatus } from '@kbn/search-connectors'; @@ -40,6 +41,8 @@ export const ConfigurationStep: React.FC = ({ title, set const { connector } = useValues(ConnectorViewLogic); const { updateConnectorConfiguration } = useActions(ConnectorViewLogic); const { setFormDirty } = useActions(NewConnectorLogic); + const { overlays } = useKibana().services; + const [isFormEditing, setIsFormEditing] = useState(false); const { status } = useValues(ConnectorConfigurationApiLogic); const isSyncing = false; @@ -77,6 +80,7 @@ export const ConfigurationStep: React.FC = ({ title, set connectorId: connector.id, }); }} + onEditStateChange={setIsFormEditing} /> {isSyncing && ( @@ -111,7 +115,38 @@ export const ConfigurationStep: React.FC = ({ title, set { + onClick={async () => { + if (isFormEditing) { + const confirmResponse = await overlays?.openConfirm( + i18n.translate('xpack.enterpriseSearch.configureConnector.unsavedPrompt.body', { + defaultMessage: + 'You are still editing connector configuration, are you sure you want to continue without saving? You can complete the setup later in the connector configuration page, but this guided flow offers more help.', + }), + { + title: i18n.translate( + 'xpack.enterpriseSearch.configureConnector.unsavedPrompt.title', + { + defaultMessage: 'Connector configuration is not saved', + } + ), + cancelButtonText: i18n.translate( + 'xpack.enterpriseSearch.configureConnector.unsavedPrompt.cancel', + { + defaultMessage: 'Continue setup', + } + ), + confirmButtonText: i18n.translate( + 'xpack.enterpriseSearch.configureConnector.unsavedPrompt.confirm', + { + defaultMessage: 'Leave the page', + } + ), + } + ); + if (!confirmResponse) { + return; + } + } setFormDirty(false); setCurrentStep('finish'); }} diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/new_search_index_template.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/new_search_index_template.tsx index 25baabb388575..211738b43f25d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/new_search_index_template.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/new_search_index_template.tsx @@ -289,7 +289,7 @@ export const NewSearchIndexTemplate: React.FC = ({ {i18n.translate( 'xpack.enterpriseSearch.content.newIndex.newSearchIndexTemplate.learnMoreCrawler.linkText', { - defaultMessage: 'Learn more about the Elastic web crawler', + defaultMessage: 'Learn more about the Elastic Web Crawler', } )} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/classic_nav_helpers.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/layout/classic_nav_helpers.test.ts index d43d14aba2235..80e846716e59b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/classic_nav_helpers.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/classic_nav_helpers.test.ts @@ -37,7 +37,7 @@ describe('generateSideNavItems', () => { }, 'enterpriseSearchContent:webCrawlers': { id: 'enterpriseSearchContent:webCrawlers', - title: 'Web crawlers', + title: 'Web Crawlers', url: '/app/enterprise_search/content/crawlers', }, } as unknown as Record; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx index a6cbf56691735..fed85bad23353 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx @@ -62,7 +62,7 @@ const baseNavItems = [ href: '/app/enterprise_search/content/crawlers', id: 'crawlers', items: undefined, - name: 'Web crawlers', + name: 'Web Crawlers', }, ], name: 'Content', @@ -184,7 +184,7 @@ const mockNavLinks = [ }, { id: 'enterpriseSearchContent:webCrawlers', - title: 'Web crawlers', + title: 'Web Crawlers', url: '/app/enterprise_search/content/crawlers', }, { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/group_assignment_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/group_assignment_selector.tsx index 5d8ef7ababc8c..f6c88cb7ae6ed 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/group_assignment_selector.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/group_assignment_selector.tsx @@ -9,7 +9,13 @@ import React from 'react'; import { useActions, useValues } from 'kea'; -import { EuiComboBox, EuiFormRow, EuiHorizontalRule, EuiRadioGroup } from '@elastic/eui'; +import { + EuiComboBox, + EuiFormRow, + EuiHorizontalRule, + EuiRadioGroup, + useGeneratedHtmlId, +} from '@elastic/eui'; import { RoleOptionLabel } from '../../../shared/role_mapping'; @@ -31,6 +37,8 @@ export const GroupAssignmentSelector: React.FC = () => { const { includeInAllGroups, availableGroups, selectedGroups, selectedOptions } = useValues(RoleMappingsLogic); + const groupAssigmentLabelId = useGeneratedHtmlId(); + const hasGroupAssignment = selectedGroups.size > 0 || includeInAllGroups; const groupOptions = [ @@ -51,11 +59,12 @@ export const GroupAssignmentSelector: React.FC = () => { handleAllGroupsSelectionChange(id === 'all')} legend={{ - children: {GROUP_ASSIGNMENT_LABEL}, + children: {GROUP_ASSIGNMENT_LABEL}, }} /> @@ -69,6 +78,7 @@ export const GroupAssignmentSelector: React.FC = () => { }} fullWidth isDisabled={includeInAllGroups} + aria-labelledby={groupAssigmentLabelId} /> diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index 4d357956f6bb5..a413ae5f2067d 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -131,7 +131,7 @@ const contentLinks: AppDeepLink[] = [ id: 'webCrawlers', path: `/${CRAWLERS_PATH}`, title: i18n.translate('xpack.enterpriseSearch.navigation.contentWebcrawlersLinkLabel', { - defaultMessage: 'Web crawlers', + defaultMessage: 'Web Crawlers', }), }, ]; diff --git a/x-pack/plugins/entity_manager/server/lib/v2/queries/index.test.ts b/x-pack/plugins/entity_manager/server/lib/v2/queries/index.test.ts index 7485b19a2c7c0..e77be7d4172ca 100644 --- a/x-pack/plugins/entity_manager/server/lib/v2/queries/index.test.ts +++ b/x-pack/plugins/entity_manager/server/lib/v2/queries/index.test.ts @@ -29,9 +29,10 @@ describe('getEntityInstancesQuery', () => { expect(query).toEqual( 'FROM logs-*, metrics-* | ' + - 'WHERE service.name IS NOT NULL | ' + + 'WHERE service.name::keyword IS NOT NULL | ' + 'WHERE custom_timestamp_field >= "2024-11-20T19:00:00.000Z" AND custom_timestamp_field <= "2024-11-20T20:00:00.000Z" | ' + - 'STATS host.name = VALUES(host.name), entity.last_seen_timestamp = MAX(custom_timestamp_field), service.id = MAX(service.id) BY service.name | ' + + 'STATS host.name = VALUES(host.name::keyword), entity.last_seen_timestamp = MAX(custom_timestamp_field), service.id = MAX(service.id::keyword) BY service.name::keyword | ' + + 'RENAME `service.name::keyword` AS service.name | ' + 'EVAL entity.type = "service", entity.id = service.name, entity.display_name = COALESCE(service.id, entity.id) | ' + 'SORT entity.id DESC | ' + 'LIMIT 5' diff --git a/x-pack/plugins/entity_manager/server/lib/v2/queries/index.ts b/x-pack/plugins/entity_manager/server/lib/v2/queries/index.ts index 7926b67849f5d..43c73fe7debad 100644 --- a/x-pack/plugins/entity_manager/server/lib/v2/queries/index.ts +++ b/x-pack/plugins/entity_manager/server/lib/v2/queries/index.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { asKeyword } from './utils'; import { EntitySourceDefinition, SortBy } from '../types'; const sourceCommand = ({ source }: { source: EntitySourceDefinition }) => { @@ -30,7 +31,7 @@ const whereCommand = ({ end: string; }) => { const filters = [ - source.identity_fields.map((field) => `${field} IS NOT NULL`).join(' AND '), + source.identity_fields.map((field) => `${asKeyword(field)} IS NOT NULL`).join(' AND '), ...source.filters, ]; @@ -46,7 +47,7 @@ const whereCommand = ({ const statsCommand = ({ source }: { source: EntitySourceDefinition }) => { const aggs = source.metadata_fields .filter((field) => !source.identity_fields.some((idField) => idField === field)) - .map((field) => `${field} = VALUES(${field})`); + .map((field) => `${field} = VALUES(${asKeyword(field)})`); if (source.timestamp_field) { aggs.push(`entity.last_seen_timestamp = MAX(${source.timestamp_field})`); @@ -55,10 +56,15 @@ const statsCommand = ({ source }: { source: EntitySourceDefinition }) => { if (source.display_name) { // ideally we want the latest value but there's no command yet // so we use MAX for now - aggs.push(`${source.display_name} = MAX(${source.display_name})`); + aggs.push(`${source.display_name} = MAX(${asKeyword(source.display_name)})`); } - return `STATS ${aggs.join(', ')} BY ${source.identity_fields.join(', ')}`; + return `STATS ${aggs.join(', ')} BY ${source.identity_fields.map(asKeyword).join(', ')}`; +}; + +const renameCommand = ({ source }: { source: EntitySourceDefinition }) => { + const operations = source.identity_fields.map((field) => `\`${asKeyword(field)}\` AS ${field}`); + return `RENAME ${operations.join(', ')}`; }; const evalCommand = ({ source }: { source: EntitySourceDefinition }) => { @@ -107,6 +113,7 @@ export function getEntityInstancesQuery({ sourceCommand({ source }), whereCommand({ source, start, end }), statsCommand({ source }), + renameCommand({ source }), evalCommand({ source }), sortCommand({ source, sort }), `LIMIT ${limit}`, diff --git a/x-pack/plugins/entity_manager/server/lib/v2/queries/utils.ts b/x-pack/plugins/entity_manager/server/lib/v2/queries/utils.ts index 1d20d3caea0dc..5d1ebf3001434 100644 --- a/x-pack/plugins/entity_manager/server/lib/v2/queries/utils.ts +++ b/x-pack/plugins/entity_manager/server/lib/v2/queries/utils.ts @@ -65,3 +65,7 @@ export function mergeEntitiesList( return Object.values(instances); } + +export function asKeyword(field: string) { + return `${field}::keyword`; +} diff --git a/x-pack/plugins/fleet/cypress/e2e/space_awareness/policies.cy.ts b/x-pack/plugins/fleet/cypress/e2e/space_awareness/policies.cy.ts index 8975de388248c..010f147882482 100644 --- a/x-pack/plugins/fleet/cypress/e2e/space_awareness/policies.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/space_awareness/policies.cy.ts @@ -28,6 +28,7 @@ describe('Space aware policies creation', { testIsolation: false }, () => { beforeEach(() => { cy.intercept('GET', /\/api\/fleet\/agent_policies/).as('getAgentPolicies'); + cy.intercept('PUT', /\/api\/fleet\/agent_policies\/.*/).as('putAgentPolicy'); cy.intercept('GET', /\/internal\/fleet\/agent_policies_spaces/).as('getAgentPoliciesSpaces'); }); @@ -59,6 +60,7 @@ describe('Space aware policies creation', { testIsolation: false }, () => { cy.getBySel(AGENT_POLICY_DETAILS_PAGE.SPACE_SELECTOR_COMBOBOX).click().type('default{enter}'); cy.getBySel(AGENT_POLICY_DETAILS_PAGE.SAVE_BUTTON).click(); + cy.wait('@putAgentPolicy'); }); it('the policy should be visible in the test space', () => { @@ -72,4 +74,22 @@ describe('Space aware policies creation', { testIsolation: false }, () => { cy.wait('@getAgentPolicies'); cy.getBySel(AGENT_POLICIES_TABLE).contains(POLICY_NAME); }); + + it('should redirect to the agent policies list when removing the current space from a policy', () => { + cy.visit('/s/test/app/fleet/policies'); + cy.getBySel(AGENT_POLICIES_TABLE).contains(POLICY_NAME).click(); + + cy.getBySel(AGENT_POLICY_DETAILS_PAGE.SETTINGS_TAB).click(); + cy.wait('@getAgentPoliciesSpaces'); + + cy.get('[title="Remove Test from selection in this group"]').click(); + + cy.getBySel(AGENT_POLICY_DETAILS_PAGE.SAVE_BUTTON).click(); + cy.wait('@putAgentPolicy'); + + cy.wait('@getAgentPolicies'); + cy.location('pathname').should('eq', '/s/test/app/fleet/policies'); + + cy.getBySel(AGENT_POLICIES_TABLE).contains(NO_AGENT_POLICIES); + }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx index e0ea955cf5afe..50baac84ff4a0 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx @@ -18,9 +18,10 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; +import { useHistory } from 'react-router-dom'; import { useSpaceSettingsContext } from '../../../../../../../hooks/use_space_settings_context'; - import type { AgentPolicy } from '../../../../../types'; import { useStartServices, @@ -30,6 +31,8 @@ import { sendGetAgentStatus, useAgentPolicyRefresh, useBreadcrumbs, + useFleetStatus, + useLink, } from '../../../../../hooks'; import { AgentPolicyForm, @@ -79,14 +82,17 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>( ({ agentPolicy: originalAgentPolicy }) => { useBreadcrumbs('policy_details', { policyName: originalAgentPolicy.name }); const { notifications } = useStartServices(); + const { spaceId } = useFleetStatus(); const { agents: { enabled: isFleetEnabled }, } = useConfig(); + const { getPath } = useLink(); const hasAllAgentPoliciesPrivileges = useAuthz().fleet.allAgentPolicies; const refreshAgentPolicy = useAgentPolicyRefresh(); const [agentPolicy, setAgentPolicy] = useState({ ...originalAgentPolicy, }); + const history = useHistory(); const spaceSettings = useSpaceSettingsContext(); const [isLoading, setIsLoading] = useState(false); @@ -121,8 +127,15 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>( values: { name: agentPolicy.name }, }) ); - refreshAgentPolicy(); - setHasChanges(false); + if ( + agentPolicy.space_ids && + !agentPolicy.space_ids.includes(spaceId ?? DEFAULT_SPACE_ID) + ) { + history.replace(getPath('policies_list')); + } else { + refreshAgentPolicy(); + setHasChanges(false); + } } else { notifications.toasts.addDanger( error diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_item.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_item.tsx index ee83c49744d35..06300480dfa50 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_item.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_item.tsx @@ -18,7 +18,7 @@ import { EuiSpacer, } from '@elastic/eui'; -import type { ActionStatus, AgentPolicy } from '../../../../../types'; +import type { ActionStatus } from '../../../../../types'; import { ViewErrors } from '../view_errors'; @@ -34,8 +34,7 @@ import { ViewAgentsButton } from './view_agents_button'; export const ActivityItem: React.FunctionComponent<{ action: ActionStatus; onClickViewAgents: (action: ActionStatus) => void; - agentPolicies: AgentPolicy[]; -}> = ({ action, onClickViewAgents, agentPolicies }) => { +}> = ({ action, onClickViewAgents }) => { const completeTitle = action.type === 'POLICY_CHANGE' && action.nbAgentsActioned === 0 ? ( @@ -248,11 +247,7 @@ export const ActivityItem: React.FunctionComponent<{ - + ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_section.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_section.tsx index 89067013d6b6b..59db6cea228d4 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_section.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_section.tsx @@ -9,7 +9,7 @@ import type { ReactNode } from 'react'; import React from 'react'; import { EuiText, EuiPanel } from '@elastic/eui'; -import type { ActionStatus, AgentPolicy } from '../../../../../types'; +import type { ActionStatus } from '../../../../../types'; import { UpgradeInProgressActivityItem } from './upgrade_in_progress_activity_item'; import { ActivityItem } from './activity_item'; @@ -19,8 +19,7 @@ export const ActivitySection: React.FunctionComponent<{ actions: ActionStatus[]; abortUpgrade: (action: ActionStatus) => Promise; onClickViewAgents: (action: ActionStatus) => void; - agentPolicies: AgentPolicy[]; -}> = ({ title, actions, abortUpgrade, onClickViewAgents, agentPolicies }) => { +}> = ({ title, actions, abortUpgrade, onClickViewAgents }) => { return ( <> @@ -41,7 +40,6 @@ export const ActivitySection: React.FunctionComponent<{ action={currentAction} key={currentAction.actionId} onClickViewAgents={onClickViewAgents} - agentPolicies={agentPolicies} /> ) )} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/flyout_body.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/flyout_body.tsx index 6880d0bd7747f..280cfa14f4fb6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/flyout_body.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/flyout_body.tsx @@ -17,7 +17,7 @@ import styled from 'styled-components'; import { FormattedDate, FormattedMessage } from '@kbn/i18n-react'; -import type { ActionStatus, AgentPolicy } from '../../../../../types'; +import type { ActionStatus } from '../../../../../types'; import { Loading } from '../../../components'; @@ -51,7 +51,6 @@ export const FlyoutBody: React.FunctionComponent<{ onClickShowMore: () => void; dateFilter: moment.Moment | null; onChangeDateFilter: (date: moment.Moment | null) => void; - agentPolicies: AgentPolicy[]; }> = ({ isFirstLoading, currentActions, @@ -61,7 +60,6 @@ export const FlyoutBody: React.FunctionComponent<{ onClickShowMore, dateFilter, onChangeDateFilter, - agentPolicies, }) => { const scrollToTopRef = React.useRef(null); React.useEffect(() => { @@ -164,7 +162,6 @@ export const FlyoutBody: React.FunctionComponent<{ actions={inProgressActions} abortUpgrade={abortUpgrade} onClickViewAgents={onClickViewAgents} - agentPolicies={agentPolicies} /> ) : null} {todayActions.length > 0 ? ( @@ -178,7 +175,6 @@ export const FlyoutBody: React.FunctionComponent<{ actions={todayActions} abortUpgrade={abortUpgrade} onClickViewAgents={onClickViewAgents} - agentPolicies={agentPolicies} /> ) : null} {Object.keys(otherDays).map((day) => ( @@ -188,7 +184,6 @@ export const FlyoutBody: React.FunctionComponent<{ actions={otherDays[day]} abortUpgrade={abortUpgrade} onClickViewAgents={onClickViewAgents} - agentPolicies={agentPolicies} /> ))} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.test.tsx index c649b3829a41e..10c653336dc57 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.test.tsx @@ -50,7 +50,6 @@ describe('AgentActivityFlyout', () => { refreshAgentActivity={refreshAgentActivity} setSearch={mockSetSearch} setSelectedStatus={mockSetSelectedStatus} - agentPolicies={[]} /> ); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.tsx index e9bfbbef49d91..64ecae7fb1d32 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.tsx @@ -34,8 +34,6 @@ import { getKuery } from '../../utils/get_kuery'; import { AGENT_STATUSES } from '../../../services/agent_status'; -import type { AgentPolicy } from '../../../../../types'; - import { FlyoutBody } from './flyout_body'; const FlyoutFooterWPadding = styled(EuiFlyoutFooter)` @@ -48,15 +46,7 @@ export const AgentActivityFlyout: React.FunctionComponent<{ refreshAgentActivity: boolean; setSearch: (search: string) => void; setSelectedStatus: (status: string[]) => void; - agentPolicies: AgentPolicy[]; -}> = ({ - onClose, - onAbortSuccess, - refreshAgentActivity, - setSearch, - setSelectedStatus, - agentPolicies, -}) => { +}> = ({ onClose, onAbortSuccess, refreshAgentActivity, setSearch, setSelectedStatus }) => { const { notifications } = useStartServices(); const { data: agentPoliciesData } = useGetAgentPolicies({ perPage: SO_SEARCH_LIMIT, @@ -167,7 +157,6 @@ export const AgentActivityFlyout: React.FunctionComponent<{ onClickShowMore={onClickShowMore} dateFilter={dateFilter} onChangeDateFilter={onChangeDateFilter} - agentPolicies={agentPolicies} /> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/view_agents_button.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/view_agents_button.tsx index 01cc7a53929b9..4c7c9c33df749 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/view_agents_button.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/view_agents_button.tsx @@ -9,23 +9,17 @@ import React, { useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiToolTip } from '@elastic/eui'; -import type { ActionStatus, AgentPolicy } from '../../../../../types'; +import type { ActionStatus } from '../../../../../types'; const MAX_VIEW_AGENTS_COUNT = 1000; export const ViewAgentsButton: React.FunctionComponent<{ action: ActionStatus; onClickViewAgents: (action: ActionStatus) => void; - agentPolicies?: AgentPolicy[]; -}> = ({ action, onClickViewAgents, agentPolicies }) => { +}> = ({ action, onClickViewAgents }) => { const isDisabled = useMemo(() => { - if (action.type !== 'POLICY_CHANGE') { - return action.nbAgentsActionCreated > MAX_VIEW_AGENTS_COUNT; - } - - const actionPolicyId = action.actionId.split(':')[0]; - return agentPolicies?.find((agentPolicy) => agentPolicy.id === actionPolicyId)?.agents === 0; - }, [action, agentPolicies]); + return action.nbAgentsActionCreated > MAX_VIEW_AGENTS_COUNT; + }, [action]); if (action.type === 'UPDATE_TAGS') { return null; @@ -46,8 +40,22 @@ export const ViewAgentsButton: React.FunctionComponent<{ ); - if (action.type !== 'POLICY_CHANGE' && !isDisabled) { - return button; + if (isDisabled) { + return ( + + } + > + {button} + + ); } if (action.type === 'POLICY_CHANGE') { @@ -65,19 +73,5 @@ export const ViewAgentsButton: React.FunctionComponent<{ ); } - return ( - - } - > - {button} - - ); + return button; }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx index 47cc796d300c4..e366f6342e1fd 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx @@ -288,7 +288,6 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { refreshAgentActivity={isLoading} setSearch={setSearch} setSelectedStatus={setSelectedStatus} - agentPolicies={allAgentPolicies} /> ) : null} diff --git a/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts b/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts index 6eb42468a6371..ebb5c41d5bb43 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts @@ -46,7 +46,7 @@ export const GetAgentPoliciesRequestSchema = { schema.boolean({ meta: { description: 'use withAgentCount instead', deprecated: true }, }) - ), // + ), withAgentCount: schema.maybe( schema.boolean({ meta: { description: 'get policies with agent count' }, diff --git a/x-pack/plugins/global_search_bar/public/plugin.tsx b/x-pack/plugins/global_search_bar/public/plugin.tsx index e8fbe2f7e2bf1..4ff393b90f044 100644 --- a/x-pack/plugins/global_search_bar/public/plugin.tsx +++ b/x-pack/plugins/global_search_bar/public/plugin.tsx @@ -50,14 +50,14 @@ export class GlobalSearchBarPlugin implements Plugin<{}, {}, {}, GlobalSearchBar private getNavControl(deps: { core: CoreStart } & GlobalSearchBarPluginStartDeps) { const { core, globalSearch, savedObjectsTagging, usageCollection } = deps; - const { application, http, theme, i18n } = core; + const { application, http } = core; const reportEvent = new EventReporter({ analytics: core.analytics, usageCollection }); const navControl: ChromeNavControl = { order: 1000, mount: (container) => { ReactDOM.render( - + = (props) => ( ); -type MountProps = Props & Pick; +type MountProps = Props & Pick; export const mountExpiredBanner = ({ type, uploadUrl, ...startServices }: MountProps) => toMountPoint(, startServices); diff --git a/x-pack/plugins/ml/public/alerting/anomaly_detection_rule/ml_anomaly_alert_trigger.tsx b/x-pack/plugins/ml/public/alerting/anomaly_detection_rule/ml_anomaly_alert_trigger.tsx index 3d70b4bbdc16d..445df758f4c9d 100644 --- a/x-pack/plugins/ml/public/alerting/anomaly_detection_rule/ml_anomaly_alert_trigger.tsx +++ b/x-pack/plugins/ml/public/alerting/anomaly_detection_rule/ml_anomaly_alert_trigger.tsx @@ -226,7 +226,7 @@ const MlAnomalyAlertTrigger: FC = ({ { + onChange={useCallback((update: Partial) => { Object.keys(update).forEach((k) => { setRuleParams(k, update[k as keyof MlAnomalyDetectionAlertAdvancedSettings]); }); diff --git a/x-pack/plugins/ml/public/alerting/job_selector.tsx b/x-pack/plugins/ml/public/alerting/job_selector.tsx index 68bc75e2de2b5..0bee10c0c6a81 100644 --- a/x-pack/plugins/ml/public/alerting/job_selector.tsx +++ b/x-pack/plugins/ml/public/alerting/job_selector.tsx @@ -18,7 +18,7 @@ import type { MlApi } from '../application/services/ml_api_service'; import { ALL_JOBS_SELECTION } from '../../common/constants/alerts'; import { LoadingIndicator } from '../application/components/loading_indicator'; -interface JobSelection { +export interface JobSelection { jobIds?: JobId[]; groupIds?: string[]; } diff --git a/x-pack/plugins/ml/public/alerting/jobs_health_rule/anomaly_detection_jobs_health_rule_trigger.tsx b/x-pack/plugins/ml/public/alerting/jobs_health_rule/anomaly_detection_jobs_health_rule_trigger.tsx index 2b51db2859714..c798cf3911f48 100644 --- a/x-pack/plugins/ml/public/alerting/jobs_health_rule/anomaly_detection_jobs_health_rule_trigger.tsx +++ b/x-pack/plugins/ml/public/alerting/jobs_health_rule/anomaly_detection_jobs_health_rule_trigger.tsx @@ -16,7 +16,7 @@ import type { RuleTypeParamsExpressionProps } from '@kbn/triggers-actions-ui-plu import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { isDefined } from '@kbn/ml-is-defined'; import type { MlAnomalyDetectionJobsHealthRuleParams } from '../../../common/types/alerts'; -import { JobSelectorControl } from '../job_selector'; +import { JobSelectorControl, type JobSelection } from '../job_selector'; import { jobsApiProvider } from '../../application/services/ml_api_service/jobs'; import { HttpService } from '../../application/services/http_service'; import { useMlKibana } from '../../application/contexts/kibana'; @@ -129,7 +129,7 @@ const AnomalyDetectionJobsHealthRuleTrigger: FC = ({ { + onChange={useCallback((update: JobSelection) => { const callback = onAlertParamChange('excludeJobs'); if (isPopulatedObject(update)) { callback(update); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_chart.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_chart.tsx index 2805563eeb7fd..b2532b225db2b 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_chart.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_chart.tsx @@ -122,7 +122,7 @@ export const DecisionPathChart = ({ ); // if regression, guarantee up to num_precision significant digits without having it in scientific notation // if classification, hide the numeric values since we only want to show the path - const tickFormatter = useCallback((d: any) => formatSingleValue(d, '').toString(), []); + const tickFormatter = useCallback((d: number) => formatSingleValue(d, '').toString(), []); return (
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx index 8f192f3919e16..a63f0851a87bf 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx @@ -100,7 +100,7 @@ export const DataFrameAnalyticsList: FC = ({ const searchQueryText = pageState.queryText ?? ''; const setSearchQueryText = useCallback( - (value: any) => { + (value: string) => { updatePageState({ queryText: value }); }, [updatePageState] diff --git a/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts b/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts index 41a3da0586e02..19bf333e0d2bd 100644 --- a/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts +++ b/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts @@ -236,7 +236,7 @@ export const useExplorerData = (): [Partial | undefined, (d: any) const explorerData$ = useMemo(() => loadExplorerData$.pipe(switchMap(loadExplorerData)), []); const explorerData = useObservable(explorerData$); - const update = useCallback((c: any) => { + const update = useCallback((c: LoadExplorerDataConfig) => { loadExplorerData$.next(c); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx index ae12b8b1fa4ac..b64afb345f5bc 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx @@ -465,7 +465,7 @@ export const AnomalyTimeline: FC = React.memo( { + onChange={useCallback((update: number | undefined) => { setSeverityUpdate(update); }, [])} /> diff --git a/x-pack/plugins/ml/public/application/explorer/explorer.tsx b/x-pack/plugins/ml/public/application/explorer/explorer.tsx index ab503c11d7955..ba95fc6671bcb 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer.tsx +++ b/x-pack/plugins/ml/public/application/explorer/explorer.tsx @@ -232,7 +232,7 @@ export const Explorer: FC = ({ ); const onPanelWidthChange = useCallback( - (newSizes: any) => { + (newSizes: { [key: string]: number }) => { setAnomalyExplorerPanelState({ mainPage: { size: newSizes.mainPage, diff --git a/x-pack/plugins/observability_solution/apm/common/alerting/config/apm_alerting_feature_ids.ts b/x-pack/plugins/observability_solution/apm/common/alerting/config/apm_alerting_feature_ids.ts index 784ab0b534256..ff6e86a9f79bc 100644 --- a/x-pack/plugins/observability_solution/apm/common/alerting/config/apm_alerting_feature_ids.ts +++ b/x-pack/plugins/observability_solution/apm/common/alerting/config/apm_alerting_feature_ids.ts @@ -11,7 +11,7 @@ import { type ValidFeatureId, } from '@kbn/rule-data-utils'; -export const apmAlertingConsumers: ValidFeatureId[] = [ +export const APM_ALERTING_CONSUMERS: ValidFeatureId[] = [ AlertConsumers.LOGS, AlertConsumers.APM, AlertConsumers.SLO, @@ -20,4 +20,4 @@ export const apmAlertingConsumers: ValidFeatureId[] = [ AlertConsumers.ALERTS, ]; -export const apmAlertingRuleTypeIds: string[] = [...OBSERVABILITY_RULE_TYPE_IDS]; +export const APM_ALERTING_RULE_TYPE_IDS: string[] = [...OBSERVABILITY_RULE_TYPE_IDS]; diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/apm_rule_unified_search_bar.tsx b/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/apm_rule_unified_search_bar.tsx index d91807ec08462..393492cfae9a0 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/apm_rule_unified_search_bar.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/apm_rule_unified_search_bar.tsx @@ -6,7 +6,8 @@ */ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { Query } from '@kbn/es-query'; +import { EuiFormErrorText } from '@elastic/eui'; +import { Query, fromKueryExpression } from '@kbn/es-query'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { ApmPluginStartDeps } from '../../../plugin'; import { useAdHocApmDataView } from '../../../hooks/use_adhoc_apm_data_view'; @@ -26,7 +27,7 @@ export function ApmRuleUnifiedSearchBar({ setRuleParams: (key: string, value: any) => void; }) { const { services } = useKibana(); - + const [queryError, setQueryError] = React.useState(); const { unifiedSearch: { ui: { SearchBar }, @@ -38,27 +39,38 @@ export function ApmRuleUnifiedSearchBar({ const handleSubmit = (payload: { query?: Query }) => { const { query } = payload; - setRuleParams('searchConfiguration', { query }); + try { + setQueryError(undefined); + fromKueryExpression(query?.query as string); + setRuleParams('searchConfiguration', { query }); + } catch (e) { + setQueryError(e.message); + } }; return ( - + <> + + {queryError && ( + {queryError} + )} + ); } diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/alerts_overview/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/alerts_overview/index.tsx index 682634819e623..a14731db9efac 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/alerts_overview/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/alerts_overview/index.tsx @@ -14,8 +14,8 @@ import { BoolQuery } from '@kbn/es-query'; import { AlertConsumers } from '@kbn/rule-data-utils'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { - apmAlertingConsumers, - apmAlertingRuleTypeIds, + APM_ALERTING_CONSUMERS, + APM_ALERTING_RULE_TYPE_IDS, } from '../../../../common/alerting/config/apm_alerting_feature_ids'; import { ApmPluginStartDeps } from '../../../plugin'; import { useAnyOfApmParams } from '../../../hooks/use_apm_params'; @@ -111,8 +111,8 @@ export function AlertsOverview() { alertsTableConfigurationRegistry={alertsTableConfigurationRegistry} id={'service-overview-alerts'} configurationId={AlertConsumers.OBSERVABILITY} - ruleTypeIds={apmAlertingRuleTypeIds} - consumers={apmAlertingConsumers} + ruleTypeIds={APM_ALERTING_RULE_TYPE_IDS} + consumers={APM_ALERTING_CONSUMERS} query={esQuery} showAlertStatusWithFlapping cellContext={{ observabilityRuleTypeRegistry }} diff --git a/x-pack/plugins/observability_solution/apm/server/lib/helpers/get_apm_alerts_client.ts b/x-pack/plugins/observability_solution/apm/server/lib/helpers/get_apm_alerts_client.ts index 95c29472dbc79..fb519e2ef859f 100644 --- a/x-pack/plugins/observability_solution/apm/server/lib/helpers/get_apm_alerts_client.ts +++ b/x-pack/plugins/observability_solution/apm/server/lib/helpers/get_apm_alerts_client.ts @@ -12,7 +12,7 @@ import { DataTier } from '@kbn/observability-shared-plugin/common'; import { searchExcludedDataTiers } from '@kbn/observability-plugin/common/ui_settings_keys'; import { estypes } from '@elastic/elasticsearch'; import { getDataTierFilterCombined } from '@kbn/apm-data-access-plugin/server/utils'; -import { apmAlertingRuleTypeIds } from '../../../common/alerting/config/apm_alerting_feature_ids'; +import { APM_ALERTING_RULE_TYPE_IDS } from '../../../common/alerting/config/apm_alerting_feature_ids'; import type { MinimalAPMRouteHandlerResources } from '../../routes/apm_routes/register_apm_server_routes'; export type ApmAlertsClient = Awaited>; @@ -32,7 +32,9 @@ export async function getApmAlertsClient({ const ruleRegistryPluginStart = await plugins.ruleRegistry.start(); const alertsClient = await ruleRegistryPluginStart.getRacClientWithRequest(request); - const apmAlertsIndices = await alertsClient.getAuthorizedAlertsIndices(apmAlertingRuleTypeIds); + const apmAlertsIndices = await alertsClient.getAuthorizedAlertsIndices( + APM_ALERTING_RULE_TYPE_IDS + ); if (!apmAlertsIndices || isEmpty(apmAlertsIndices)) { throw Error('No alert indices exist for "apm"'); diff --git a/x-pack/plugins/observability_solution/apm/server/routes/services/get_services/get_service_alerts.ts b/x-pack/plugins/observability_solution/apm/server/routes/services/get_services/get_service_alerts.ts index 01a125f456443..c47668bc1ee32 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/services/get_services/get_service_alerts.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/services/get_services/get_service_alerts.ts @@ -18,7 +18,7 @@ import { ALERT_STATUS_ACTIVE, ALERT_UUID, } from '@kbn/rule-data-utils'; -import { observabilityFeatureId } from '@kbn/observability-shared-plugin/common'; +import { APM_ALERTING_CONSUMERS } from '../../../../common/alerting/config/apm_alerting_feature_ids'; import { SERVICE_NAME } from '../../../../common/es_fields/apm'; import { ServiceGroup } from '../../../../common/service_groups'; import { ApmAlertsClient } from '../../../lib/helpers/get_apm_alerts_client'; @@ -58,7 +58,7 @@ export async function getServicesAlerts({ query: { bool: { filter: [ - ...termsQuery(ALERT_RULE_PRODUCER, 'apm', observabilityFeatureId), + ...termsQuery(ALERT_RULE_PRODUCER, ...APM_ALERTING_CONSUMERS), ...termQuery(ALERT_STATUS, ALERT_STATUS_ACTIVE), ...rangeQuery(start, end), ...kqlQuery(kuery), diff --git a/x-pack/plugins/observability_solution/apm/server/routes/transactions/breakdown/index.ts b/x-pack/plugins/observability_solution/apm/server/routes/transactions/breakdown/index.ts index 73da84fe4e98e..a57d437b242aa 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/transactions/breakdown/index.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/transactions/breakdown/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { flatten, orderBy, last } from 'lodash'; +import { flatten, orderBy, last, clamp, round } from 'lodash'; import { rangeQuery, kqlQuery } from '@kbn/observability-plugin/server'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { asPercent } from '../../../../common/utils/formatters'; @@ -145,9 +145,15 @@ export async function getTransactionBreakdown({ const type = bucket.key as string; return bucket.subtypes.buckets.map((subBucket) => { + const percentageRaw = + (subBucket.total_self_time_per_subtype.value || 0) / sumAllSelfTimes; + // limit percentage from 0% to 100% and + // round to 8 decimal points (results in 6 decimal points after converting to percentages) to prevent displaying scientific notation in charts + const percentage = round(clamp(percentageRaw, 0, 1), 8); + return { name: (subBucket.key as string) || type, - percentage: (subBucket.total_self_time_per_subtype.value || 0) / sumAllSelfTimes, + percentage, }; }); }) diff --git a/x-pack/plugins/observability_solution/logs_explorer/common/ui_settings.ts b/x-pack/plugins/observability_solution/logs_explorer/common/ui_settings.ts index 65983c3993488..cc9f7f76a3765 100644 --- a/x-pack/plugins/observability_solution/logs_explorer/common/ui_settings.ts +++ b/x-pack/plugins/observability_solution/logs_explorer/common/ui_settings.ts @@ -25,6 +25,13 @@ export const uiSettings: Record = { defaultMessage: 'A list of base patterns to match and explore data views in Logs Explorer. Remote clusters will be automatically matched for the provided base patterns.', }), + deprecation: { + message: i18n.translate('xpack.logsExplorer.allowedDataViewsDeprecationWarning', { + defaultMessage: + 'Logs Explorer is deprecated, and this setting will be removed in Kibana 9.0.', + }), + docLinksKey: 'generalSettings', + }, type: 'array', schema: schema.arrayOf(schema.string()), requiresPageReload: true, diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/index.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/index.tsx index b6095ac595cea..fd198c42fda08 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/index.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/index.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useRef, useState } from 'react'; import { AssistantAvatar, useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; -import { EuiButton, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; +import { EuiButton, EuiButtonEmpty, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; import { css } from '@emotion/react'; import { v4 } from 'uuid'; import useObservable from 'react-use/lib/useObservable'; @@ -24,12 +24,14 @@ interface NavControlWithProviderDeps { appService: AIAssistantAppService; coreStart: CoreStart; pluginsStart: ObservabilityAIAssistantAppPluginStartDependencies; + isServerless?: boolean; } export const NavControlWithProvider = ({ appService, coreStart, pluginsStart, + isServerless, }: NavControlWithProviderDeps) => { return ( - + ); }; -export function NavControl() { +export function NavControl({ isServerless }: { isServerless?: boolean }) { const service = useAIAssistantAppService(); const { @@ -140,22 +142,41 @@ export function NavControl() { return ( <> - { - service.conversations.openNewConversation({ - messages: [], - }); - }} - color="primary" - size="s" - fullWidth={false} - minWidth={0} - > - {chatService.loading ? : } - + {isServerless ? ( + { + service.conversations.openNewConversation({ + messages: [], + }); + }} + color="primary" + size="s" + > + {chatService.loading ? : } + + ) : ( + { + service.conversations.openNewConversation({ + messages: [], + }); + }} + color="primary" + size="s" + fullWidth={false} + minWidth={0} + > + {chatService.loading ? : } + + )} {chatService.value ? ( diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/lazy_nav_control.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/lazy_nav_control.tsx index adef91ceea53e..9a6fd2f30d918 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/lazy_nav_control.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/lazy_nav_control.tsx @@ -20,12 +20,14 @@ interface NavControlInitiatorProps { appService: AIAssistantAppService; coreStart: CoreStart; pluginsStart: ObservabilityAIAssistantAppPluginStartDependencies; + isServerless?: boolean; } export const NavControlInitiator = ({ appService, coreStart, pluginsStart, + isServerless, }: NavControlInitiatorProps) => { const { isVisible } = useIsNavControlVisible({ coreStart, pluginsStart }); @@ -38,6 +40,7 @@ export const NavControlInitiator = ({ appService={appService} coreStart={coreStart} pluginsStart={pluginsStart} + isServerless={isServerless} /> ); }; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/plugin.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/plugin.tsx index 1904eebffb2a8..cd1285b0017ce 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/plugin.tsx @@ -41,10 +41,13 @@ export class ObservabilityAIAssistantAppPlugin { logger: Logger; appService: AIAssistantAppService | undefined; + isServerless: boolean; constructor(context: PluginInitializerContext) { this.logger = context.logger.get(); + this.isServerless = context.env.packageInfo.buildFlavor === 'serverless'; } + setup( coreSetup: CoreSetup, _: ObservabilityAIAssistantAppPluginSetupDependencies @@ -111,6 +114,7 @@ export class ObservabilityAIAssistantAppPlugin appService={appService} coreStart={coreStart} pluginsStart={pluginsStart} + isServerless={this.isServerless} />, element, () => {} diff --git a/x-pack/plugins/reporting/public/plugin.ts b/x-pack/plugins/reporting/public/plugin.ts index 8dc9e2d96f717..d1c0db9cca577 100644 --- a/x-pack/plugins/reporting/public/plugin.ts +++ b/x-pack/plugins/reporting/public/plugin.ts @@ -110,15 +110,16 @@ export class ReportingPublicPlugin } = setupDeps; const startServices$: Observable = from(getStartServices()).pipe( - map(([services, ...rest]) => { + map(([start, ...rest]) => { return [ { - application: services.application, - analytics: services.analytics, - i18n: services.i18n, - theme: services.theme, - notifications: services.notifications, - uiSettings: services.uiSettings, + application: start.application, + analytics: start.analytics, + i18n: start.i18n, + theme: start.theme, + userProfile: start.userProfile, + notifications: start.notifications, + uiSettings: start.uiSettings, }, ...rest, ]; diff --git a/x-pack/plugins/reporting/public/types.ts b/x-pack/plugins/reporting/public/types.ts index 9ba50435471ab..c4b9b5e931c53 100644 --- a/x-pack/plugins/reporting/public/types.ts +++ b/x-pack/plugins/reporting/public/types.ts @@ -20,6 +20,7 @@ export type StartServices = [ | 'analytics' | 'i18n' | 'theme' + | 'userProfile' // used extensively in Reporting plugin | 'application' | 'notifications' diff --git a/x-pack/plugins/saved_objects_tagging/public/types.ts b/x-pack/plugins/saved_objects_tagging/public/types.ts index ed29542e4d410..7211dd205c53b 100644 --- a/x-pack/plugins/saved_objects_tagging/public/types.ts +++ b/x-pack/plugins/saved_objects_tagging/public/types.ts @@ -12,5 +12,5 @@ export type SavedObjectTaggingPluginStart = SavedObjectsTaggingApi; export type StartServices = Pick< CoreStart, - 'overlays' | 'notifications' | 'analytics' | 'i18n' | 'theme' + 'overlays' | 'notifications' | 'analytics' | 'i18n' | 'theme' | 'userProfile' >; diff --git a/x-pack/plugins/search_solution/search_navigation/public/classic_navigation.test.ts b/x-pack/plugins/search_solution/search_navigation/public/classic_navigation.test.ts index 1b17296f54c73..45c6e4c02ace4 100644 --- a/x-pack/plugins/search_solution/search_navigation/public/classic_navigation.test.ts +++ b/x-pack/plugins/search_solution/search_navigation/public/classic_navigation.test.ts @@ -30,7 +30,7 @@ describe('classicNavigationFactory', function () { }, { id: 'enterpriseSearchContent:webCrawlers', - title: 'Web crawlers', + title: 'Web Crawlers', url: '/app/enterprise_search/content/crawlers', }, ]; diff --git a/x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts b/x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts index 994fb70deaa25..0ef67f164409b 100644 --- a/x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts +++ b/x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts @@ -356,6 +356,7 @@ import type { ResolveTimelineResponse, } from './timeline/resolve_timeline/resolve_timeline_route.gen'; import type { + CreateRuleMigrationRequestParamsInput, CreateRuleMigrationRequestBodyInput, CreateRuleMigrationResponse, GetAllStatsRuleMigrationResponse, @@ -686,7 +687,7 @@ If a record already exists for the specified entity, that record is overwritten this.log.info(`${new Date().toISOString()} Calling API CreateRuleMigration`); return this.kbnClient .request({ - path: '/internal/siem_migrations/rules', + path: replaceParams('/internal/siem_migrations/rules/{migration_id}', props.params), headers: { [ELASTIC_HTTP_VERSION_HEADER]: '1', }, @@ -2267,6 +2268,7 @@ export interface CreateRuleProps { body: CreateRuleRequestBodyInput; } export interface CreateRuleMigrationProps { + params: CreateRuleMigrationRequestParamsInput; body: CreateRuleMigrationRequestBodyInput; } export interface CreateTimelinesProps { diff --git a/x-pack/plugins/security_solution/common/siem_migrations/constants.ts b/x-pack/plugins/security_solution/common/siem_migrations/constants.ts index 789947150a67e..e04130e7f44d7 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/constants.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/constants.ts @@ -11,6 +11,8 @@ export const SIEM_MIGRATIONS_PATH = '/internal/siem_migrations' as const; export const SIEM_RULE_MIGRATIONS_PATH = `${SIEM_MIGRATIONS_PATH}/rules` as const; export const SIEM_RULE_MIGRATIONS_ALL_STATS_PATH = `${SIEM_RULE_MIGRATIONS_PATH}/stats` as const; +export const SIEM_RULE_MIGRATION_CREATE_PATH = + `${SIEM_RULE_MIGRATIONS_PATH}/{migration_id?}` as const; export const SIEM_RULE_MIGRATION_PATH = `${SIEM_RULE_MIGRATIONS_PATH}/{migration_id}` as const; export const SIEM_RULE_MIGRATION_START_PATH = `${SIEM_RULE_MIGRATION_PATH}/start` as const; export const SIEM_RULE_MIGRATION_RETRY_PATH = `${SIEM_RULE_MIGRATION_PATH}/retry` as const; diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts b/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts index aa69f3b3c27f0..8a549e8e11817 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts @@ -17,19 +17,28 @@ import { z } from '@kbn/zod'; import { ArrayFromString } from '@kbn/zod-helpers'; +import { NonEmptyString } from '../../../../api/model/primitives.gen'; import { - OriginalRule, ElasticRulePartial, RuleMigrationTranslationResult, RuleMigrationComments, RuleMigrationTaskStats, + OriginalRule, RuleMigration, RuleMigrationTranslationStats, RuleMigrationResourceData, RuleMigrationResourceType, RuleMigrationResource, } from '../../rule_migration.gen'; -import { NonEmptyString, ConnectorId, LangSmithOptions } from '../../common.gen'; +import { ConnectorId, LangSmithOptions } from '../../common.gen'; + +export type CreateRuleMigrationRequestParams = z.infer; +export const CreateRuleMigrationRequestParams = z.object({ + migration_id: NonEmptyString.optional(), +}); +export type CreateRuleMigrationRequestParamsInput = z.input< + typeof CreateRuleMigrationRequestParams +>; export type CreateRuleMigrationRequestBody = z.infer; export const CreateRuleMigrationRequestBody = z.array(OriginalRule); diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml b/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml index a062b75d41699..8b9d264cf4104 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml @@ -4,38 +4,7 @@ info: version: '1' paths: # Rule migrations APIs - /internal/siem_migrations/rules: - post: - summary: Creates a new rule migration - operationId: CreateRuleMigration - x-codegen-enabled: true - x-internal: true - description: Creates a new SIEM rules migration using the original vendor rules provided - tags: - - SIEM Rule Migrations - requestBody: - required: true - content: - application/json: - schema: - type: array - items: - $ref: '../../rule_migration.schema.yaml#/components/schemas/OriginalRule' - responses: - 200: - description: Indicates migration have been created correctly. - content: - application/json: - schema: - type: object - required: - - migration_id - properties: - migration_id: - description: The migration id created. - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' - put: summary: Updates rules migrations operationId: UpdateRuleMigration @@ -57,7 +26,7 @@ paths: properties: id: description: The rule migration id - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' elastic_rule: description: The migrated elastic rule attributes to update. $ref: '../../rule_migration.schema.yaml#/components/schemas/ElasticRulePartial' @@ -81,95 +50,64 @@ paths: type: boolean description: Indicates rules migrations have been updated. - /internal/siem_migrations/rules/{migration_id}/install: - post: - summary: Installs translated migration rules - operationId: InstallMigrationRules + /internal/siem_migrations/rules/stats: + get: + summary: Retrieves the stats for all rule migrations + operationId: GetAllStatsRuleMigration x-codegen-enabled: true - description: Installs migration rules + x-internal: true + description: Retrieves the rule migrations stats for all migrations stored in the system tags: - SIEM Rule Migrations - parameters: - - name: migration_id - in: path - required: true - schema: - description: The migration id to isnstall rules for - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' - requestBody: - required: true - content: - application/json: - schema: - type: array - items: - description: The rule migration id - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' responses: 200: - description: Indicates rules migrations have been installed correctly. + description: Indicates rule migrations have been retrieved correctly. content: application/json: schema: - type: object - required: - - installed - properties: - installed: - type: boolean - description: Indicates rules migrations have been installed. + type: array + items: + $ref: '../../rule_migration.schema.yaml#/components/schemas/RuleMigrationTaskStats' - /internal/siem_migrations/rules/{migration_id}/install_translated: + ## Specific rule migration APIs + + /internal/siem_migrations/rules/{migration_id}: post: - summary: Installs all translated migration rules - operationId: InstallTranslatedMigrationRules + summary: Creates a new rule migration + operationId: CreateRuleMigration x-codegen-enabled: true - description: Installs all translated migration rules + x-internal: true + description: Creates a new SIEM rules migration using the original vendor rules provided tags: - SIEM Rule Migrations parameters: - name: migration_id in: path - required: true + required: false schema: - description: The migration id to install translated rules for - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' + description: The migration id to create rules for + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '../../rule_migration.schema.yaml#/components/schemas/OriginalRule' responses: 200: - description: Indicates rules migrations have been installed correctly. + description: Indicates migration have been created correctly. content: application/json: schema: type: object required: - - installed + - migration_id properties: - installed: - type: boolean - description: Indicates rules migrations have been installed. - - /internal/siem_migrations/rules/stats: - get: - summary: Retrieves the stats for all rule migrations - operationId: GetAllStatsRuleMigration - x-codegen-enabled: true - x-internal: true - description: Retrieves the rule migrations stats for all migrations stored in the system - tags: - - SIEM Rule Migrations - responses: - 200: - description: Indicates rule migrations have been retrieved correctly. - content: - application/json: - schema: - type: array - items: - $ref: '../../rule_migration.schema.yaml#/components/schemas/RuleMigrationTaskStats' - - ## Specific rule migration APIs - - /internal/siem_migrations/rules/{migration_id}: + migration_id: + description: The migration id created. + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' get: summary: Retrieves all the rules of a migration operationId: GetRuleMigration @@ -184,7 +122,7 @@ paths: required: true schema: description: The migration id to start - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' - name: page in: query required: false @@ -222,6 +160,73 @@ paths: 204: description: Indicates the migration id was not found. + /internal/siem_migrations/rules/{migration_id}/install: + post: + summary: Installs translated migration rules + operationId: InstallMigrationRules + x-codegen-enabled: true + description: Installs migration rules + tags: + - SIEM Rule Migrations + parameters: + - name: migration_id + in: path + required: true + schema: + description: The migration id to install rules for + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + description: The rule migration id + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' + responses: + 200: + description: Indicates rules migrations have been installed correctly. + content: + application/json: + schema: + type: object + required: + - installed + properties: + installed: + type: boolean + description: Indicates rules migrations have been installed. + + /internal/siem_migrations/rules/{migration_id}/install_translated: + post: + summary: Installs all translated migration rules + operationId: InstallTranslatedMigrationRules + x-codegen-enabled: true + description: Installs all translated migration rules + tags: + - SIEM Rule Migrations + parameters: + - name: migration_id + in: path + required: true + schema: + description: The migration id to install translated rules for + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' + responses: + 200: + description: Indicates rules migrations have been installed correctly. + content: + application/json: + schema: + type: object + required: + - installed + properties: + installed: + type: boolean + description: Indicates rules migrations have been installed. + /internal/siem_migrations/rules/{migration_id}/start: put: summary: Starts a rule migration @@ -237,7 +242,7 @@ paths: required: true schema: description: The migration id to start - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' requestBody: required: true content: @@ -282,7 +287,7 @@ paths: required: true schema: description: The migration id to fetch stats for - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' responses: 200: description: Indicates the migration stats has been retrieved correctly. @@ -307,7 +312,7 @@ paths: required: true schema: description: The migration id to fetch translation stats for - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' responses: 200: description: Indicates the migration stats has been retrieved correctly. @@ -333,7 +338,7 @@ paths: required: true schema: description: The migration id to stop - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' responses: 200: description: Indicates migration task stop has been processed successfully. @@ -368,7 +373,7 @@ paths: required: true schema: description: The migration id to attach the resources - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' requestBody: required: true content: @@ -406,7 +411,7 @@ paths: required: true schema: description: The migration id to attach the resources - $ref: '../../common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' - name: type in: query required: false diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts b/x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts index 9b1d0756c3a3b..c6d0959cc10cf 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts @@ -16,15 +16,6 @@ import { z } from '@kbn/zod'; -/** - * A string that is not empty and does not contain only whitespace - */ -export type NonEmptyString = z.infer; -export const NonEmptyString = z - .string() - .min(1) - .regex(/^(?! *$).+$/); - /** * The GenAI connector id to use. */ diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml b/x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml index a50225df778ad..14a5160427f8a 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml @@ -6,11 +6,6 @@ paths: {} components: x-codegen-enabled: true schemas: - NonEmptyString: - type: string - pattern: ^(?! *$).+$ - minLength: 1 - description: A string that is not empty and does not contain only whitespace ConnectorId: type: string description: The GenAI connector id to use. diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts b/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts index 61706077d9549..b52cdb1c91f19 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts @@ -16,7 +16,7 @@ import { z } from '@kbn/zod'; -import { NonEmptyString } from './common.gen'; +import { NonEmptyString } from '../../api/model/primitives.gen'; /** * The original rule vendor identifier. @@ -24,6 +24,19 @@ import { NonEmptyString } from './common.gen'; export type OriginalRuleVendor = z.infer; export const OriginalRuleVendor = z.literal('splunk'); +/** + * The original rule annotations containing additional information. + */ +export type OriginalRuleAnnotations = z.infer; +export const OriginalRuleAnnotations = z + .object({ + /** + * The original rule Mitre Attack IDs. + */ + mitre_attack: z.array(z.string()).optional(), + }) + .catchall(z.unknown()); + /** * The original rule to migrate. */ @@ -40,7 +53,7 @@ export const OriginalRule = z.object({ /** * The original rule name. */ - title: z.string(), + title: NonEmptyString, /** * The original rule description. */ @@ -48,15 +61,15 @@ export const OriginalRule = z.object({ /** * The original rule query. */ - query: z.string(), + query: z.string().min(1), /** * The original rule query language. */ query_language: z.string(), /** - * The original rule Mitre Attack technique IDs. + * The original rule annotations containing additional information. */ - mitre_attack_ids: z.array(z.string()).optional(), + annotations: OriginalRuleAnnotations.optional(), }); /** diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml b/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml index fdcbb7b04515a..4c88c66fc604d 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml @@ -12,6 +12,17 @@ components: enum: - splunk + OriginalRuleAnnotations: + type: object + description: The original rule annotations containing additional information. + additionalProperties: true + properties: + mitre_attack: + type: array + description: The original rule Mitre Attack IDs. + items: + type: string + OriginalRule: type: object description: The original rule to migrate. @@ -25,27 +36,26 @@ components: properties: id: description: The original rule id. - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' vendor: description: The original rule vendor identifier. $ref: '#/components/schemas/OriginalRuleVendor' title: - type: string description: The original rule name. + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' description: type: string description: The original rule description. query: type: string + minLength: 1 description: The original rule query. query_language: type: string description: The original rule query language. - mitre_attack_ids: - type: array - items: - type: string - description: The original rule Mitre Attack technique IDs. + annotations: + description: The original rule annotations containing additional information. + $ref: '#/components/schemas/OriginalRuleAnnotations' ElasticRule: type: object @@ -72,7 +82,7 @@ components: - esql prebuilt_rule_id: description: The Elastic prebuilt rule id matched. - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' integration_ids: type: array items: @@ -80,7 +90,7 @@ components: description: The Elastic integration IDs related to the rule. id: description: The Elastic rule id installed as a result. - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' ElasticRulePartial: description: The partial version of the migrated elastic rule. @@ -96,7 +106,7 @@ components: properties: id: description: The rule migration id - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' - $ref: '#/components/schemas/RuleMigrationData' RuleMigrationData: @@ -114,10 +124,10 @@ components: description: The moment of creation migration_id: description: The migration id. - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' created_by: description: The username of the user who created the migration. - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' original_rule: description: The original rule to migrate. $ref: '#/components/schemas/OriginalRule' @@ -153,7 +163,7 @@ components: properties: id: description: The migration id - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' status: description: Indicates if the migration task status. $ref: '#/components/schemas/RuleMigrationTaskStatus' @@ -207,7 +217,7 @@ components: properties: id: description: The migration id - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' rules: type: object description: The rules migration translation stats. @@ -293,10 +303,10 @@ components: properties: id: description: The rule resource migration id - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' migration_id: description: The migration id - $ref: './common.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' updated_at: type: string description: The moment of the last update diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.tsx b/x-pack/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.tsx index 8edd0b7981936..8592ed61abe33 100644 --- a/x-pack/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.tsx +++ b/x-pack/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.tsx @@ -93,7 +93,7 @@ export const AlertsPreview = ({ const { goToEntityInsightTab } = useNavigateEntityInsight({ field, value, - queryIdExtension: 'ALERTS_PREVIEW', + queryIdExtension: isPreviewMode ? 'ALERTS_PREVIEW_TRUE' : 'ALERTS_PREVIEW_FALSE', subTab: CspInsightLeftPanelSubTab.ALERTS, }); const link = useMemo( diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts index 7d8f42adad31b..376b26684d4a5 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts @@ -101,6 +101,7 @@ export const useBulkActionMutation = ( invalidateFetchRuleByIdQuery(); invalidateFetchRuleManagementFilters(); invalidateFetchCoverageOverviewQuery(); + invalidateFetchPrebuiltRulesUpgradeReviewQuery(); break; } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts index 5eedf122a6ac6..812b97b669378 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts @@ -17,6 +17,7 @@ import { useInvalidateFindRulesQuery } from './use_find_rules_query'; import { useUpdateRuleByIdCache } from './use_fetch_rule_by_id_query'; import { useInvalidateFetchRuleManagementFiltersQuery } from './use_fetch_rule_management_filters_query'; import { useInvalidateFetchCoverageOverviewQuery } from './use_fetch_coverage_overview_query'; +import { useInvalidateFetchPrebuiltRulesUpgradeReviewQuery } from './prebuilt_rules/use_fetch_prebuilt_rules_upgrade_review_query'; export const UPDATE_RULE_MUTATION_KEY = ['PUT', DETECTION_ENGINE_RULES_URL]; @@ -26,6 +27,7 @@ export const useUpdateRuleMutation = ( const invalidateFindRulesQuery = useInvalidateFindRulesQuery(); const invalidateFetchRuleManagementFilters = useInvalidateFetchRuleManagementFiltersQuery(); const invalidateFetchCoverageOverviewQuery = useInvalidateFetchCoverageOverviewQuery(); + const invalidatePrebuiltRulesUpdateReview = useInvalidateFetchPrebuiltRulesUpgradeReviewQuery(); const updateRuleCache = useUpdateRuleByIdCache(); return useMutation( @@ -37,6 +39,7 @@ export const useUpdateRuleMutation = ( invalidateFindRulesQuery(); invalidateFetchRuleManagementFilters(); invalidateFetchCoverageOverviewQuery(); + invalidatePrebuiltRulesUpdateReview(); const [response] = args; diff --git a/x-pack/plugins/security_solution/public/management/cypress/common/constants.ts b/x-pack/plugins/security_solution/public/management/cypress/common/constants.ts index 41f08f438e3f8..0266914a17182 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/common/constants.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/common/constants.ts @@ -18,4 +18,5 @@ export const KIBANA_KNOWN_DEFAULT_ACCOUNTS = { elastic: 'elastic', elastic_serverless: 'elastic_serverless', system_indices_superuser: 'system_indices_superuser', + admin: 'admin', } as const; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac.cy.ts index b108cb8985b80..2c5ea11329f31 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac.cy.ts @@ -5,12 +5,17 @@ * 2.0. */ +import { + expandEndpointSecurityFeaturePrivileges, + expandSecuritySolutionCategoryKibanaPrivileges, + navigateToRolePage, + openKibanaFeaturePrivilegesFlyout, + setKibanaPrivilegeSpace, +} from '../../screens/stack_management/role_page'; import { closeAllToasts } from '../../tasks/toasts'; import { login, ROLE } from '../../tasks/login'; -import { loadPage } from '../../tasks/common'; -// FLAKY: https://github.com/elastic/kibana/issues/200967 -describe.skip('When defining a kibana role for Endpoint security access', { tags: '@ess' }, () => { +describe('When defining a kibana role for Endpoint security access', { tags: '@ess' }, () => { const getAllSubFeatureRows = (): Cypress.Chainable> => { return cy .get('#featurePrivilegeControls_siem') @@ -20,11 +25,13 @@ describe.skip('When defining a kibana role for Endpoint security access', { tags beforeEach(() => { login(ROLE.system_indices_superuser); - loadPage('/app/management/security/roles/edit'); + navigateToRolePage(); closeAllToasts(); - cy.getByTestSubj('addSpacePrivilegeButton').click(); - cy.getByTestSubj('featureCategoryButton_securitySolution').closest('button').click(); - cy.get('.featurePrivilegeName:contains("Security")').closest('button').click(); + + openKibanaFeaturePrivilegesFlyout(); + setKibanaPrivilegeSpace('default'); + expandSecuritySolutionCategoryKibanaPrivileges(); + expandEndpointSecurityFeaturePrivileges(); }); it('should display RBAC entries with expected controls', () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac_with_space_awareness.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac_with_space_awareness.cy.ts index d2a86e7899aee..41f6613be88be 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac_with_space_awareness.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac_with_space_awareness.cy.ts @@ -23,11 +23,10 @@ import { setSecuritySolutionEndpointGroupPrivilege, } from '../../screens/stack_management/role_page'; -// Failing: See https://github.com/elastic/kibana/issues/200962 -describe.skip( +describe( 'When defining a kibana role for Endpoint security access with space awareness enabled', { - // TODO:PR Remove `'@skipInServerlessMKI` once PR merges to `main` + // TODO:PR Remove `'@skipInServerlessMKI` once PR merges to `main` and feature flag is enabled in prod. tags: ['@ess', '@serverless', '@serverlessMKI', '@skipInServerlessMKI'], env: { ftrConfig: { @@ -44,11 +43,13 @@ describe.skip( }, }, () => { - let spaceId: string = ''; + // In Serverless MKI we use `admin` for the login user... other deployments use system indices superuser + const loginUser = Cypress.env('CLOUD_SERVERLESS') ? ROLE.admin : ROLE.system_indices_superuser; const roleName = `test_${Math.random().toString().substring(2, 6)}`; + let spaceId: string = ''; before(() => { - login(ROLE.system_indices_superuser); + login(loginUser); createSpace(`foo_${Math.random().toString().substring(2, 6)}`).then((response) => { spaceId = response.body.id; }); @@ -62,16 +63,16 @@ describe.skip( }); beforeEach(() => { - login(ROLE.system_indices_superuser); + login(loginUser); navigateToRolePage(); setRoleName(roleName); openKibanaFeaturePrivilegesFlyout(); + setKibanaPrivilegeSpace(spaceId); expandSecuritySolutionCategoryKibanaPrivileges(); expandEndpointSecurityFeaturePrivileges(); }); it('should allow configuration per-space', () => { - setKibanaPrivilegeSpace(spaceId); setSecuritySolutionEndpointGroupPrivilege('all'); clickEndpointSubFeaturePrivilegesCustomization(); setEndpointSubFeaturePrivilege('endpoint_list', 'all'); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts index d741c3a7f0e59..eed5970fbc9d0 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts @@ -85,6 +85,15 @@ describe( } }); + afterEach(function () { + if (Cypress.env('IS_CI') && this.currentTest?.isFailed() && createdHost) { + cy.task('captureHostVmAgentDiagnostics', { + hostname: createdHost.hostname, + fileNamePrefix: this.currentTest?.fullTitle(), + }); + } + }); + it('should open responder from alert details flyout', () => { waitForEndpointListPageToBeLoaded(createdHost.hostname); toggleRuleOffAndOn(ruleName); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts index 042031b301185..d5f3bd7d956af 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts @@ -63,6 +63,15 @@ describe('Response console', { tags: ['@ess', '@serverless'] }, () => { } }); + afterEach(function () { + if (Cypress.env('IS_CI') && this.currentTest?.isFailed() && createdHost) { + cy.task('captureHostVmAgentDiagnostics', { + hostname: createdHost.hostname, + fileNamePrefix: this.currentTest?.fullTitle(), + }); + } + }); + it('"execute --command" - should execute a command', () => { waitForEndpointListPageToBeLoaded(createdHost.hostname); openResponseConsoleFromEndpointList(); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts index f89f2a6f62ecf..b08dcd0eea492 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts @@ -61,6 +61,15 @@ describe('Response console', { tags: ['@ess', '@serverless'] }, () => { } }); + afterEach(function () { + if (Cypress.env('IS_CI') && this.currentTest?.isFailed() && createdHost) { + cy.task('captureHostVmAgentDiagnostics', { + hostname: createdHost.hostname, + fileNamePrefix: this.currentTest?.fullTitle(), + }); + } + }); + describe('Host Isolation:', () => { beforeEach(() => { login(); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts index ed05f5a26e356..a2b150bfad0c2 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts @@ -68,6 +68,15 @@ describe.skip('Response console', { tags: ['@ess', '@serverless', '@skipInServer } }); + afterEach(function () { + if (Cypress.env('IS_CI') && this.currentTest?.isFailed() && createdHost) { + cy.task('captureHostVmAgentDiagnostics', { + hostname: createdHost.hostname, + fileNamePrefix: this.currentTest?.fullTitle(), + }); + } + }); + it('"processes" - should obtain a list of processes', () => { waitForEndpointListPageToBeLoaded(createdHost.hostname); openResponseConsoleFromEndpointList(); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts index d11b7210713a8..4f45522a76ecf 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts @@ -62,6 +62,15 @@ describe('Response console', { tags: ['@ess', '@serverless'] }, () => { } }); + afterEach(function () { + if (Cypress.env('IS_CI') && this.currentTest?.isFailed() && createdHost) { + cy.task('captureHostVmAgentDiagnostics', { + hostname: createdHost.hostname, + fileNamePrefix: this.currentTest?.fullTitle(), + }); + } + }); + describe('Host Isolation:', () => { beforeEach(() => { login(); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts index 04630647ed35f..e9ca6a7ee4229 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts @@ -81,6 +81,15 @@ describe( } }); + afterEach(function () { + if (Cypress.env('IS_CI') && this.currentTest?.isFailed() && createdHost) { + cy.task('captureHostVmAgentDiagnostics', { + hostname: createdHost.hostname, + fileNamePrefix: this.currentTest?.fullTitle(), + }); + } + }); + [ ['file', filePath], ['folder', homeFilePath], diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/stack_management/role_page.ts b/x-pack/plugins/security_solution/public/management/cypress/screens/stack_management/role_page.ts index fb9b798b93d6e..a3e7bbc7e4e89 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/screens/stack_management/role_page.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/screens/stack_management/role_page.ts @@ -85,6 +85,13 @@ export const setKibanaPrivilegeSpace = (spaceId: string) => { cy.getByTestSubj('comboBoxOptionsList spaceSelectorComboBox-optionsList') .find(`button#spaceOption_${spaceId}`) .click(); + + // Wait for the selection to be added to the list of selected spaces + cy.getByTestSubj('spaceSelectorComboBox').find(`#spaceOption_${spaceId}`); + + // This `click()` just ensures that the combox in the UI is "closed" after the + // selection and mouse focus is moved away from that field. + getKibanaFeaturePrivilegesFlyout().click(); }; /** diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts b/x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts index fc95d174c4dd7..0a2cee2b31fe5 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts @@ -9,13 +9,12 @@ import type { LoginState } from '@kbn/security-plugin/common/login_state'; import type { Role } from '@kbn/security-plugin/common'; import { ENDPOINT_SECURITY_ROLE_NAMES } from '../../../../scripts/endpoint/common/roles_users'; import type { SecurityTestUser } from '../common/constants'; +import { KIBANA_KNOWN_DEFAULT_ACCOUNTS } from '../common/constants'; import { COMMON_API_HEADERS, request } from './common'; export const ROLE = Object.freeze>({ ...ENDPOINT_SECURITY_ROLE_NAMES, - elastic: 'elastic', - elastic_serverless: 'elastic_serverless', - system_indices_superuser: 'system_indices_superuser', + ...KIBANA_KNOWN_DEFAULT_ACCOUNTS, }); interface CyLoginTask { diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/body_config.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/body_config.ts index 93690f98b48e8..59d11314171a6 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/body_config.ts +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/body_config.ts @@ -13,6 +13,7 @@ import { rulesCardConfig } from './cards/rules'; import { alertsCardConfig } from './cards/alerts'; import { assistantCardConfig } from './cards/assistant'; import { aiConnectorCardConfig } from './cards/siem_migrations/ai_connector'; +import { startMigrationCardConfig } from './cards/siem_migrations/start_migration'; export const defaultBodyConfig: OnboardingGroupConfig[] = [ { @@ -43,4 +44,10 @@ export const siemMigrationsBodyConfig: OnboardingGroupConfig[] = [ }), cards: [aiConnectorCardConfig], }, + { + title: i18n.translate('xpack.securitySolution.onboarding.migrate.title', { + defaultMessage: 'Migrate rules & add data', + }), + cards: [startMigrationCardConfig], + }, ]; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.tsx index be1b01fc77081..7f3ba00593fc0 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.tsx +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.tsx @@ -17,7 +17,7 @@ export const OnboardingCardContentPanel = React.memo - + {children} diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx index 127e6b4d57ebd..e42834e85d488 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx @@ -6,19 +6,14 @@ */ import React, { useCallback } from 'react'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiText, - useEuiTheme, - COLOR_MODES_STANDARD, -} from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { useKibana } from '../../../../../../common/lib/kibana/kibana_react'; import { useDefinedLocalStorage } from '../../../../hooks/use_stored_state'; import type { OnboardingCardComponent } from '../../../../../types'; import * as i18n from './translations'; import { OnboardingCardContentPanel } from '../../common/card_content_panel'; import { ConnectorCards } from '../../common/connectors/connector_cards'; +import { CardSubduedText } from '../../common/card_subdued_text'; import type { AIConnectorCardMetadata } from './types'; import { MissingPrivilegesCallOut } from '../../common/connectors/missing_privileges'; @@ -28,9 +23,6 @@ export const AIConnectorCard: OnboardingCardComponent = setComplete, }) => { const { siemMigrations } = useKibana().services; - const { euiTheme, colorMode } = useEuiTheme(); - const isDarkMode = colorMode === COLOR_MODES_STANDARD.dark; - const [storedConnectorId, setStoredConnectorId] = useDefinedLocalStorage( siemMigrations.rules.connectorIdStorage.key, null @@ -48,18 +40,11 @@ export const AIConnectorCard: OnboardingCardComponent = const canCreateConnectors = checkCompleteMetadata?.canCreateConnectors; return ( - + {canExecuteConnectors ? ( - - {i18n.AI_CONNECTOR_CARD_DESCRIPTION} - + {i18n.AI_CONNECTOR_CARD_DESCRIPTION} = async ({ http, application, siemMigrations }) => { let isComplete = false; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts index 45080123889d5..d0b32eb1bd638 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts @@ -6,11 +6,11 @@ */ import React from 'react'; -import { AssistantAvatar } from '@kbn/elastic-assistant'; +import { AssistantAvatar } from '@kbn/elastic-assistant/impl/assistant/assistant_avatar/assistant_avatar'; import type { OnboardingCardConfig } from '../../../../../types'; import { OnboardingCardId } from '../../../../../constants'; import { AI_CONNECTOR_CARD_TITLE } from './translations'; -import { checkAssistantCardComplete } from './connectors_check_complete'; +import { checkAiConnectorsCardComplete } from './connectors_check_complete'; import type { AIConnectorCardMetadata } from './types'; export const aiConnectorCardConfig: OnboardingCardConfig = { @@ -24,6 +24,6 @@ export const aiConnectorCardConfig: OnboardingCardConfig void; + closeFlyout: () => void; +} + +const StartMigrationContext = createContext(null); + +export const StartMigrationContextProvider: React.FC< + PropsWithChildren +> = React.memo(({ children, openFlyout, closeFlyout }) => { + const value = useMemo( + () => ({ openFlyout, closeFlyout }), + [openFlyout, closeFlyout] + ); + return {children}; +}); +StartMigrationContextProvider.displayName = 'StartMigrationContextProvider'; + +export const useStartMigrationContext = (): StartMigrationContextValue => { + const context = useContext(StartMigrationContext); + if (context == null) { + throw new Error('useStartMigrationContext must be used within a StartMigrationContextProvider'); + } + return context; +}; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/images/card_header_icon.png b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/images/card_header_icon.png new file mode 100644 index 0000000000000..b2b4848e0be1d Binary files /dev/null and b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/images/card_header_icon.png differ diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/index.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/index.ts new file mode 100644 index 0000000000000..fcf950e0840e9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/index.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import type { OnboardingCardConfig } from '../../../../../types'; +import { OnboardingCardId } from '../../../../../constants'; +import { START_MIGRATION_CARD_TITLE } from './translations'; +import cardIcon from './images/card_header_icon.png'; +import { checkStartMigrationCardComplete } from './start_migration_check_complete'; + +export const startMigrationCardConfig: OnboardingCardConfig = { + id: OnboardingCardId.siemMigrationsStart, + title: START_MIGRATION_CARD_TITLE, + icon: cardIcon, + Component: React.lazy( + () => + import( + /* webpackChunkName: "onboarding_siem_migrations_start_migration_card" */ + './start_migration_card' + ) + ), + checkComplete: checkStartMigrationCardComplete, + licenseTypeRequired: 'enterprise', +}; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/missing_ai_connector_callout.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/missing_ai_connector_callout.tsx new file mode 100644 index 0000000000000..324dd405d5141 --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/missing_ai_connector_callout.tsx @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLink } from '@elastic/eui'; +import { OnboardingCardContentPanel } from '../../common/card_content_panel'; +import { CardCallOut } from '../../common/card_callout'; +import * as i18n from './translations'; + +interface MissingAIConnectorCalloutProps { + onExpandAiConnectorsCard: () => void; +} + +export const MissingAIConnectorCallout = React.memo( + ({ onExpandAiConnectorsCard }) => ( + + + + {i18n.START_MIGRATION_CARD_CONNECTOR_MISSING_BUTTON} + + + + + + } + /> + + ) +); +MissingAIConnectorCallout.displayName = 'MissingAIConnectorCallout'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_progress_panel.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_progress_panel.tsx new file mode 100644 index 0000000000000..0527e1cfbdf17 --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_progress_panel.tsx @@ -0,0 +1,45 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiText, EuiPanel, EuiProgress } from '@elastic/eui'; +import type { RuleMigrationStats } from '../../../../../../../siem_migrations/rules/types'; +import * as i18n from '../translations'; +import { TITLE_CLASS_NAME } from '../start_migration_card.styles'; + +export interface MigrationProgressPanelProps { + migrationStats: RuleMigrationStats; +} +export const MigrationProgressPanel = React.memo( + ({ migrationStats }) => { + const progressValue = useMemo(() => { + const finished = migrationStats.rules.completed + migrationStats.rules.failed; + return (finished / migrationStats.rules.total) * 100; + }, [migrationStats.rules]); + + return ( + + + + +

{i18n.START_MIGRATION_CARD_MIGRATION_TITLE(migrationStats.number)}

+
+
+ + +

{i18n.START_MIGRATION_CARD_PROGRESS_DESCRIPTION}

+
+
+ + + +
+
+ ); + } +); +MigrationProgressPanel.displayName = 'MigrationProgressPanel'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_ready_panel.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_ready_panel.tsx new file mode 100644 index 0000000000000..8603511fa2d6f --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_ready_panel.tsx @@ -0,0 +1,68 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback } from 'react'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiText, + EuiButton, + EuiButtonEmpty, + EuiPanel, +} from '@elastic/eui'; +import { useStartMigration } from '../../../../../../../siem_migrations/rules/service/hooks/use_start_migration'; +import type { RuleMigrationStats } from '../../../../../../../siem_migrations/rules/types'; +import * as i18n from '../translations'; +import { useStartMigrationContext } from '../context'; +import { TITLE_CLASS_NAME } from '../start_migration_card.styles'; + +export interface MigrationReadyPanelProps { + migrationStats: RuleMigrationStats; +} +export const MigrationReadyPanel = React.memo(({ migrationStats }) => { + const { openFlyout } = useStartMigrationContext(); + const onOpenFlyout = useCallback(() => { + openFlyout(migrationStats); + }, [openFlyout, migrationStats]); + + const { startMigration, isLoading } = useStartMigration(); + const onStartMigration = useCallback(() => { + startMigration(migrationStats.id); + }, [migrationStats.id, startMigration]); + + return ( + + + + + + +

{i18n.START_MIGRATION_CARD_MIGRATION_TITLE(migrationStats.number)}

+
+
+ + +

{i18n.START_MIGRATION_CARD_MIGRATION_READY_DESCRIPTION}

+
+
+
+
+ + + {i18n.START_MIGRATION_CARD_TRANSLATE_BUTTON} + + + + + {i18n.START_MIGRATION_CARD_UPLOAD_MACROS_BUTTON} + + +
+
+ ); +}); +MigrationReadyPanel.displayName = 'MigrationReadyPanel'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx new file mode 100644 index 0000000000000..b73b3cc8b4921 --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx @@ -0,0 +1,87 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import moment from 'moment'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiText, + EuiPanel, + EuiHorizontalRule, + EuiIcon, +} from '@elastic/eui'; +import { SecurityPageName } from '@kbn/security-solution-navigation'; +import { AssistantAvatar } from '@kbn/elastic-assistant/impl/assistant/assistant_avatar/assistant_avatar'; +import { SecuritySolutionLinkButton } from '../../../../../../../common/components/links'; +import type { RuleMigrationStats } from '../../../../../../../siem_migrations/rules/types'; +import * as i18n from '../translations'; +import { TITLE_CLASS_NAME } from '../start_migration_card.styles'; + +export interface MigrationResultPanelProps { + migrationStats: RuleMigrationStats; +} +export const MigrationResultPanel = React.memo(({ migrationStats }) => { + return ( + + + + + +

{i18n.START_MIGRATION_CARD_RESULT_TITLE(migrationStats.number)}

+
+
+ + +

+ {i18n.START_MIGRATION_CARD_RESULT_DESCRIPTION( + moment(migrationStats.created_at).format('MMMM Do YYYY, h:mm:ss a'), + moment(migrationStats.last_updated_at).fromNow() + )} +

+
+
+
+
+ + + + + + + + + + +

{i18n.VIEW_TRANSLATED_RULES_TITLE}

+
+
+
+
+ + + + +

{'TODO: chart'}

+
+ + + {i18n.VIEW_TRANSLATED_RULES_BUTTON} + + +
+
+
+
+
+
+ ); +}); +MigrationResultPanel.displayName = 'MigrationResultPanel'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.styles.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.styles.ts new file mode 100644 index 0000000000000..0aef40dfeb442 --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.styles.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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { css } from '@emotion/css'; + +export const useStyles = (compressed: boolean) => { + const logoSize = compressed ? '32px' : '88px'; + return css` + .siemMigrationsIcon { + width: ${logoSize}; + block-size: ${logoSize}; + inline-size: ${logoSize}; + } + `; +}; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.tsx new file mode 100644 index 0000000000000..edcff3646c5aa --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.tsx @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback } from 'react'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiText, + EuiIcon, + EuiButton, + EuiButtonEmpty, + EuiPanel, +} from '@elastic/eui'; +import { SiemMigrationsIcon } from '../../../../../../../siem_migrations/common/icon'; +import * as i18n from '../translations'; +import { useStartMigrationContext } from '../context'; +import { TITLE_CLASS_NAME } from '../start_migration_card.styles'; +import { useStyles } from './upload_rules_panel.styles'; + +export interface UploadRulesPanelProps { + isUploadMore?: boolean; +} +export const UploadRulesPanel = React.memo(({ isUploadMore = false }) => { + const styles = useStyles(isUploadMore); + const { openFlyout } = useStartMigrationContext(); + const onOpenFlyout = useCallback(() => { + openFlyout(); + }, [openFlyout]); + + return ( + + + + + + + {isUploadMore ? ( + +

{i18n.START_MIGRATION_CARD_UPLOAD_MORE_TITLE}

+
+ ) : ( + + + +

{i18n.START_MIGRATION_CARD_UPLOAD_TITLE}

+
+
+ + +

{i18n.START_MIGRATION_CARD_UPLOAD_DESCRIPTION}

+
+
+ + +

{i18n.START_MIGRATION_CARD_UPLOAD_READ_MORE}

+
+
+
+ )} +
+ + {isUploadMore ? ( + + {i18n.START_MIGRATION_CARD_UPLOAD_MORE_BUTTON} + + ) : ( + + {i18n.START_MIGRATION_CARD_UPLOAD_BUTTON} + + )} + +
+
+ ); +}); +UploadRulesPanel.displayName = 'UploadRulesPanel'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.styles.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.styles.ts new file mode 100644 index 0000000000000..82446ba308402 --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.styles.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { css } from '@emotion/css'; +import { useEuiTheme } from '@elastic/eui'; + +export const TITLE_CLASS_NAME = 'siemMigrationsStartTitle'; + +export const useStyles = () => { + const { euiTheme } = useEuiTheme(); + return css` + .${TITLE_CLASS_NAME} { + font-weight: ${euiTheme.font.weight.semiBold}; + } + `; +}; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx new file mode 100644 index 0000000000000..c1e7539c8e101 --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback, useState } from 'react'; +import { EuiSpacer, EuiText } from '@elastic/eui'; +import { OnboardingCardId } from '../../../../../constants'; +import type { RuleMigrationTaskStats } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import { useLatestStats } from '../../../../../../siem_migrations/rules/service/hooks/use_latest_stats'; +import { MigrationDataInputFlyout } from '../../../../../../siem_migrations/rules/components/data_input_flyout'; +import { CenteredLoadingSpinner } from '../../../../../../common/components/centered_loading_spinner'; +import type { OnboardingCardComponent } from '../../../../../types'; +import { OnboardingCardContentPanel } from '../../common/card_content_panel'; +import { UploadRulesPanels } from './upload_rules_panels'; +import { StartMigrationContextProvider } from './context'; +import { useStyles } from './start_migration_card.styles'; +import * as i18n from './translations'; +import { MissingAIConnectorCallout } from './missing_ai_connector_callout'; + +export const StartMigrationCard: OnboardingCardComponent = React.memo( + ({ checkComplete, isCardComplete, setExpandedCardId }) => { + const styles = useStyles(); + const { data: migrationsStats, isLoading } = useLatestStats(); + + const [isFlyoutOpen, setIsFlyoutOpen] = useState(); + const [flyoutMigrationStats, setFlyoutMigrationStats] = useState< + RuleMigrationTaskStats | undefined + >(); + + const closeFlyout = useCallback(() => { + setIsFlyoutOpen(false); + setFlyoutMigrationStats(undefined); + if (!isCardComplete(OnboardingCardId.siemMigrationsStart)) { + checkComplete(); + } + }, [checkComplete, isCardComplete]); + + const openFlyout = useCallback((migrationStats?: RuleMigrationTaskStats) => { + setFlyoutMigrationStats(migrationStats); + setIsFlyoutOpen(true); + }, []); + + if (!isCardComplete(OnboardingCardId.siemMigrationsAiConnectors)) { + return ( + + setExpandedCardId(OnboardingCardId.siemMigrationsAiConnectors) + } + /> + ); + } + + return ( + + + {isLoading ? ( + + ) : ( + + )} + + +

{i18n.START_MIGRATION_CARD_FOOTER_NOTE}

+
+
+ {isFlyoutOpen && ( + + )} +
+ ); + } +); +StartMigrationCard.displayName = 'StartMigrationCard'; + +// eslint-disable-next-line import/no-default-export +export default StartMigrationCard; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts new file mode 100644 index 0000000000000..41e65352d4bc3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { OnboardingCardCheckComplete } from '../../../../../types'; + +export const checkStartMigrationCardComplete: OnboardingCardCheckComplete = async ({ + siemMigrations, +}) => { + const migrationsStats = await siemMigrations.rules.getRuleMigrationsStats(); + const isComplete = migrationsStats.length > 0; + return isComplete; +}; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/translations.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/translations.ts new file mode 100644 index 0000000000000..bdb3f31842549 --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/translations.ts @@ -0,0 +1,118 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const START_MIGRATION_CARD_TITLE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.title', + { defaultMessage: 'Translate your existing SIEM Rules to Elastic' } +); +export const START_MIGRATION_CARD_FOOTER_NOTE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.footerNote', + { + defaultMessage: + 'Splunk and related marks are trademarks or registered trademarks of Splunk LLC in the United States and other countries.', + } +); +export const START_MIGRATION_CARD_CONNECTOR_MISSING_TEXT = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.connectorMissingText', + { + defaultMessage: 'Rule migrations require an AI connector to be configured.', + } +); +export const START_MIGRATION_CARD_CONNECTOR_MISSING_BUTTON = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.connectorMissingText', + { defaultMessage: 'AI provider step' } +); + +export const START_MIGRATION_CARD_UPLOAD_TITLE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.upload.title', + { defaultMessage: 'Export your Splunk® SIEM rules to start translation.' } +); + +export const START_MIGRATION_CARD_UPLOAD_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.upload.description', + { + defaultMessage: + 'Upload your rules before importing data to identify the integrations, data streams, and available details of your SIEM rules. Click “Upload Rules” to view step-by-step instructions to export and uploading the rules.', + } +); + +export const START_MIGRATION_CARD_UPLOAD_BUTTON = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.upload.button', + { defaultMessage: 'Upload rules' } +); + +export const START_MIGRATION_CARD_UPLOAD_MORE_TITLE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.uploadMore.title', + { defaultMessage: 'Need to migrate more rules?' } +); +export const START_MIGRATION_CARD_UPLOAD_MORE_BUTTON = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.uploadMore.button', + { defaultMessage: 'Upload more rules' } +); + +export const START_MIGRATION_CARD_UPLOAD_READ_MORE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.upload.readMore', + { defaultMessage: 'Read more about our AI powered translations and other features.' } +); + +export const START_MIGRATION_CARD_UPLOAD_READ_DOCS = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.upload.readAiDocsLink', + { defaultMessage: 'Read AI docs' } +); + +export const START_MIGRATION_CARD_MIGRATION_READY_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.ready.description', + { + defaultMessage: + 'Migration is created and ready but the translation has not started yet. You can either upload macros & lookups or start the translation process', + } +); +export const START_MIGRATION_CARD_TRANSLATE_BUTTON = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.translate.button', + { defaultMessage: 'Start translation' } +); +export const START_MIGRATION_CARD_UPLOAD_MACROS_BUTTON = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.uploadMacros.button', + { defaultMessage: 'Upload macros' } +); + +export const START_MIGRATION_CARD_MIGRATION_TITLE = (number: number) => + i18n.translate('xpack.securitySolution.onboarding.startMigration.migrationTitle', { + defaultMessage: 'SIEM rules migration #{number}', + values: { number }, + }); + +export const START_MIGRATION_CARD_PROGRESS_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.progress.description', + { + defaultMessage: `This may take a few minutes & the task will work in the background. Just stay logged in and we'll notify you when done.`, + } +); + +export const START_MIGRATION_CARD_RESULT_TITLE = (number: number) => + i18n.translate('xpack.securitySolution.onboarding.startMigration.result.title', { + defaultMessage: 'SIEM rules migration #{number} complete', + values: { number }, + }); + +export const START_MIGRATION_CARD_RESULT_DESCRIPTION = (createdAt: string, finishedAt: string) => + i18n.translate('xpack.securitySolution.onboarding.startMigration.result.description', { + defaultMessage: 'Export uploaded on {createdAt} and translation finished {finishedAt}.', + values: { createdAt, finishedAt }, + }); + +export const VIEW_TRANSLATED_RULES_TITLE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.result.translatedRules.title', + { defaultMessage: 'Translation Summary' } +); + +export const VIEW_TRANSLATED_RULES_BUTTON = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.result.translatedRules.button', + { defaultMessage: 'View translated rules' } +); diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx new file mode 100644 index 0000000000000..95b53d921fd1f --- /dev/null +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { SiemMigrationTaskStatus } from '../../../../../../../common/siem_migrations/constants'; +import type { RuleMigrationStats } from '../../../../../../siem_migrations/rules/types'; +import { UploadRulesPanel } from './panels/upload_rules_panel'; +import { MigrationProgressPanel } from './panels/migration_progress_panel'; +import { MigrationResultPanel } from './panels/migration_result_panel'; +import { MigrationReadyPanel } from './panels/migration_ready_panel'; + +export interface UploadRulesPanelsProps { + migrationsStats: RuleMigrationStats[]; +} +export const UploadRulesPanels = React.memo(({ migrationsStats }) => { + if (migrationsStats.length === 0) { + return ; + } + + return ( + + + + + {migrationsStats.map((migrationStats) => ( + + {migrationStats.status === SiemMigrationTaskStatus.READY && ( + + )} + {migrationStats.status === SiemMigrationTaskStatus.RUNNING && ( + + )} + {migrationStats.status === SiemMigrationTaskStatus.FINISHED && ( + + )} + + ))} + + ); +}); +UploadRulesPanels.displayName = 'UploadRulesPanels'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.test.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.test.ts index 65ecbe06f26c5..0c053b5ea0b69 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.test.ts +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.test.ts @@ -6,12 +6,9 @@ */ import { renderHook, act } from '@testing-library/react-hooks'; -import { useExpandedCard } from './use_expanded_card'; -import { HEIGHT_ANIMATION_DURATION } from '../onboarding_card_panel.styles'; -import type { OnboardingCardId } from '../../../constants'; import { waitFor } from '@testing-library/react'; - -const scrollTimeout = HEIGHT_ANIMATION_DURATION + 50; +import type { OnboardingCardId } from '../../../constants'; +import { useExpandedCard } from './use_expanded_card'; const mockSetCardDetail = jest.fn(); jest.mock('../../hooks/use_url_detail', () => ({ @@ -28,6 +25,7 @@ describe('useExpandedCard Hook', () => { const mockCardId = 'card-1' as OnboardingCardId; const mockScrollTo = jest.fn(); global.window.scrollTo = mockScrollTo; + jest.useFakeTimers(); const mockGetElementById = jest.fn().mockReturnValue({ focus: jest.fn(), @@ -39,21 +37,17 @@ describe('useExpandedCard Hook', () => { jest.clearAllMocks(); }); - // FLAKY: https://github.com/elastic/kibana/issues/202147 - describe.skip('when the page is completely loaded', () => { + describe('when the page is completely loaded', () => { beforeEach(() => { renderHook(useExpandedCard); }); it('should scroll to the expanded card id from the hash', async () => { // Ensure that scroll and focus were triggered - await waitFor( - () => { - expect(mockGetElementById).toHaveBeenCalledWith(mockCardId); - expect(mockScrollTo).toHaveBeenCalledWith({ top: 60, behavior: 'smooth' }); - }, - { timeout: scrollTimeout } - ); + await waitFor(() => { + expect(mockGetElementById).toHaveBeenCalledWith(mockCardId); + expect(mockScrollTo).toHaveBeenCalledWith({ top: 60, behavior: 'smooth' }); + }); }); }); @@ -79,13 +73,10 @@ describe('useExpandedCard Hook', () => { it('should not scroll', async () => { // Ensure that scroll and focus were triggered - await waitFor( - () => { - expect(mockGetElementById).not.toHaveBeenCalled(); - expect(mockScrollTo).not.toHaveBeenCalled(); - }, - { timeout: scrollTimeout } - ); + await waitFor(() => { + expect(mockGetElementById).not.toHaveBeenCalled(); + expect(mockScrollTo).not.toHaveBeenCalled(); + }); }); }); @@ -103,13 +94,10 @@ describe('useExpandedCard Hook', () => { it('should scroll', async () => { // Ensure that scroll and focus were triggered - await waitFor( - () => { - expect(mockGetElementById).toHaveBeenCalledWith(mockCardId); - expect(mockScrollTo).toHaveBeenCalledWith({ top: 160, behavior: 'smooth' }); - }, - { timeout: scrollTimeout } - ); + await waitFor(() => { + expect(mockGetElementById).toHaveBeenCalledWith(mockCardId); + expect(mockScrollTo).toHaveBeenCalledWith({ top: 160, behavior: 'smooth' }); + }); }); }); }); diff --git a/x-pack/plugins/security_solution/public/onboarding/constants.ts b/x-pack/plugins/security_solution/public/onboarding/constants.ts index e360e4591bb37..94b87721513bc 100644 --- a/x-pack/plugins/security_solution/public/onboarding/constants.ts +++ b/x-pack/plugins/security_solution/public/onboarding/constants.ts @@ -21,4 +21,5 @@ export enum OnboardingCardId { // siem_migrations topic cards siemMigrationsAiConnectors = 'ai_connectors', + siemMigrationsStart = 'start', } diff --git a/x-pack/plugins/security_solution/public/siem_migrations/common/icon/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/common/icon/index.tsx new file mode 100644 index 0000000000000..c0528a9a04afe --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/common/icon/index.tsx @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import SiemMigrationsIconSVG from './siem_migrations.svg'; +export const SiemMigrationsIcon = SiemMigrationsIconSVG; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/common/icon/siem_migrations.svg b/x-pack/plugins/security_solution/public/siem_migrations/common/icon/siem_migrations.svg new file mode 100644 index 0000000000000..e8568a943f70c --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/common/icon/siem_migrations.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts index 592b93f438197..db6f0117d4a77 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts @@ -7,161 +7,188 @@ import { replaceParams } from '@kbn/openapi-common/shared'; +import type { LangSmithOptions } from '../../../../common/siem_migrations/model/common.gen'; import { KibanaServices } from '../../../common/lib/kibana'; import { + SIEM_RULE_MIGRATIONS_PATH, SIEM_RULE_MIGRATIONS_ALL_STATS_PATH, SIEM_RULE_MIGRATION_INSTALL_TRANSLATED_PATH, SIEM_RULE_MIGRATION_INSTALL_PATH, SIEM_RULE_MIGRATION_PATH, SIEM_RULE_MIGRATION_START_PATH, + SIEM_RULE_MIGRATION_STATS_PATH, SIEM_RULE_MIGRATION_TRANSLATION_STATS_PATH, } from '../../../../common/siem_migrations/constants'; import type { + CreateRuleMigrationRequestBody, + CreateRuleMigrationResponse, GetAllStatsRuleMigrationResponse, GetRuleMigrationResponse, GetRuleMigrationTranslationStatsResponse, InstallTranslatedMigrationRulesResponse, InstallMigrationRulesResponse, StartRuleMigrationRequestBody, + GetRuleMigrationStatsResponse, } from '../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; -/** - * Retrieves the stats for all the existing migrations, aggregated by `migration_id`. - * - * @param signal AbortSignal for cancelling request - * - * @throws An error if response is not OK - */ +export interface GetRuleMigrationStatsParams { + /** `id` of the migration to get stats for */ + migrationId: string; + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** Retrieves the stats for all the existing migrations, aggregated by `migration_id`. */ +export const getRuleMigrationStats = async ({ + migrationId, + signal, +}: GetRuleMigrationStatsParams): Promise => { + return KibanaServices.get().http.get( + replaceParams(SIEM_RULE_MIGRATION_STATS_PATH, { migration_id: migrationId }), + { version: '1', signal } + ); +}; + +export interface GetRuleMigrationsStatsAllParams { + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** Retrieves the stats for all the existing migrations, aggregated by `migration_id`. */ export const getRuleMigrationsStatsAll = async ({ signal, -}: { - signal: AbortSignal | undefined; -}): Promise => { - return KibanaServices.get().http.fetch( +}: GetRuleMigrationsStatsAllParams = {}): Promise => { + return KibanaServices.get().http.get( SIEM_RULE_MIGRATIONS_ALL_STATS_PATH, - { method: 'GET', version: '1', signal } + { version: '1', signal } ); }; -/** - * Starts a new migration with the provided rules. - * - * @param migrationId `id` of the migration to start - * @param body The body containing the `connectorId` to use for the migration - * @param signal AbortSignal for cancelling request - * - * @throws An error if response is not OK - */ -export const startRuleMigration = async ({ +export interface CreateRuleMigrationParams { + /** Optional `id` of migration to add the rules to. + * The id is necessary only for batching the migration creation in multiple requests */ + migrationId?: string; + /** The body containing the `connectorId` to use for the migration */ + body: CreateRuleMigrationRequestBody; + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** Starts a new migration with the provided rules. */ +export const createRuleMigration = async ({ migrationId, body, signal, -}: { - migrationId: string; - body: StartRuleMigrationRequestBody; - signal: AbortSignal | undefined; -}): Promise => { - return KibanaServices.get().http.put( - replaceParams(SIEM_RULE_MIGRATION_START_PATH, { migration_id: migrationId }), +}: CreateRuleMigrationParams): Promise => { + return KibanaServices.get().http.post( + `${SIEM_RULE_MIGRATIONS_PATH}${migrationId ? `/${migrationId}` : ''}`, { body: JSON.stringify(body), version: '1', signal } ); }; -/** - * Retrieves the translation stats for the migraion. - * - * @param migrationId `id` of the migration to retrieve translation stats for - * @param signal AbortSignal for cancelling request - * - * @throws An error if response is not OK - */ -export const getRuleMigrationTranslationStats = async ({ +export interface StartRuleMigrationParams { + /** `id` of the migration to start */ + migrationId: string; + /** The connector id to use for the migration */ + connectorId: string; + /** Optional LangSmithOptions to use for the for the migration */ + langSmithOptions?: LangSmithOptions; + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** Starts a new migration with the provided rules. */ +export const startRuleMigration = async ({ migrationId, + connectorId, + langSmithOptions, signal, -}: { - migrationId: string; - signal: AbortSignal | undefined; -}): Promise => { - return KibanaServices.get().http.fetch( - replaceParams(SIEM_RULE_MIGRATION_TRANSLATION_STATS_PATH, { migration_id: migrationId }), - { - method: 'GET', - version: '1', - signal, - } +}: StartRuleMigrationParams): Promise => { + const body: StartRuleMigrationRequestBody = { connector_id: connectorId }; + if (langSmithOptions) { + body.langsmith_options = langSmithOptions; + } + return KibanaServices.get().http.put( + replaceParams(SIEM_RULE_MIGRATION_START_PATH, { migration_id: migrationId }), + { body: JSON.stringify(body), version: '1', signal } ); }; -/** - * Retrieves all the migration rule documents of a specific migration. - * - * @param migrationId `id` of the migration to retrieve rule documents for - * @param signal AbortSignal for cancelling request - * - * @throws An error if response is not OK - */ +export interface GetRuleMigrationParams { + /** `id` of the migration to get rules documents for */ + migrationId: string; + /** Optional page number to retrieve */ + page?: number; + /** Optional number of documents per page to retrieve */ + perPage?: number; + /** Optional search term to filter documents */ + searchTerm?: string; + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** Retrieves all the migration rule documents of a specific migration. */ export const getRuleMigrations = async ({ migrationId, page, perPage, searchTerm, signal, -}: { - migrationId: string; - page?: number; - perPage?: number; - searchTerm?: string; - signal: AbortSignal | undefined; -}): Promise => { - return KibanaServices.get().http.fetch( +}: GetRuleMigrationParams): Promise => { + return KibanaServices.get().http.get( replaceParams(SIEM_RULE_MIGRATION_PATH, { migration_id: migrationId }), - { - method: 'GET', - version: '1', - query: { - page, - per_page: perPage, - search_term: searchTerm, - }, - signal, - } + { version: '1', query: { page, per_page: perPage, search_term: searchTerm }, signal } ); }; -export const installMigrationRules = async ({ +export interface GetRuleMigrationTranslationStatsParams { + /** `id` of the migration to get translation stats for */ + migrationId: string; + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** + * Retrieves the translation stats for the migration. + */ +export const getRuleMigrationTranslationStats = async ({ migrationId, - ids, signal, -}: { +}: GetRuleMigrationTranslationStatsParams): Promise => { + return KibanaServices.get().http.get( + replaceParams(SIEM_RULE_MIGRATION_TRANSLATION_STATS_PATH, { migration_id: migrationId }), + { version: '1', signal } + ); +}; + +export interface InstallRulesParams { + /** `id` of the migration to install rules for */ migrationId: string; + /** The rule ids to install */ ids: string[]; + /** Optional AbortSignal for cancelling request */ signal?: AbortSignal; -}): Promise => { - return KibanaServices.get().http.fetch( +} +/** Installs the provided rule ids for a specific migration. */ +export const installMigrationRules = async ({ + migrationId, + ids, + signal, +}: InstallRulesParams): Promise => { + return KibanaServices.get().http.post( replaceParams(SIEM_RULE_MIGRATION_INSTALL_PATH, { migration_id: migrationId }), - { - method: 'POST', - version: '1', - body: JSON.stringify(ids), - signal, - } + { version: '1', body: JSON.stringify(ids), signal } ); }; +export interface InstallTranslatedRulesParams { + /** `id` of the migration to install rules for */ + migrationId: string; + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** Installs all the translated rules for a specific migration. */ export const installTranslatedMigrationRules = async ({ migrationId, signal, -}: { - migrationId: string; - signal?: AbortSignal; -}): Promise => { - return KibanaServices.get().http.fetch( +}: InstallTranslatedRulesParams): Promise => { + return KibanaServices.get().http.post( replaceParams(SIEM_RULE_MIGRATION_INSTALL_TRANSLATED_PATH, { migration_id: migrationId }), - { - method: 'POST', - version: '1', - signal, - } + { version: '1', signal } ); }; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts new file mode 100644 index 0000000000000..aa331bf17c832 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export enum DataInputStep { + rules = 'rules', + macros = 'macros', + lookups = 'lookups', +} + +export const SPL_RULES_COLUMNS = [ + 'id', + 'title', + 'search', + 'description', + 'action.escu.eli5', + 'action.correlationsearch.annotations', +] as const; + +export const RULES_SPLUNK_QUERY = `| rest /servicesNS/-/-/saved/searches +| search action.correlationsearch.enabled = "1" OR (eai:acl.app = "Splunk_Security_Essentials" AND is_scheduled=1) +| where disabled=0 +| table ${SPL_RULES_COLUMNS.join(', ')}`; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx new file mode 100644 index 0000000000000..6a4916a5e54b3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx @@ -0,0 +1,112 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback, useState } from 'react'; +import { + EuiFlyoutResizable, + EuiFlyoutHeader, + EuiTitle, + EuiFlyoutBody, + EuiFlyoutFooter, + EuiFlexGroup, + EuiFlexItem, + EuiButton, +} from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { RuleMigrationTaskStats } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import { DataInputStep } from './constants'; +import { RulesDataInput } from './steps/rules/rules_data_input'; +import { useStartMigration } from '../../service/hooks/use_start_migration'; + +export interface MigrationDataInputFlyoutProps { + onClose: () => void; + migrationStats?: RuleMigrationTaskStats; +} +export const MigrationDataInputFlyout = React.memo( + ({ onClose, migrationStats: initialMigrationSats }) => { + const [migrationStats, setMigrationStats] = useState( + initialMigrationSats + ); + + const { startMigration, isLoading: isStartLoading } = useStartMigration(onClose); + const onStartMigration = useCallback(() => { + if (migrationStats?.id) { + startMigration(migrationStats.id); + } + }, [migrationStats, startMigration]); + + const [dataInputStep, setDataInputStep] = useState(() => { + if (migrationStats) { + return DataInputStep.macros; + } + return DataInputStep.rules; + }); + + const onMigrationCreated = useCallback( + (createdMigrationStats: RuleMigrationTaskStats) => { + if (createdMigrationStats) { + setMigrationStats(createdMigrationStats); + setDataInputStep(DataInputStep.macros); + } + }, + [setDataInputStep] + ); + + return ( + + + +

+ +

+
+
+ + + + + + + + + + + + + + + + + +
+ ); + } +); +MigrationDataInputFlyout.displayName = 'MigrationDataInputFlyout'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/index.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/index.ts new file mode 100644 index 0000000000000..709623f992f72 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { MigrationDataInputFlyout, type MigrationDataInputFlyoutProps } from './data_input_flyout'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx new file mode 100644 index 0000000000000..438134b0ad99a --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiPanel } from '@elastic/eui'; +import { css } from '@emotion/css'; +import type { PropsWithChildren } from 'react'; +import React from 'react'; + +const style = css` + .euiStep__title { + font-size: 14px; + } +`; + +export const SubStepWrapper = React.memo>(({ children }) => { + return ( + + {children} + + ); +}); +SubStepWrapper.displayName = 'SubStepWrapper'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx new file mode 100644 index 0000000000000..2b20dcda0cea7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx @@ -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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiPanel, + EuiStepNumber, + EuiSteps, + EuiTitle, +} from '@elastic/eui'; +import React, { useMemo, useState } from 'react'; +import { SubStepWrapper } from '../common/sub_step_wrapper'; +import type { OnMigrationCreated } from '../../types'; +import { useCopyExportQueryStep } from './sub_steps/copy_export_query'; +import { useRulesFileUploadStep } from './sub_steps/rules_file_upload'; +import * as i18n from './translations'; +import { useCheckResourcesStep } from './sub_steps/check_resources'; + +type Step = 1 | 2 | 3 | 4; +const getStatus = (step: Step, currentStep: Step): EuiStepStatus => { + if (step === currentStep) { + return 'current'; + } + if (step < currentStep) { + return 'complete'; + } + return 'incomplete'; +}; + +interface RulesDataInputProps { + selected: boolean; + onMigrationCreated: OnMigrationCreated; +} + +export const RulesDataInput = React.memo( + ({ selected, onMigrationCreated }) => { + const [step, setStep] = useState(1); + + const copyStep = useCopyExportQueryStep({ + status: getStatus(1, step), + onCopied: () => setStep(2), + }); + + const uploadStep = useRulesFileUploadStep({ + status: getStatus(2, step), + onMigrationCreated: (stats) => { + onMigrationCreated(stats); + setStep(3); + }, + }); + + const resourcesStep = useCheckResourcesStep({ + status: getStatus(3, step), + onComplete: () => { + setStep(4); + }, + }); + + const steps = useMemo( + () => [copyStep, uploadStep, resourcesStep], + [copyStep, uploadStep, resourcesStep] + ); + + return ( + + + + + + + + + + {i18n.RULES_DATA_INPUT_TITLE} + + + + + + + + + + + + ); + } +); +RulesDataInput.displayName = 'RulesDataInput'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx new file mode 100644 index 0000000000000..3b081eb203267 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiText, type EuiStepProps, type EuiStepStatus } from '@elastic/eui'; +import * as i18n from './translations'; + +export interface CheckResourcesStepProps { + status: EuiStepStatus; + onComplete: () => void; +} +export const useCheckResourcesStep = ({ + status, + onComplete, +}: CheckResourcesStepProps): EuiStepProps => { + // onComplete(); // TODO: check the resources + return { + title: i18n.RULES_DATA_INPUT_CHECK_RESOURCES_TITLE, + status, + children: ( + + {i18n.RULES_DATA_INPUT_CHECK_RESOURCES_DESCRIPTION} + + ), + }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/translations.ts new file mode 100644 index 0000000000000..159b4033fafd6 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/translations.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const RULES_DATA_INPUT_CHECK_RESOURCES_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.checkResources.title', + { defaultMessage: 'Check for macros and lookups' } +); + +export const RULES_DATA_INPUT_CHECK_RESOURCES_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.checkResources.description', + { + defaultMessage: `For best translation results, we will automatically review your rules for macros and lookups and ask you to upload them. Once uploaded, we'll be able to deliver a more complete rule translation for all rules using those macros or lookups.`, + } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/copy_export_query.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/copy_export_query.tsx new file mode 100644 index 0000000000000..11fb88a1cade2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/copy_export_query.tsx @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback } from 'react'; +import { EuiCodeBlock, EuiSpacer, EuiText } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { RULES_SPLUNK_QUERY } from '../../../../constants'; +import * as i18n from './translations'; + +interface CopyExportQueryProps { + onCopied: () => void; +} +export const CopyExportQuery = React.memo(({ onCopied }) => { + const onClick: React.MouseEventHandler = useCallback( + (ev) => { + // The only button inside the element is the "copy" button. + if ((ev.target as Element).tagName === 'BUTTON') { + onCopied(); + } + }, + [onCopied] + ); + + return ( + <> + {/* The click event is also dispatched when using the keyboard actions (space or enter) for "copy" button. + No need to use keyboard specific events, disabling the a11y lint rule:*/} + {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */} +
+ {/* onCopy react event is dispatched when the user copies text manually */} + + {RULES_SPLUNK_QUERY} + +
+ + + {i18n.RULES_DATA_INPUT_COPY_DESCRIPTION_SECTION}, + format: {'JSON'}, + }} + /> + + + ); +}); +CopyExportQuery.displayName = 'CopyExportQuery'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/index.tsx new file mode 100644 index 0000000000000..3d2adcc78857b --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/index.tsx @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import { CopyExportQuery } from './copy_export_query'; +import * as i18n from './translations'; + +export interface CopyExportQueryStepProps { + status: EuiStepStatus; + onCopied: () => void; +} +export const useCopyExportQueryStep = ({ + status, + onCopied, +}: CopyExportQueryStepProps): EuiStepProps => { + return { + title: i18n.RULES_DATA_INPUT_COPY_TITLE, + status, + children: , + }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts new file mode 100644 index 0000000000000..d76eb71f2e378 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const RULES_DATA_INPUT_COPY_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.copyExportQuery.title', + { defaultMessage: 'Copy and export query' } +); + +export const RULES_DATA_INPUT_COPY_DESCRIPTION_SECTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.copyExportQuery.description.section', + { defaultMessage: 'Search and Reporting' } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx new file mode 100644 index 0000000000000..ab7838b28908b --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback, useMemo, useState } from 'react'; +import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import type { OnMigrationCreated } from '../../../../types'; +import { RulesFileUpload } from './rules_file_upload'; +import { + useCreateMigration, + type OnSuccess, +} from '../../../../../../service/hooks/use_create_migration'; +import * as i18n from './translations'; + +export interface RulesFileUploadStepProps { + status: EuiStepStatus; + onMigrationCreated: OnMigrationCreated; +} +export const useRulesFileUploadStep = ({ + status, + onMigrationCreated, +}: RulesFileUploadStepProps): EuiStepProps => { + const [isCreated, setIsCreated] = useState(false); + const onSuccess = useCallback( + (stats) => { + setIsCreated(true); + onMigrationCreated(stats); + }, + [onMigrationCreated] + ); + const { createMigration, isLoading, error } = useCreateMigration(onSuccess); + + const uploadStepStatus = useMemo(() => { + if (isLoading) { + return 'loading'; + } + if (error) { + return 'danger'; + } + return status; + }, [isLoading, error, status]); + + return { + title: i18n.RULES_DATA_INPUT_FILE_UPLOAD_TITLE, + status: uploadStepStatus, + children: ( + + ), + }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/parse_rules_file.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/parse_rules_file.ts new file mode 100644 index 0000000000000..3d5dbb32ccde8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/parse_rules_file.ts @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isPlainObject } from 'lodash/fp'; +import type { OriginalRule } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { SPL_RULES_COLUMNS } from '../../../../constants'; +import * as i18n from './translations'; + +type SplunkResult = Partial>; +interface SplunkRow { + result: SplunkResult; +} + +export const parseContent = (fileContent: string): OriginalRule[] => { + const trimmedContent = fileContent.trim(); + let arrayContent: SplunkRow[]; + if (trimmedContent.startsWith('[')) { + arrayContent = parseJSONArray(trimmedContent); + } else { + arrayContent = parseNDJSON(trimmedContent); + } + if (arrayContent.length === 0) { + throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.EMPTY); + } + return arrayContent.map(convertFormat); +}; + +const parseNDJSON = (fileContent: string): SplunkRow[] => { + return fileContent + .split(/\n(?=\{)/) // split at newline followed by '{'. + .filter((entry) => entry.trim() !== '') // Remove empty entries. + .map(parseJSON); // Parse each entry as JSON. +}; + +const parseJSONArray = (fileContent: string): SplunkRow[] => { + const parsedContent = parseJSON(fileContent); + if (!Array.isArray(parsedContent)) { + throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.NOT_ARRAY); + } + return parsedContent; +}; + +const parseJSON = (fileContent: string) => { + try { + return JSON.parse(fileContent); + } catch (error) { + if (error instanceof RangeError) { + throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.TOO_LARGE_TO_PARSE); + } + throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.CAN_NOT_PARSE); + } +}; + +const convertFormat = (row: SplunkRow): OriginalRule => { + if (!isPlainObject(row) || !isPlainObject(row.result)) { + throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.NOT_OBJECT); + } + const originalRule: Partial = { + id: row.result.id, + vendor: 'splunk', + title: row.result.title, + query: row.result.search, + query_language: 'spl', + description: row.result['action.escu.eli5']?.trim() || row.result.description, + }; + + if (row.result['action.correlationsearch.annotations']) { + try { + originalRule.annotations = JSON.parse(row.result['action.correlationsearch.annotations']); + } catch (error) { + delete originalRule.annotations; + } + } + return originalRule as OriginalRule; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx new file mode 100644 index 0000000000000..0f9787a4ddf68 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx @@ -0,0 +1,122 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback, useMemo, useState } from 'react'; +import { EuiFilePicker, EuiFormRow, EuiText } from '@elastic/eui'; +import type { OriginalRule } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { CreateMigration } from '../../../../../../service/hooks/use_create_migration'; +import { parseContent } from './parse_rules_file'; +import * as i18n from './translations'; + +export interface RulesFileUploadProps { + createMigration: CreateMigration; + apiError?: string; + isLoading?: boolean; + isCreated?: boolean; +} +export const RulesFileUpload = React.memo( + ({ createMigration, apiError, isLoading, isCreated }) => { + const [isParsing, setIsParsing] = useState(false); + const [fileError, setFileError] = useState(); + + const onChangeFile = useCallback( + (files: FileList | null) => { + if (!files) { + return; + } + + setFileError(undefined); + + const rulesFile = files[0]; + const reader = new FileReader(); + + reader.onloadstart = () => setIsParsing(true); + reader.onloadend = () => setIsParsing(false); + + reader.onload = function (e) { + // We can safely cast to string since we call `readAsText` to load the file. + const fileContent = e.target?.result as string | undefined; + + if (fileContent == null) { + setFileError(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.CAN_NOT_READ); + return; + } + + if (fileContent === '' && e.loaded > 100000) { + // V8-based browsers can't handle large files and return an empty string + // instead of an error; see https://stackoverflow.com/a/61316641 + setFileError(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.TOO_LARGE_TO_PARSE); + return; + } + + let data: OriginalRule[]; + try { + data = parseContent(fileContent); + createMigration(data); + } catch (err) { + setFileError(err.message); + } + }; + + const handleReaderError = function () { + const message = reader.error?.message; + if (message) { + setFileError(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.CAN_NOT_READ_WITH_REASON(message)); + } else { + setFileError(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.CAN_NOT_READ); + } + }; + + reader.onerror = handleReaderError; + reader.onabort = handleReaderError; + + reader.readAsText(rulesFile); + }, + [createMigration] + ); + + const error = useMemo(() => { + if (apiError) { + return apiError; + } + return fileError; + }, [apiError, fileError]); + + return ( + + {error} + + } + isInvalid={error != null} + fullWidth + > + + + {i18n.RULES_DATA_INPUT_FILE_UPLOAD_PROMPT} + + + } + accept="application/json" + onChange={onChangeFile} + display="large" + aria-label="Upload logs sample file" + isLoading={isParsing || isLoading} + disabled={isLoading || isCreated} + data-test-subj="rulesFilePicker" + data-loading={isParsing} + /> + + ); + } +); +RulesFileUpload.displayName = 'RulesFileUpload'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts new file mode 100644 index 0000000000000..675eed61f4973 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const RULES_DATA_INPUT_FILE_UPLOAD_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.title', + { defaultMessage: 'Update your rule export' } +); +export const RULES_DATA_INPUT_FILE_UPLOAD_PROMPT = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.prompt', + { defaultMessage: 'Select or drag and drop the exported JSON file' } +); + +export const RULES_DATA_INPUT_FILE_UPLOAD_ERROR = { + CAN_NOT_READ: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.canNotRead', + { defaultMessage: 'Failed to read the rules export file' } + ), + CAN_NOT_READ_WITH_REASON: (reason: string) => + i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.canNotReadWithReason', + { + defaultMessage: 'An error occurred when reading rules export file: {reason}', + values: { reason }, + } + ), + CAN_NOT_PARSE: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.canNotParse', + { defaultMessage: 'Cannot parse the rules export file as either a JSON file' } + ), + TOO_LARGE_TO_PARSE: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.tooLargeToParse', + { defaultMessage: 'This rules export file is too large to parse' } + ), + NOT_ARRAY: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.notArray', + { defaultMessage: 'The rules export file is not an array' } + ), + EMPTY: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.empty', + { defaultMessage: 'The rules export file is empty' } + ), + NOT_OBJECT: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.notObject', + { defaultMessage: 'The rules export file contains non-object entries' } + ), + WRONG_FORMAT: (formatError: string) => { + return i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.wrongFormat', + { + defaultMessage: 'The rules export file has wrong format: {formatError}', + values: { formatError }, + } + ); + }, +}; + +export const RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.createSuccess', + { defaultMessage: 'Rules uploaded successfully' } +); +export const RULES_DATA_INPUT_CREATE_MIGRATION_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.createError', + { defaultMessage: 'Failed to upload rules file' } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/translations.ts new file mode 100644 index 0000000000000..5446180d03a75 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/translations.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const RULES_DATA_INPUT_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.title', + { defaultMessage: 'Upload rule export and check for macros and lookups' } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts new file mode 100644 index 0000000000000..16d8f60043bcb --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { RuleMigrationTaskStats } from '../../../../../common/siem_migrations/model/rule_migration.gen'; + +export type OnMigrationCreated = (migrationStats: RuleMigrationTaskStats) => void; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/index.tsx index 728873f046d2e..3f255a49f87c2 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/index.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/index.tsx @@ -10,13 +10,13 @@ import React, { useMemo } from 'react'; import type { EuiComboBoxOptionOption } from '@elastic/eui'; import { EuiComboBox, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import * as i18n from './translations'; -import type { RuleMigrationTask } from '../../types'; +import type { RuleMigrationStats } from '../../types'; export interface HeaderButtonsProps { /** * Available rule migrations stats */ - ruleMigrationsStats: RuleMigrationTask[]; + ruleMigrationsStats: RuleMigrationStats[]; /** * Selected rule migration id diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/pages/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/pages/index.tsx index 018aa5d77559e..3877a6f46cbe7 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/pages/index.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/pages/index.tsx @@ -21,7 +21,7 @@ import { NeedAdminForUpdateRulesCallOut } from '../../../detections/components/c import { MissingPrivilegesCallOut } from '../../../detections/components/callouts/missing_privileges_callout'; import { HeaderButtons } from '../components/header_buttons'; import { UnknownMigration } from '../components/unknown_migration'; -import { useLatestStats } from '../hooks/use_latest_stats'; +import { useLatestStats } from '../service/hooks/use_latest_stats'; type MigrationRulesPageProps = RouteComponentProps<{ migrationId?: string }>; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/common/api_request_reducer.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/common/api_request_reducer.ts new file mode 100644 index 0000000000000..a68432d48bf9c --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/common/api_request_reducer.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export interface State { + loading: boolean; + error: Error | null; +} +export type Action = { type: 'start' } | { type: 'error'; error: Error } | { type: 'success' }; + +export const initialState: State = { loading: false, error: null }; +export const reducer = (state: State, action: Action) => { + switch (action.type) { + case 'start': + return { loading: true, error: null }; + case 'error': + return { loading: false, error: action.error }; + case 'success': + return { loading: false, error: null }; + default: + return state; + } +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/translations.ts new file mode 100644 index 0000000000000..936bc07e6576e --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/translations.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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.createSuccess', + { defaultMessage: 'Rules uploaded successfully' } +); +export const RULES_DATA_INPUT_CREATE_MIGRATION_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.createError', + { defaultMessage: 'Failed to upload rules file' } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts new file mode 100644 index 0000000000000..94082cf59d359 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useCallback, useReducer } from 'react'; +import { i18n } from '@kbn/i18n'; +import type { RuleMigrationTaskStats } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { CreateRuleMigrationRequestBody } from '../../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; +import { useKibana } from '../../../../common/lib/kibana/kibana_react'; +import { reducer, initialState } from './common/api_request_reducer'; + +export const RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.service.createRuleSuccess', + { defaultMessage: 'Rules uploaded successfully' } +); +export const RULES_DATA_INPUT_CREATE_MIGRATION_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.service.createRuleError', + { defaultMessage: 'Failed to upload rules file' } +); + +export type CreateMigration = (data: CreateRuleMigrationRequestBody) => void; +export type OnSuccess = (migrationStats: RuleMigrationTaskStats) => void; + +export const useCreateMigration = (onSuccess: OnSuccess) => { + const { siemMigrations, notifications } = useKibana().services; + const [state, dispatch] = useReducer(reducer, initialState); + + const createMigration = useCallback( + (data) => { + (async () => { + try { + dispatch({ type: 'start' }); + const migrationId = await siemMigrations.rules.createRuleMigration(data); + const stats = await siemMigrations.rules.getRuleMigrationStats(migrationId); + + notifications.toasts.addSuccess(RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS); + onSuccess(stats); + dispatch({ type: 'success' }); + } catch (err) { + const apiError = err.body ?? err; + notifications.toasts.addError(apiError, { + title: RULES_DATA_INPUT_CREATE_MIGRATION_ERROR, + }); + dispatch({ type: 'error', error: apiError }); + } + })(); + }, + [siemMigrations.rules, notifications.toasts, onSuccess] + ); + + return { isLoading: state.loading, error: state.error, createMigration }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_latest_stats.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts similarity index 91% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_latest_stats.ts rename to x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts index c681af0d2a21c..8b692f07eb3cb 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_latest_stats.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts @@ -7,7 +7,7 @@ import useObservable from 'react-use/lib/useObservable'; import { useEffect, useMemo } from 'react'; -import { useKibana } from '../../../common/lib/kibana'; +import { useKibana } from '../../../../common/lib/kibana/kibana_react'; export const useLatestStats = () => { const { siemMigrations } = useKibana().services; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_start_migration.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_start_migration.ts new file mode 100644 index 0000000000000..6794439d1298e --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_start_migration.ts @@ -0,0 +1,52 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useCallback, useReducer } from 'react'; +import { i18n } from '@kbn/i18n'; +import { useKibana } from '../../../../common/lib/kibana/kibana_react'; +import { reducer, initialState } from './common/api_request_reducer'; + +export const RULES_DATA_INPUT_START_MIGRATION_SUCCESS = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.service.startMigrationSuccess', + { defaultMessage: 'Migration started successfully.' } +); +export const RULES_DATA_INPUT_START_MIGRATION_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.service.startMigrationError', + { defaultMessage: 'Error starting migration.' } +); + +export type StartMigration = (migrationId: string) => void; +export type OnSuccess = () => void; + +export const useStartMigration = (onSuccess?: OnSuccess) => { + const { siemMigrations, notifications } = useKibana().services; + const [state, dispatch] = useReducer(reducer, initialState); + + const startMigration = useCallback( + (migrationId) => { + (async () => { + try { + dispatch({ type: 'start' }); + await siemMigrations.rules.startRuleMigration(migrationId); + + notifications.toasts.addSuccess(RULES_DATA_INPUT_START_MIGRATION_SUCCESS); + dispatch({ type: 'success' }); + onSuccess?.(); + } catch (err) { + const apiError = err.body ?? err; + notifications.toasts.addError(apiError, { + title: RULES_DATA_INPUT_START_MIGRATION_ERROR, + }); + dispatch({ type: 'error', error: apiError }); + } + })(); + }, + [siemMigrations.rules, notifications.toasts, onSuccess] + ); + + return { isLoading: state.loading, error: state.error, startMigration }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts index 3162cc3d58e63..c13b0606d771d 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts @@ -7,28 +7,55 @@ import { BehaviorSubject, type Observable } from 'rxjs'; import type { CoreStart } from '@kbn/core/public'; -import { i18n } from '@kbn/i18n'; +import type { TraceOptions } from '@kbn/elastic-assistant/impl/assistant/types'; +import { + DEFAULT_ASSISTANT_NAMESPACE, + TRACE_OPTIONS_SESSION_STORAGE_KEY, +} from '@kbn/elastic-assistant/impl/assistant_context/constants'; +import type { LangSmithOptions } from '../../../../common/siem_migrations/model/common.gen'; +import type { RuleMigrationTaskStats } from '../../../../common/siem_migrations/model/rule_migration.gen'; +import type { + CreateRuleMigrationRequestBody, + GetAllStatsRuleMigrationResponse, + GetRuleMigrationStatsResponse, +} from '../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; import { SiemMigrationTaskStatus } from '../../../../common/siem_migrations/constants'; import type { StartPluginsDependencies } from '../../../types'; import { ExperimentalFeaturesService } from '../../../common/experimental_features_service'; import { licenseService } from '../../../common/hooks/use_license'; -import { getRuleMigrationsStatsAll, startRuleMigration } from '../api'; -import type { RuleMigrationTask } from '../types'; +import { + createRuleMigration, + getRuleMigrationStats, + getRuleMigrationsStatsAll, + startRuleMigration, + type GetRuleMigrationsStatsAllParams, +} from '../api'; +import type { RuleMigrationStats } from '../types'; import { getSuccessToast } from './success_notification'; import { RuleMigrationsStorage } from './storage'; +import * as i18n from './translations'; + +// use the default assistant namespace since it's the only one we use +const NAMESPACE_TRACE_OPTIONS_SESSION_STORAGE_KEY = + `${DEFAULT_ASSISTANT_NAMESPACE}.${TRACE_OPTIONS_SESSION_STORAGE_KEY}` as const; + +const REQUEST_POLLING_INTERVAL_MS = 5000 as const; +const CREATE_MIGRATION_BODY_BATCH_SIZE = 50 as const; export class SiemRulesMigrationsService { - private readonly pollingInterval = 5000; - private readonly latestStats$: BehaviorSubject; - private readonly signal = new AbortController().signal; + private readonly latestStats$: BehaviorSubject; private isPolling = false; - public connectorIdStorage = new RuleMigrationsStorage('connectorId'); + public connectorIdStorage = new RuleMigrationsStorage('connectorId'); + public traceOptionsStorage = new RuleMigrationsStorage('traceOptions', { + customKey: NAMESPACE_TRACE_OPTIONS_SESSION_STORAGE_KEY, + storageType: 'session', + }); constructor( private readonly core: CoreStart, private readonly plugins: StartPluginsDependencies ) { - this.latestStats$ = new BehaviorSubject([]); + this.latestStats$ = new BehaviorSubject([]); this.plugins.spaces.getActiveSpace().then((space) => { this.connectorIdStorage.setSpaceId(space.id); @@ -36,7 +63,7 @@ export class SiemRulesMigrationsService { }); } - public getLatestStats$(): Observable { + public getLatestStats$(): Observable { return this.latestStats$.asObservable(); } @@ -48,27 +75,92 @@ export class SiemRulesMigrationsService { if (this.isPolling || !this.isAvailable()) { return; } - this.isPolling = true; - this.startStatsPolling() + this.startTaskStatsPolling() .catch((e) => { - this.core.notifications.toasts.addError(e, { - title: i18n.translate( - 'xpack.securitySolution.siemMigrations.rulesService.polling.errorTitle', - { defaultMessage: 'Error fetching rule migrations' } - ), - }); + this.core.notifications.toasts.addError(e, { title: i18n.POLLING_ERROR }); }) .finally(() => { this.isPolling = false; }); } - private async startStatsPolling(): Promise { + public async createRuleMigration(body: CreateRuleMigrationRequestBody): Promise { + if (body.length === 0) { + throw new Error(i18n.EMPTY_RULES_ERROR); + } + // Batching creation to avoid hitting the max payload size limit of the API + let migrationId: string | undefined; + for (let i = 0; i < body.length; i += CREATE_MIGRATION_BODY_BATCH_SIZE) { + const bodyBatch = body.slice(i, i + CREATE_MIGRATION_BODY_BATCH_SIZE); + const response = await createRuleMigration({ migrationId, body: bodyBatch }); + migrationId = response.migration_id; + } + return migrationId as string; + } + + public async startRuleMigration(migrationId: string): Promise { + const connectorId = this.connectorIdStorage.get(); + if (!connectorId) { + throw new Error(i18n.MISSING_CONNECTOR_ERROR); + } + + const langSmithSettings = this.traceOptionsStorage.get(); + let langSmithOptions: LangSmithOptions | undefined; + if (langSmithSettings) { + langSmithOptions = { + project_name: langSmithSettings.langSmithProject, + api_key: langSmithSettings.langSmithApiKey, + }; + } + + const result = await startRuleMigration({ migrationId, connectorId, langSmithOptions }); + this.startPolling(); + return result; + } + + public async getRuleMigrationStats(migrationId: string): Promise { + return getRuleMigrationStats({ migrationId }); + } + + public async getRuleMigrationsStats( + params: GetRuleMigrationsStatsAllParams = {} + ): Promise { + const allStats = await this.getRuleMigrationsStatsWithRetry(params); + const results = allStats.map( + // the array order (by creation) is guaranteed by the API + (stats, index) => ({ ...stats, number: index + 1 } as RuleMigrationStats) // needs cast because of the `status` enum override + ); + this.latestStats$.next(results); // Always update the latest stats + return results; + } + + private async getRuleMigrationsStatsWithRetry( + params: GetRuleMigrationsStatsAllParams = {}, + sleepSecs?: number + ): Promise { + if (sleepSecs) { + await new Promise((resolve) => setTimeout(resolve, sleepSecs * 1000)); + } + + return getRuleMigrationsStatsAll(params).catch((e) => { + // Retry only on network errors (no status) and 503s, otherwise throw + if (e.status && e.status !== 503) { + throw e; + } + const nextSleepSecs = sleepSecs ? sleepSecs * 2 : 1; // Exponential backoff + if (nextSleepSecs > 60) { + // Wait for a minutes max (two minutes total) for the API to be available again + throw e; + } + return this.getRuleMigrationsStatsWithRetry(params, nextSleepSecs); + }); + } + + private async startTaskStatsPolling(): Promise { let pendingMigrationIds: string[] = []; do { - const results = await this.fetchRuleMigrationTasksStats(); - this.latestStats$.next(results); + const results = await this.getRuleMigrationsStats(); if (pendingMigrationIds.length > 0) { // send notifications for finished migrations @@ -91,22 +183,13 @@ export class SiemRulesMigrationsService { const connectorId = this.connectorIdStorage.get(); if (connectorId) { // automatically resume stopped migrations when connector is available - await startRuleMigration({ - migrationId: result.id, - body: { connector_id: connectorId }, - signal: this.signal, - }); + await startRuleMigration({ migrationId: result.id, connectorId }); pendingMigrationIds.push(result.id); } } } - await new Promise((resolve) => setTimeout(resolve, this.pollingInterval)); + await new Promise((resolve) => setTimeout(resolve, REQUEST_POLLING_INTERVAL_MS)); } while (pendingMigrationIds.length > 0); } - - private async fetchRuleMigrationTasksStats(): Promise { - const stats = await getRuleMigrationsStatsAll({ signal: this.signal }); - return stats.map((stat, index) => ({ ...stat, number: index + 1 })); // the array order (by creation) is guaranteed by the API - } } diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/storage.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/storage.ts index bbf53ec3a5404..874f1b05dfab6 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/storage.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/storage.ts @@ -7,23 +7,37 @@ import { Storage } from '@kbn/kibana-utils-plugin/public'; -export class RuleMigrationsStorage { - private readonly storage = new Storage(localStorage); +const storages = { + local: new Storage(localStorage), + session: new Storage(sessionStorage), +} as const; + +interface Options { + customKey?: string; + storageType?: keyof typeof storages; +} + +export class RuleMigrationsStorage { + private readonly storage: Storage; public key: string; - constructor(private readonly objectName: string, spaceId?: string) { - this.key = this.getStorageKey(spaceId); + constructor(private readonly objectName: string, private readonly options?: Options) { + this.storage = storages[this.options?.storageType ?? 'local']; + this.key = this.getKey(); } - private getStorageKey(spaceId: string = 'default') { + private getKey(spaceId: string = 'default'): string { + if (this.options?.customKey) { + return this.options.customKey; + } return `siem_migrations.rules.${this.objectName}.${spaceId}`; } public setSpaceId(spaceId: string) { - this.key = this.getStorageKey(spaceId); + this.key = this.getKey(spaceId); } - public get = () => this.storage.get(this.key); - public set = (value: string) => this.storage.set(this.key, value); + public get = (): T | undefined => this.storage.get(this.key); + public set = (value: T) => this.storage.set(this.key, value); public remove = () => this.storage.remove(this.key); } diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/success_notification.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/success_notification.tsx index 830e3c5f4a531..f87755943f830 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/success_notification.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/success_notification.tsx @@ -17,9 +17,9 @@ import type { ToastInput } from '@kbn/core-notifications-browser'; import { toMountPoint } from '@kbn/react-kibana-mount'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import type { RuleMigrationTask } from '../types'; +import type { RuleMigrationStats } from '../types'; -export const getSuccessToast = (migration: RuleMigrationTask, core: CoreStart): ToastInput => ({ +export const getSuccessToast = (migration: RuleMigrationStats, core: CoreStart): ToastInput => ({ color: 'success', iconType: 'check', toastLifeTimeMs: 1000 * 60 * 30, // 30 minutes @@ -34,7 +34,7 @@ export const getSuccessToast = (migration: RuleMigrationTask, core: CoreStart): ), }); -const SuccessToastContent: React.FC<{ migration: RuleMigrationTask }> = ({ migration }) => { +const SuccessToastContent: React.FC<{ migration: RuleMigrationStats }> = ({ migration }) => { const navigation = { deepLinkId: SecurityPageName.siemMigrationsRules, path: migration.id }; const { navigateTo, getAppUrl } = useNavigation(); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/translations.ts new file mode 100644 index 0000000000000..41a897a56e9df --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/translations.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const POLLING_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rulesService.pollingError', + { defaultMessage: 'Error fetching rule migrations' } +); + +export const MISSING_CONNECTOR_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rulesService.create.missingConnectorError', + { defaultMessage: 'Connector not defined. Please set a connector ID first.' } +); + +export const EMPTY_RULES_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rulesService.create.emptyRulesError', + { defaultMessage: 'Can not create a migration without rules' } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/types.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/types.ts index 4c704e97179c0..bcc11327d1051 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/types.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/types.ts @@ -5,9 +5,11 @@ * 2.0. */ +import type { SiemMigrationTaskStatus } from '../../../common/siem_migrations/constants'; import type { RuleMigrationTaskStats } from '../../../common/siem_migrations/model/rule_migration.gen'; -export interface RuleMigrationTask extends RuleMigrationTaskStats { +export interface RuleMigrationStats extends RuleMigrationTaskStats { + status: SiemMigrationTaskStatus; /** The sequential number of the migration */ number: number; } diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts index 21a17bb7834a1..7c94631be6b65 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts @@ -8,9 +8,10 @@ import type { IKibanaResponse, Logger } from '@kbn/core/server'; import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; import { v4 as uuidV4 } from 'uuid'; -import { SIEM_RULE_MIGRATIONS_PATH } from '../../../../../common/siem_migrations/constants'; +import { SIEM_RULE_MIGRATION_CREATE_PATH } from '../../../../../common/siem_migrations/constants'; import { CreateRuleMigrationRequestBody, + CreateRuleMigrationRequestParams, type CreateRuleMigrationResponse, } from '../../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; import type { SecuritySolutionPluginRouter } from '../../../../types'; @@ -23,7 +24,7 @@ export const registerSiemRuleMigrationsCreateRoute = ( ) => { router.versioned .post({ - path: SIEM_RULE_MIGRATIONS_PATH, + path: SIEM_RULE_MIGRATION_CREATE_PATH, access: 'internal', security: { authz: { requiredPrivileges: ['securitySolution'] } }, }) @@ -31,18 +32,20 @@ export const registerSiemRuleMigrationsCreateRoute = ( { version: '1', validate: { - request: { body: buildRouteValidationWithZod(CreateRuleMigrationRequestBody) }, + request: { + body: buildRouteValidationWithZod(CreateRuleMigrationRequestBody), + params: buildRouteValidationWithZod(CreateRuleMigrationRequestParams), + }, }, }, withLicense( async (context, req, res): Promise> => { const originalRules = req.body; + const migrationId = req.params.migration_id ?? uuidV4(); try { const ctx = await context.resolve(['securitySolution']); const ruleMigrationsClient = ctx.securitySolution.getSiemRuleMigrationsClient(); - const migrationId = uuidV4(); - const ruleMigrations = originalRules.map((originalRule) => ({ migration_id: migrationId, original_rule: originalRule, diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts index b9645a3de374e..dd13a75cdf83a 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts @@ -14,6 +14,7 @@ import { } from '../../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; import { SIEM_RULE_MIGRATION_PATH } from '../../../../../common/siem_migrations/constants'; import type { SecuritySolutionPluginRouter } from '../../../../types'; +import type { RuleMigrationGetOptions } from '../data/rule_migrations_data_rules_client'; import { withLicense } from './util/with_license'; export const registerSiemRuleMigrationsGetRoute = ( @@ -43,20 +44,13 @@ export const registerSiemRuleMigrationsGetRoute = ( const ctx = await context.resolve(['securitySolution']); const ruleMigrationsClient = ctx.securitySolution.getSiemRuleMigrationsClient(); - let from = 0; - if (page && perPage) { - from = page * perPage; - } - const size = perPage; + const options: RuleMigrationGetOptions = { + filters: { searchTerm }, + size: perPage, + from: page && perPage ? page * perPage : 0, + }; - const result = await ruleMigrationsClient.data.rules.get( - { - migrationId, - searchTerm, - }, - from, - size - ); + const result = await ruleMigrationsClient.data.rules.get(migrationId, options); return res.ok({ body: result }); } catch (err) { diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts index df86a1f953656..2fce95be9dafe 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts @@ -177,10 +177,8 @@ export const installTranslated = async ({ const detectionRulesClient = securitySolutionContext.getDetectionRulesClient(); const ruleMigrationsClient = securitySolutionContext.getSiemRuleMigrationsClient(); - const { data: rulesToInstall } = await ruleMigrationsClient.data.rules.get({ - migrationId, - ids, - installable: true, + const { data: rulesToInstall } = await ruleMigrationsClient.data.rules.get(migrationId, { + filters: { ids, installable: true }, }); const { customRulesToInstall, prebuiltRulesToInstall } = rulesToInstall.reduce( diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts index 209f2e4416e16..716d19ce16cdf 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts @@ -38,32 +38,23 @@ export type UpdateRuleMigrationInput = { elastic_rule?: Partial } & export type RuleMigrationDataStats = Omit; export type RuleMigrationAllDataStats = RuleMigrationDataStats[]; -export interface RuleMigrationFilterOptions { - migrationId: string; +export interface RuleMigrationFilters { status?: SiemMigrationStatus | SiemMigrationStatus[]; ids?: string[]; installable?: boolean; searchTerm?: string; } +export interface RuleMigrationGetOptions { + filters?: RuleMigrationFilters; + from?: number; + size?: number; +} /* BULK_MAX_SIZE defines the number to break down the bulk operations by. * The 500 number was chosen as a reasonable number to avoid large payloads. It can be adjusted if needed. */ const BULK_MAX_SIZE = 500 as const; - -const getInstallableConditions = (): QueryDslQueryContainer[] => { - return [ - { term: { translation_result: SiemMigrationRuleTranslationResult.FULL } }, - { - nested: { - path: 'elastic_rule', - query: { - bool: { must_not: { exists: { field: 'elastic_rule.id' } } }, - }, - }, - }, - ]; -}; +/* The default number of rule migrations to retrieve in a single GET request. */ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient { /** Indexes an array of rule migrations to be processed */ @@ -128,12 +119,11 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient /** Retrieves an array of rule documents of a specific migrations */ async get( - filters: RuleMigrationFilterOptions, - from?: number, - size?: number + migrationId: string, + { filters = {}, from, size }: RuleMigrationGetOptions = {} ): Promise<{ total: number; data: StoredRuleMigration[] }> { const index = await this.getIndexName(); - const query = this.getFilterQuery(filters); + const query = this.getFilterQuery(migrationId, { ...filters }); const result = await this.esClient .search({ index, query, sort: '_doc', from, size }) @@ -155,7 +145,7 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient */ async takePending(migrationId: string, size: number): Promise { const index = await this.getIndexName(); - const query = this.getFilterQuery({ migrationId, status: SiemMigrationStatus.PENDING }); + const query = this.getFilterQuery(migrationId, { status: SiemMigrationStatus.PENDING }); const storedRuleMigrations = await this.esClient .search({ index, query, sort: '_doc', size }) @@ -234,7 +224,7 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient { refresh = false }: { refresh?: boolean } = {} ): Promise { const index = await this.getIndexName(); - const query = this.getFilterQuery({ migrationId, status: statusToQuery }); + const query = this.getFilterQuery(migrationId, { status: statusToQuery }); const script = { source: `ctx._source['status'] = '${statusToUpdate}'` }; await this.esClient.updateByQuery({ index, query, script, refresh }).catch((error) => { this.logger.error(`Error updating rule migrations status: ${error.message}`); @@ -245,24 +235,11 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient /** Retrieves the translation stats for the rule migrations with the provided id */ async getTranslationStats(migrationId: string): Promise { const index = await this.getIndexName(); - const query = this.getFilterQuery({ migrationId }); + const query = this.getFilterQuery(migrationId); const aggregations = { - prebuilt: { - filter: { - nested: { - path: 'elastic_rule', - query: { exists: { field: 'elastic_rule.prebuilt_rule_id' } }, - }, - }, - }, - installable: { - filter: { - bool: { - must: getInstallableConditions(), - }, - }, - }, + prebuilt: { filter: conditions.isPrebuilt() }, + installable: { filter: { bool: { must: conditions.isInstallable() } } }, }; const result = await this.esClient .search({ index, query, aggregations, _source: false }) @@ -288,7 +265,7 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient /** Retrieves the stats for the rule migrations with the provided id */ async getStats(migrationId: string): Promise { const index = await this.getIndexName(); - const query = this.getFilterQuery({ migrationId }); + const query = this.getFilterQuery(migrationId); const aggregations = { pending: { filter: { term: { status: SiemMigrationStatus.PENDING } } }, processing: { filter: { term: { status: SiemMigrationStatus.PROCESSING } } }, @@ -358,13 +335,10 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient })); } - private getFilterQuery({ - migrationId, - status, - ids, - installable, - searchTerm, - }: RuleMigrationFilterOptions): QueryDslQueryContainer { + private getFilterQuery( + migrationId: string, + { status, ids, installable, searchTerm }: RuleMigrationFilters = {} + ): QueryDslQueryContainer { const filter: QueryDslQueryContainer[] = [{ term: { migration_id: migrationId } }]; if (status) { if (Array.isArray(status)) { @@ -377,16 +351,44 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient filter.push({ terms: { _id: ids } }); } if (installable) { - filter.push(...getInstallableConditions()); + filter.push(...conditions.isInstallable()); } if (searchTerm?.length) { - filter.push({ - nested: { - path: 'elastic_rule', - query: { match: { 'elastic_rule.title': searchTerm } }, - }, - }); + filter.push(conditions.matchTitle(searchTerm)); } return { bool: { filter } }; } } + +const conditions = { + isFullyTranslated(): QueryDslQueryContainer { + return { term: { translation_result: SiemMigrationRuleTranslationResult.FULL } }; + }, + isNotInstalled(): QueryDslQueryContainer { + return { + nested: { + path: 'elastic_rule', + query: { bool: { must_not: { exists: { field: 'elastic_rule.id' } } } }, + }, + }; + }, + isPrebuilt(): QueryDslQueryContainer { + return { + nested: { + path: 'elastic_rule', + query: { exists: { field: 'elastic_rule.prebuilt_rule_id' } }, + }, + }; + }, + matchTitle(title: string): QueryDslQueryContainer { + return { + nested: { + path: 'elastic_rule', + query: { match: { 'elastic_rule.title': title } }, + }, + }; + }, + isInstallable(): QueryDslQueryContainer[] { + return [this.isFullyTranslated(), this.isNotInstalled()]; + }, +}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts index 09a4bef34c279..f63953192844b 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts @@ -23,7 +23,8 @@ export const ruleMigrationsFieldMap: FieldMap async (state) => { - const mitreAttackIds = state.original_rule.mitre_attack_ids; + const mitreAttackIds = state.original_rule.annotations?.mitre_attack; if (!mitreAttackIds?.length) { return {}; } diff --git a/x-pack/plugins/serverless/public/plugin.tsx b/x-pack/plugins/serverless/public/plugin.tsx index dbb75788c105b..a488658e9bb94 100644 --- a/x-pack/plugins/serverless/public/plugin.tsx +++ b/x-pack/plugins/serverless/public/plugin.tsx @@ -83,7 +83,7 @@ export class ServerlessPlugin core.chrome.navControls.registerRight({ order: 1, mount: toMountPoint( - + + diff --git a/x-pack/plugins/serverless_search/common/i18n_string.ts b/x-pack/plugins/serverless_search/common/i18n_string.ts index 32ec0cf8eb957..d77998bc8cc53 100644 --- a/x-pack/plugins/serverless_search/common/i18n_string.ts +++ b/x-pack/plugins/serverless_search/common/i18n_string.ts @@ -68,7 +68,7 @@ export const CONNECTOR_LABEL: string = i18n.translate('xpack.serverlessSearch.co export const WEB_CRAWLERS_LABEL: string = i18n.translate( 'xpack.serverlessSearch.webCrawlersLabel', { - defaultMessage: 'Web crawlers', + defaultMessage: 'Web Crawlers', } ); diff --git a/x-pack/plugins/serverless_search/public/application/components/web_crawlers/empty_web_crawlers_prompt.tsx b/x-pack/plugins/serverless_search/public/application/components/web_crawlers/empty_web_crawlers_prompt.tsx index 8170ed6da3134..20c05f86747a8 100644 --- a/x-pack/plugins/serverless_search/public/application/components/web_crawlers/empty_web_crawlers_prompt.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/web_crawlers/empty_web_crawlers_prompt.tsx @@ -230,6 +230,7 @@ export const EmptyWebCrawlersPrompt: React.FC = () => { fill iconType={githubIcon} href={'https://github.com/elastic/crawler'} + target="_blank" > {i18n.translate('xpack.serverlessSearch.webCrawlersEmpty.selfManagedButton', { defaultMessage: 'Self-managed web crawler', diff --git a/x-pack/plugins/serverless_search/public/application/components/web_crawlers_elastic_managed.tsx b/x-pack/plugins/serverless_search/public/application/components/web_crawlers_elastic_managed.tsx index 8ac5a0c59dd14..0cf3445f0a5b8 100644 --- a/x-pack/plugins/serverless_search/public/application/components/web_crawlers_elastic_managed.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/web_crawlers_elastic_managed.tsx @@ -27,7 +27,7 @@ export const WebCrawlersElasticManaged = () => { { 500)', + result: + '(ctx.http?.response?.status_code !== null && ((ctx.http?.response?.status_code instanceof String && Float.parseFloat(ctx.http?.response?.status_code) > 500) || ctx.http?.response?.status_code > 500))', }, { condition: { field: 'http.response.status_code', operator: 'gte' as const, value: 500 }, - result: '(ctx.http?.response?.status_code !== null && ctx.http?.response?.status_code >= 500)', + result: + '(ctx.http?.response?.status_code !== null && ((ctx.http?.response?.status_code instanceof String && Float.parseFloat(ctx.http?.response?.status_code) >= 500) || ctx.http?.response?.status_code >= 500))', }, { condition: { field: 'log.logger', operator: 'startsWith' as const, value: 'nginx' }, - result: '(ctx.log?.logger !== null && ctx.log?.logger.startsWith("nginx"))', + result: + '(ctx.log?.logger !== null && ((ctx.log?.logger instanceof Number && ctx.log?.logger.toString().startsWith("nginx")) || ctx.log?.logger.startsWith("nginx")))', }, { condition: { field: 'log.logger', operator: 'endsWith' as const, value: 'proxy' }, - result: '(ctx.log?.logger !== null && ctx.log?.logger.endsWith("proxy"))', + result: + '(ctx.log?.logger !== null && ((ctx.log?.logger instanceof Number && ctx.log?.logger.toString().endsWith("proxy")) || ctx.log?.logger.endsWith("proxy")))', }, { condition: { field: 'log.logger', operator: 'contains' as const, value: 'proxy' }, - result: '(ctx.log?.logger !== null && ctx.log?.logger.contains("proxy"))', + result: + '(ctx.log?.logger !== null && ((ctx.log?.logger instanceof Number && ctx.log?.logger.toString().contains("proxy")) || ctx.log?.logger.contains("proxy")))', }, { condition: { field: 'log.logger', operator: 'exists' as const }, @@ -55,87 +64,152 @@ const operatorConditionAndResults = [ ]; describe('conditionToPainless', () => { - describe('operators', () => { - operatorConditionAndResults.forEach((setup) => { - test(`${setup.condition.operator}`, () => { - expect(conditionToPainless(setup.condition)).toEqual(setup.result); + describe('conditionToStatement', () => { + describe('operators', () => { + operatorConditionAndResults.forEach((setup) => { + test(`${setup.condition.operator}`, () => { + expect(conditionToStatement(setup.condition)).toEqual(setup.result); + }); }); - }); - }); - describe('and', () => { - test('simple', () => { - const condition = { - and: [ - { field: 'log.logger', operator: 'eq' as const, value: 'nginx_proxy' }, - { field: 'log.level', operator: 'eq' as const, value: 'error' }, - ], - }; - expect( - expect(conditionToPainless(condition)).toEqual( - '(ctx.log?.logger !== null && ctx.log?.logger == "nginx_proxy") && (ctx.log?.level !== null && ctx.log?.level == "error")' - ) - ); + test('ensure number comparasion works with string values', () => { + const condition = { + field: 'http.response.status_code', + operator: 'gt' as const, + value: '500', + }; + expect(conditionToStatement(condition)).toEqual( + '(ctx.http?.response?.status_code !== null && ((ctx.http?.response?.status_code instanceof String && Float.parseFloat(ctx.http?.response?.status_code) > 500) || ctx.http?.response?.status_code > 500))' + ); + }); + test('ensure string comparasion works with number values', () => { + const condition = { + field: 'message', + operator: 'contains' as const, + value: 500, + }; + expect(conditionToStatement(condition)).toEqual( + '(ctx.message !== null && ((ctx.message instanceof Number && ctx.message.toString().contains("500")) || ctx.message.contains("500")))' + ); + }); }); - }); - describe('or', () => { - test('simple', () => { - const condition = { - or: [ - { field: 'log.logger', operator: 'eq' as const, value: 'nginx_proxy' }, - { field: 'log.level', operator: 'eq' as const, value: 'error' }, - ], - }; - expect( - expect(conditionToPainless(condition)).toEqual( - '(ctx.log?.logger !== null && ctx.log?.logger == "nginx_proxy") || (ctx.log?.level !== null && ctx.log?.level == "error")' - ) - ); + describe('and', () => { + test('simple', () => { + const condition = { + and: [ + { field: 'log.logger', operator: 'eq' as const, value: 'nginx_proxy' }, + { field: 'log.level', operator: 'eq' as const, value: 'error' }, + ], + }; + expect( + expect(conditionToStatement(condition)).toEqual( + '(ctx.log?.logger !== null && ((ctx.log?.logger instanceof Number && ctx.log?.logger.toString() == "nginx_proxy") || ctx.log?.logger == "nginx_proxy")) && (ctx.log?.level !== null && ((ctx.log?.level instanceof Number && ctx.log?.level.toString() == "error") || ctx.log?.level == "error"))' + ) + ); + }); }); - }); - describe('nested', () => { - test('and with a filter and or with 2 filters', () => { - const condition = { - and: [ - { field: 'log.logger', operator: 'eq' as const, value: 'nginx_proxy' }, - { - or: [ - { field: 'log.level', operator: 'eq' as const, value: 'error' }, - { field: 'log.level', operator: 'eq' as const, value: 'ERROR' }, - ], - }, - ], - }; - expect( - expect(conditionToPainless(condition)).toEqual( - '(ctx.log?.logger !== null && ctx.log?.logger == "nginx_proxy") && ((ctx.log?.level !== null && ctx.log?.level == "error") || (ctx.log?.level !== null && ctx.log?.level == "ERROR"))' - ) - ); + describe('or', () => { + test('simple', () => { + const condition = { + or: [ + { field: 'log.logger', operator: 'eq' as const, value: 'nginx_proxy' }, + { field: 'log.level', operator: 'eq' as const, value: 'error' }, + ], + }; + expect( + expect(conditionToStatement(condition)).toEqual( + '(ctx.log?.logger !== null && ((ctx.log?.logger instanceof Number && ctx.log?.logger.toString() == "nginx_proxy") || ctx.log?.logger == "nginx_proxy")) || (ctx.log?.level !== null && ((ctx.log?.level instanceof Number && ctx.log?.level.toString() == "error") || ctx.log?.level == "error"))' + ) + ); + }); }); - test('and with 2 or with filters', () => { - const condition = { - and: [ - { - or: [ - { field: 'log.logger', operator: 'eq' as const, value: 'nginx_proxy' }, - { field: 'service.name', operator: 'eq' as const, value: 'nginx' }, - ], - }, - { - or: [ - { field: 'log.level', operator: 'eq' as const, value: 'error' }, - { field: 'log.level', operator: 'eq' as const, value: 'ERROR' }, - ], - }, - ], - }; - expect( - expect(conditionToPainless(condition)).toEqual( - '((ctx.log?.logger !== null && ctx.log?.logger == "nginx_proxy") || (ctx.service?.name !== null && ctx.service?.name == "nginx")) && ((ctx.log?.level !== null && ctx.log?.level == "error") || (ctx.log?.level !== null && ctx.log?.level == "ERROR"))' - ) - ); + + describe('nested', () => { + test('and with a filter and or with 2 filters', () => { + const condition = { + and: [ + { field: 'log.logger', operator: 'eq' as const, value: 'nginx_proxy' }, + { + or: [ + { field: 'log.level', operator: 'eq' as const, value: 'error' }, + { field: 'log.level', operator: 'eq' as const, value: 'ERROR' }, + ], + }, + ], + }; + expect( + expect(conditionToStatement(condition)).toEqual( + '(ctx.log?.logger !== null && ((ctx.log?.logger instanceof Number && ctx.log?.logger.toString() == "nginx_proxy") || ctx.log?.logger == "nginx_proxy")) && ((ctx.log?.level !== null && ((ctx.log?.level instanceof Number && ctx.log?.level.toString() == "error") || ctx.log?.level == "error")) || (ctx.log?.level !== null && ((ctx.log?.level instanceof Number && ctx.log?.level.toString() == "ERROR") || ctx.log?.level == "ERROR")))' + ) + ); + }); + test('and with 2 or with filters', () => { + const condition = { + and: [ + { + or: [ + { field: 'log.logger', operator: 'eq' as const, value: 'nginx_proxy' }, + { field: 'service.name', operator: 'eq' as const, value: 'nginx' }, + ], + }, + { + or: [ + { field: 'log.level', operator: 'eq' as const, value: 'error' }, + { field: 'log.level', operator: 'eq' as const, value: 'ERROR' }, + ], + }, + ], + }; + expect( + expect(conditionToStatement(condition)).toEqual( + '((ctx.log?.logger !== null && ((ctx.log?.logger instanceof Number && ctx.log?.logger.toString() == "nginx_proxy") || ctx.log?.logger == "nginx_proxy")) || (ctx.service?.name !== null && ((ctx.service?.name instanceof Number && ctx.service?.name.toString() == "nginx") || ctx.service?.name == "nginx"))) && ((ctx.log?.level !== null && ((ctx.log?.level instanceof Number && ctx.log?.level.toString() == "error") || ctx.log?.level == "error")) || (ctx.log?.level !== null && ((ctx.log?.level instanceof Number && ctx.log?.level.toString() == "ERROR") || ctx.log?.level == "ERROR")))' + ) + ); + }); }); }); + + test('wrapped with type checks for uinary conditions', () => { + const condition = { field: 'log', operator: 'exists' as const }; + expect(conditionToPainless(condition)).toEqual(`try { + if (ctx.log !== null) { + return true; + } + return false; +} catch (Exception e) { + return false; +} +`); + }); + + test('wrapped with typechecks and try/catch', () => { + const condition = { + and: [ + { field: 'log.logger', operator: 'eq' as const, value: 'nginx_proxy' }, + { + or: [ + { field: 'log.level', operator: 'eq' as const, value: 'error' }, + { field: 'log.level', operator: 'eq' as const, value: 'ERROR' }, + ], + }, + ], + }; + expect( + expect(conditionToPainless(condition)) + .toEqual(`if (ctx.log?.logger instanceof Map || ctx.log?.level instanceof Map) { + return false; +} +try { + if ((ctx.log?.logger !== null && ((ctx.log?.logger instanceof Number && ctx.log?.logger.toString() == "nginx_proxy") || ctx.log?.logger == "nginx_proxy")) && ((ctx.log?.level !== null && ((ctx.log?.level instanceof Number && ctx.log?.level.toString() == "error") || ctx.log?.level == "error")) || (ctx.log?.level !== null && ((ctx.log?.level instanceof Number && ctx.log?.level.toString() == "ERROR") || ctx.log?.level == "ERROR")))) { + return true; + } + return false; +} catch (Exception e) { + return false; +} +`) + ); + }); }); diff --git a/x-pack/plugins/streams/server/lib/streams/helpers/condition_to_painless.ts b/x-pack/plugins/streams/server/lib/streams/helpers/condition_to_painless.ts index 1894ebaa6226d..4da9b3beffae5 100644 --- a/x-pack/plugins/streams/server/lib/streams/helpers/condition_to_painless.ts +++ b/x-pack/plugins/streams/server/lib/streams/helpers/condition_to_painless.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { isBoolean, isString } from 'lodash'; +import { isBoolean, isString, uniq } from 'lodash'; import { BinaryFilterCondition, Condition, @@ -14,8 +14,11 @@ import { } from '../../../../common/types'; import { isAndCondition, isFilterCondition, isOrCondition } from './condition_guards'; -function safePainlessField(condition: FilterCondition) { - return `ctx.${condition.field.split('.').join('?.')}`; +function safePainlessField(conditionOrField: FilterCondition | string) { + if (isFilterCondition(conditionOrField)) { + return `ctx.${conditionOrField.field.split('.').join('?.')}`; + } + return `ctx.${conditionOrField.split('.').join('?.')}`; } function encodeValue(value: string | number | boolean) { @@ -31,23 +34,59 @@ function encodeValue(value: string | number | boolean) { function binaryToPainless(condition: BinaryFilterCondition) { switch (condition.operator) { case 'neq': - return `${safePainlessField(condition)} != ${encodeValue(condition.value)}`; + return `((${safePainlessField(condition)} instanceof Number && ${safePainlessField( + condition + )}.toString() != ${encodeValue(String(condition.value))}) || ${safePainlessField( + condition + )} != ${encodeValue(String(condition.value))})`; case 'lt': - return `${safePainlessField(condition)} < ${encodeValue(condition.value)}`; + return `((${safePainlessField( + condition + )} instanceof String && Float.parseFloat(${safePainlessField(condition)}) < ${encodeValue( + Number(condition.value) + )}) || ${safePainlessField(condition)} < ${encodeValue(Number(condition.value))})`; case 'lte': - return `${safePainlessField(condition)} <= ${encodeValue(condition.value)}`; + return `((${safePainlessField( + condition + )} instanceof String && Float.parseFloat(${safePainlessField(condition)}) <= ${encodeValue( + Number(condition.value) + )}) || ${safePainlessField(condition)} <= ${encodeValue(Number(condition.value))})`; case 'gt': - return `${safePainlessField(condition)} > ${encodeValue(condition.value)}`; + return `((${safePainlessField( + condition + )} instanceof String && Float.parseFloat(${safePainlessField(condition)}) > ${encodeValue( + Number(condition.value) + )}) || ${safePainlessField(condition)} > ${encodeValue(Number(condition.value))})`; case 'gte': - return `${safePainlessField(condition)} >= ${encodeValue(condition.value)}`; + return `((${safePainlessField( + condition + )} instanceof String && Float.parseFloat(${safePainlessField(condition)}) >= ${encodeValue( + Number(condition.value) + )}) || ${safePainlessField(condition)} >= ${encodeValue(Number(condition.value))})`; case 'startsWith': - return `${safePainlessField(condition)}.startsWith(${encodeValue(condition.value)})`; + return `((${safePainlessField(condition)} instanceof Number && ${safePainlessField( + condition + )}.toString().startsWith(${encodeValue(String(condition.value))})) || ${safePainlessField( + condition + )}.startsWith(${encodeValue(String(condition.value))}))`; case 'endsWith': - return `${safePainlessField(condition)}.endsWith(${encodeValue(condition.value)})`; + return `((${safePainlessField(condition)} instanceof Number && ${safePainlessField( + condition + )}.toString().endsWith(${encodeValue(String(condition.value))})) || ${safePainlessField( + condition + )}.endsWith(${encodeValue(String(condition.value))}))`; case 'contains': - return `${safePainlessField(condition)}.contains(${encodeValue(condition.value)})`; + return `((${safePainlessField(condition)} instanceof Number && ${safePainlessField( + condition + )}.toString().contains(${encodeValue(String(condition.value))})) || ${safePainlessField( + condition + )}.contains(${encodeValue(String(condition.value))}))`; default: - return `${safePainlessField(condition)} == ${encodeValue(condition.value)}`; + return `((${safePainlessField(condition)} instanceof Number && ${safePainlessField( + condition + )}.toString() == ${encodeValue(String(condition.value))}) || ${safePainlessField( + condition + )} == ${encodeValue(String(condition.value))})`; } } @@ -64,7 +103,18 @@ function isUnaryFilterCondition(subject: FilterCondition): subject is UnaryFilte return !('value' in subject); } -export function conditionToPainless(condition: Condition, nested = false): string { +function extractAllFields(condition: Condition, fields: string[] = []): string[] { + if (isFilterCondition(condition) && !isUnaryFilterCondition(condition)) { + return uniq([...fields, condition.field]); + } else if (isAndCondition(condition)) { + return uniq(condition.and.map((cond) => extractAllFields(cond, fields)).flat()); + } else if (isOrCondition(condition)) { + return uniq(condition.or.map((cond) => extractAllFields(cond, fields)).flat()); + } + return uniq(fields); +} + +export function conditionToStatement(condition: Condition, nested = false): string { if (isFilterCondition(condition)) { if (isUnaryFilterCondition(condition)) { return unaryToPainless(condition); @@ -72,12 +122,34 @@ export function conditionToPainless(condition: Condition, nested = false): strin return `(${safePainlessField(condition)} !== null && ${binaryToPainless(condition)})`; } if (isAndCondition(condition)) { - const and = condition.and.map((filter) => conditionToPainless(filter, true)).join(' && '); + const and = condition.and.map((filter) => conditionToStatement(filter, true)).join(' && '); return nested ? `(${and})` : and; } if (isOrCondition(condition)) { - const or = condition.or.map((filter) => conditionToPainless(filter, true)).join(' || '); + const or = condition.or.map((filter) => conditionToStatement(filter, true)).join(' || '); return nested ? `(${or})` : or; } return 'false'; } + +export function conditionToPainless(condition: Condition): string { + const fields = extractAllFields(condition); + let fieldCheck = ''; + if (fields.length !== 0) { + fieldCheck = `if (${fields + .map((field) => `${safePainlessField(field)} instanceof Map`) + .join(' || ')}) { + return false; +} +`; + } + return `${fieldCheck}try { + if (${conditionToStatement(condition)}) { + return true; + } + return false; +} catch (Exception e) { + return false; +} +`; +} diff --git a/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx b/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx index cdb159c158d10..49bd43232c9f5 100644 --- a/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx +++ b/x-pack/plugins/transform/public/app/__mocks__/app_dependencies.tsx @@ -67,7 +67,14 @@ dataStart.search.search = jest.fn(({ params }: IKibanaSearchRequest) => { }) as ISearchGeneric; // Replace mock to support tests for `use_index_data`. -coreSetup.http.post = jest.fn().mockResolvedValue([]); +coreSetup.http.post = jest.fn().mockImplementation((endpoint) => { + if (endpoint === '/internal/transform/transforms/_preview') { + return Promise.resolve({ + generated_dest_index: { mappings: { properties: {} } }, + preview: [], + }); + } +}); const appDependencies: AppDependencies = { analytics: coreStart.analytics, diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_range_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_range_form.tsx index ec4520ef87fd7..1304ca1c6e131 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_range_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_range_form.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useCallback } from 'react'; +import React, { useCallback, type ComponentProps } from 'react'; import { EuiFieldNumber, EuiFormRow, @@ -18,6 +18,12 @@ import { FormattedMessage } from '@kbn/i18n-react'; import type { FilterAggConfigRange } from '../types'; const BUTTON_SIZE = 40; + +// The config prop of the component, to be used for the `updateConfig` function. +type FilterRangeFormConfig = ComponentProps< + Exclude +>['config']; + /** * Form component for the range filter aggregation for number type fields. */ @@ -31,7 +37,7 @@ export const FilterRangeForm: FilterAggConfigRange['aggTypeConfig']['FilterAggFo const includeTo = config?.includeTo ?? false; const updateConfig = useCallback( - (update: any) => { + (update: FilterRangeFormConfig) => { onChange({ config: { ...config, diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx index 2e52eb67ac49a..04793ee426cca 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx @@ -6,7 +6,14 @@ */ import { debounce } from 'lodash'; -import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; +import React, { + useCallback, + useContext, + useEffect, + useMemo, + useState, + type ComponentProps, +} from 'react'; import useUpdateEffect from 'react-use/lib/useUpdateEffect'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; @@ -24,6 +31,11 @@ import { useToastNotifications } from '../../../../../../../app_dependencies'; import type { FilterAggConfigTerm } from '../types'; +// The config prop of the component, to be used for the `updateConfig` function. +type FilterRangeFormConfig = ComponentProps< + Exclude +>['config']; + /** * Form component for the term filter aggregation. */ @@ -51,7 +63,7 @@ export const FilterTermForm: FilterAggConfigTerm['aggTypeConfig']['FilterAggForm }, []); const updateConfig = useCallback( - (update: any) => { + (update: FilterRangeFormConfig) => { onChange({ config: { ...config, diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts index f0530ee9afa70..1fb865055c0d4 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts @@ -161,7 +161,7 @@ export function useLatestFunctionConfig( }, [dataView, data.search.aggs, runtimeMappings]); const updateLatestFunctionConfig = useCallback( - (update: any) => + (update: Partial) => setLatestFunctionConfig({ ...config, ...update, diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.test.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.test.tsx index 5b6e314e951aa..7c08a2462f65a 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.test.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.test.tsx @@ -20,9 +20,7 @@ import { StepDefineSummary } from './step_define_summary'; jest.mock('../../../../app_dependencies'); -// Failing: https://github.com/elastic/kibana/issues/195992 -describe.skip('Transform: ', () => { - // Using the async/await wait()/done() pattern to avoid act() errors. +describe('Transform: ', () => { test('Minimal initialization', async () => { // Arrange const queryClient = new QueryClient(); diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index cd243a3351aae..c94eefe9c9034 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -2600,7 +2600,6 @@ "discover.documentsAriaLabel": "Documents", "discover.docViews.logsOverview.title": "Aperçu du log", "discover.dropZoneTableLabel": "Abandonner la zone pour ajouter un champ en tant que colonne dans la table", - "discover.embeddable.inspectorRequestDataTitle": "Données", "discover.embeddable.inspectorRequestDescription": "Cette requête interroge Elasticsearch afin de récupérer les données pour la recherche.", "discover.embeddable.search.dataViewError": "Vue de données {indexPatternId} manquante", "discover.embeddable.search.displayName": "rechercher", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index f8291d5aa5267..b80f5e6427079 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -2599,7 +2599,6 @@ "discover.documentsAriaLabel": "ドキュメント", "discover.docViews.logsOverview.title": "ログ概要", "discover.dropZoneTableLabel": "フィールドを列として表に追加するには、ゾーンをドロップします", - "discover.embeddable.inspectorRequestDataTitle": "データ", "discover.embeddable.inspectorRequestDescription": "このリクエストはElasticsearchにクエリーをかけ、検索データを取得します。", "discover.embeddable.search.dataViewError": "データビュー{indexPatternId}が見つかりません", "discover.embeddable.search.displayName": "検索", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 0d204aad72949..369522e39cd44 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -2590,7 +2590,6 @@ "discover.documentsAriaLabel": "文档", "discover.docViews.logsOverview.title": "日志概览", "discover.dropZoneTableLabel": "放置区域以将字段作为列添加到表中", - "discover.embeddable.inspectorRequestDataTitle": "数据", "discover.embeddable.inspectorRequestDescription": "此请求将查询 Elasticsearch 以获取搜索的数据。", "discover.embeddable.search.dataViewError": "缺少数据视图 {indexPatternId}", "discover.embeddable.search.displayName": "搜索", diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/migrate_system_indices/migrate_system_indices.test.tsx b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/migrate_system_indices/migrate_system_indices.test.tsx index ae3e184f9c96b..eee988e2ebb13 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/migrate_system_indices/migrate_system_indices.test.tsx +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/migrate_system_indices/migrate_system_indices.test.tsx @@ -107,6 +107,38 @@ describe('Overview - Migrate system indices', () => { expect(exists('viewSystemIndicesStateButton')).toBe(true); }); + test('handles confirmModal submission', async () => { + httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({ + migration_status: 'MIGRATION_NEEDED', + }); + + testBed = await setupOverviewPage(httpSetup); + + const { exists, component, find } = testBed; + + component.update(); + + expect(exists('startSystemIndicesMigrationButton')).toBe(true); + await act(async () => { + find('startSystemIndicesMigrationButton').simulate('click'); + }); + component.update(); + + expect(exists('migrationConfirmModal')).toBe(true); + + const modal = document.body.querySelector('[data-test-subj="migrationConfirmModal"]'); + const confirmButton: HTMLButtonElement | null = modal!.querySelector( + '[data-test-subj="confirmModalConfirmButton"]' + ); + + await act(async () => { + confirmButton!.click(); + }); + component.update(); + + expect(exists('migrationConfirmModal')).toBe(false); + }); + test('Handles errors when migrating', async () => { httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({ migration_status: 'MIGRATION_NEEDED', @@ -126,6 +158,16 @@ describe('Overview - Migrate system indices', () => { component.update(); + const modal = document.body.querySelector('[data-test-subj="migrationConfirmModal"]'); + const confirmButton: HTMLButtonElement | null = modal!.querySelector( + '[data-test-subj="confirmModalConfirmButton"]' + ); + + await act(async () => { + confirmButton!.click(); + }); + component.update(); + // Error is displayed expect(exists('startSystemIndicesMigrationCalloutError')).toBe(true); // CTA is enabled diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/migrate_system_indices/migrate_system_indices.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/migrate_system_indices/migrate_system_indices.tsx index 47ca25bda31ac..3d2599e26bde2 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/migrate_system_indices/migrate_system_indices.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/migrate_system_indices/migrate_system_indices.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { FunctionComponent, useEffect } from 'react'; +import React, { FunctionComponent, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -20,6 +20,7 @@ import { EuiFlexItem, EuiCode, EuiLink, + EuiConfirmModal, } from '@elastic/eui'; import type { EuiStepProps } from '@elastic/eui/src/components/steps/step'; @@ -123,10 +124,55 @@ const i18nTexts = { }, }; +const ConfirmModal: React.FC<{ + onCancel: () => void; + onConfirm: () => void; +}> = ({ onCancel, onConfirm }) => ( + + {i18n.translate('xpack.upgradeAssistant.overview.systemIndices.confirmModal.description', { + defaultMessage: 'Migrating system indices may lead to downtime while they are reindexed.', + })} + +); + const MigrateSystemIndicesStep: FunctionComponent = ({ setIsComplete }) => { const { beginSystemIndicesMigration, startMigrationStatus, migrationStatus, setShowFlyout } = useMigrateSystemIndices(); + const [isModalVisible, setIsModalVisible] = useState(false); + + const openMigrationModal = () => { + setIsModalVisible(true); + }; + const onCancel = () => { + setIsModalVisible(false); + }; + + const confirmMigrationAction = () => { + beginSystemIndicesMigration(); + setIsModalVisible(false); + }; + useEffect(() => { setIsComplete(migrationStatus.data?.migration_status === 'NO_MIGRATION_NEEDED'); // Depending upon setIsComplete would create an infinite loop. @@ -206,12 +252,14 @@ const MigrateSystemIndicesStep: FunctionComponent = ({ setIsComplete }) = )} + {isModalVisible && } + {isMigrating ? i18nTexts.inProgressButtonLabel : i18nTexts.startButtonLabel} diff --git a/x-pack/plugins/upgrade_assistant/server/lib/__fixtures__/fake_deprecations.json b/x-pack/plugins/upgrade_assistant/server/lib/__fixtures__/fake_deprecations.json index f53e4176096cc..953223902159d 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/__fixtures__/fake_deprecations.json +++ b/x-pack/plugins/upgrade_assistant/server/lib/__fixtures__/fake_deprecations.json @@ -147,6 +147,15 @@ "details": "[[type: tweet, field: liked]]", "resolve_during_rolling_upgrade": false } + ], + "myindex": [ + { + "level": "critical", + "message": "Old index with a compatibility version < 8.0", + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html", + "details": "This index has version: 7.17.25", + "resolve_during_rolling_upgrade": false + } ] }, "data_streams": { diff --git a/x-pack/plugins/upgrade_assistant/server/lib/es_deprecations_status/__snapshots__/index.test.ts.snap b/x-pack/plugins/upgrade_assistant/server/lib/es_deprecations_status/__snapshots__/index.test.ts.snap index b0d5d99a37497..7f6b7826da8a8 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/es_deprecations_status/__snapshots__/index.test.ts.snap +++ b/x-pack/plugins/upgrade_assistant/server/lib/es_deprecations_status/__snapshots__/index.test.ts.snap @@ -158,6 +158,19 @@ Object { "type": "index_settings", "url": "https://www.elastic.co/guide/en/elasticsearch/reference/6.0/breaking_60_mappings_changes.html#_coercion_of_boolean_fields", }, + Object { + "correctiveAction": Object { + "blockerForReindexing": undefined, + "type": "reindex", + }, + "details": "This index has version: 7.17.25", + "index": "myindex", + "isCritical": true, + "message": "Old index with a compatibility version < 8.0", + "resolveDuringUpgrade": false, + "type": "index_settings", + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html", + }, Object { "correctiveAction": undefined, "details": "This data stream has backing indices that were created before Elasticsearch 8.0.0", @@ -169,6 +182,6 @@ Object { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html", }, ], - "totalCriticalDeprecations": 5, + "totalCriticalDeprecations": 6, } `; diff --git a/x-pack/plugins/upgrade_assistant/server/lib/es_deprecations_status/get_corrective_actions.ts b/x-pack/plugins/upgrade_assistant/server/lib/es_deprecations_status/get_corrective_actions.ts index be696acb18095..d971625c818ea 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/es_deprecations_status/get_corrective_actions.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/es_deprecations_status/get_corrective_actions.ts @@ -20,6 +20,12 @@ type EsMetadata = Actions & { [key: string]: string; }; +// TODO(jloleysens): Replace these regexes once this issue is addressed https://github.com/elastic/elasticsearch/issues/118062 +const ES_INDEX_MESSAGES_REQIURING_REINDEX = [ + /Index created before/, + /index with a compatibility version \ action.action_type === 'remove_settings' && typeof indexName === 'undefined' ); - const requiresReindexAction = /Index created before/.test(message); + const requiresReindexAction = ES_INDEX_MESSAGES_REQIURING_REINDEX.some((regexp) => + regexp.test(message) + ); const requiresIndexSettingsAction = Boolean(indexSettingDeprecation); const requiresClusterSettingsAction = Boolean(clusterSettingDeprecation); const requiresMlAction = /[Mm]odel snapshot/.test(message); diff --git a/x-pack/test/api_integration/apis/streams/full_flow.ts b/x-pack/test/api_integration/apis/streams/full_flow.ts index 03c0cc9e0e219..aad931ab11816 100644 --- a/x-pack/test/api_integration/apis/streams/full_flow.ts +++ b/x-pack/test/api_integration/apis/streams/full_flow.ts @@ -135,6 +135,137 @@ export default function ({ getService }: FtrProviderContext) { log: { level: 'info', logger: 'nginx' }, }); }); + + it('Fork logs to logs.nginx.error with invalid condition', async () => { + const body = { + stream: { + id: 'logs.nginx.error', + fields: [], + processing: [], + }, + condition: { field: 'log', operator: 'eq', value: 'error' }, + }; + const response = await forkStream(supertest, 'logs.nginx', body); + expect(response).to.have.property('acknowledged', true); + }); + + it('Index an Nginx error log message, should goto logs.nginx.error but fails', async () => { + const doc = { + '@timestamp': '2024-01-01T00:00:20.000Z', + message: JSON.stringify({ + 'log.level': 'error', + 'log.logger': 'nginx', + message: 'test', + }), + }; + const response = await indexDocument(esClient, 'logs', doc); + expect(response.result).to.eql('created'); + + await waitForDocumentInIndex({ + esClient, + indexName: 'logs.nginx', + retryService, + logger, + docCountTarget: 2, + }); + + const result = await fetchDocument(esClient, 'logs.nginx', response._id); + expect(result._index).to.match(/^\.ds\-logs.nginx-.*/); + expect(result._source).to.eql({ + '@timestamp': '2024-01-01T00:00:20.000Z', + message: 'test', + log: { level: 'error', logger: 'nginx' }, + }); + }); + + it('Fork logs to logs.number-test', async () => { + const body = { + stream: { + id: 'logs.number-test', + fields: [], + processing: [], + }, + condition: { field: 'code', operator: 'gte', value: '500' }, + }; + const response = await forkStream(supertest, 'logs', body); + expect(response).to.have.property('acknowledged', true); + }); + + it('Index documents with numbers and strings for logs.number-test condition', async () => { + const doc1 = { + '@timestamp': '2024-01-01T00:00:20.000Z', + message: JSON.stringify({ + code: '500', + message: 'test', + }), + }; + const doc2 = { + '@timestamp': '2024-01-01T00:00:20.000Z', + message: JSON.stringify({ + code: 500, + message: 'test', + }), + }; + const response1 = await indexDocument(esClient, 'logs', doc1); + expect(response1.result).to.eql('created'); + const response2 = await indexDocument(esClient, 'logs', doc2); + expect(response2.result).to.eql('created'); + + await waitForDocumentInIndex({ + esClient, + indexName: 'logs.number-test', + retryService, + logger, + docCountTarget: 2, + retries: 20, + }); + }); + + it('Fork logs to logs.string-test', async () => { + const body = { + stream: { + id: 'logs.string-test', + fields: [], + processing: [], + }, + condition: { + or: [ + { field: 'message', operator: 'contains', value: '500' }, + { field: 'message', operator: 'contains', value: 400 }, + ], + }, + }; + const response = await forkStream(supertest, 'logs', body); + expect(response).to.have.property('acknowledged', true); + }); + + it('Index documents with numbers and strings for logs.string-test condition', async () => { + const doc1 = { + '@timestamp': '2024-01-01T00:00:20.000Z', + message: JSON.stringify({ + message: 'status_code: 500', + }), + }; + const doc2 = { + '@timestamp': '2024-01-01T00:00:20.000Z', + message: JSON.stringify({ + message: 'status_code: 400', + }), + }; + const response1 = await indexDocument(esClient, 'logs', doc1); + expect(response1.result).to.eql('created'); + const response2 = await indexDocument(esClient, 'logs', doc2); + expect(response2.result).to.eql('created'); + + await waitForDocumentInIndex({ + esClient, + indexName: 'logs.string-test', + retryService, + logger, + docCountTarget: 2, + retries: 20, + }); + }); }); }); } diff --git a/x-pack/test/api_integration/services/security_solution_api.gen.ts b/x-pack/test/api_integration/services/security_solution_api.gen.ts index 3561ff6fac35a..98fefc3a74aa4 100644 --- a/x-pack/test/api_integration/services/security_solution_api.gen.ts +++ b/x-pack/test/api_integration/services/security_solution_api.gen.ts @@ -32,7 +32,10 @@ import { CopyTimelineRequestBodyInput } from '@kbn/security-solution-plugin/comm import { CreateAlertsMigrationRequestBodyInput } from '@kbn/security-solution-plugin/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.gen'; import { CreateAssetCriticalityRecordRequestBodyInput } from '@kbn/security-solution-plugin/common/api/entity_analytics/asset_criticality/create_asset_criticality.gen'; import { CreateRuleRequestBodyInput } from '@kbn/security-solution-plugin/common/api/detection_engine/rule_management/crud/create_rule/create_rule_route.gen'; -import { CreateRuleMigrationRequestBodyInput } from '@kbn/security-solution-plugin/common/siem_migrations/model/api/rules/rule_migration.gen'; +import { + CreateRuleMigrationRequestParamsInput, + CreateRuleMigrationRequestBodyInput, +} from '@kbn/security-solution-plugin/common/siem_migrations/model/api/rules/rule_migration.gen'; import { CreateTimelinesRequestBodyInput } from '@kbn/security-solution-plugin/common/api/timeline/create_timelines/create_timelines_route.gen'; import { CreateUpdateProtectionUpdatesNoteRequestParamsInput, @@ -374,7 +377,12 @@ If a record already exists for the specified entity, that record is overwritten */ createRuleMigration(props: CreateRuleMigrationProps, kibanaSpace: string = 'default') { return supertest - .post(routeWithNamespace('/internal/siem_migrations/rules', kibanaSpace)) + .post( + routeWithNamespace( + replaceParams('/internal/siem_migrations/rules/{migration_id}', props.params), + kibanaSpace + ) + ) .set('kbn-xsrf', 'true') .set(ELASTIC_HTTP_VERSION_HEADER, '1') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') @@ -1595,6 +1603,7 @@ export interface CreateRuleProps { body: CreateRuleRequestBodyInput; } export interface CreateRuleMigrationProps { + params: CreateRuleMigrationRequestParamsInput; body: CreateRuleMigrationRequestBodyInput; } export interface CreateTimelinesProps { diff --git a/x-pack/test/apm_api_integration/tests/transactions/__snapshots__/breakdown.spec.snap b/x-pack/test/apm_api_integration/tests/transactions/__snapshots__/breakdown.spec.snap index d8e3d13525cc9..68495907b3c7f 100644 --- a/x-pack/test/apm_api_integration/tests/transactions/__snapshots__/breakdown.spec.snap +++ b/x-pack/test/apm_api_integration/tests/transactions/__snapshots__/breakdown.spec.snap @@ -20,39 +20,39 @@ Object { }, Object { "x": 1627973490000, - "y": 0.0833333333333333, + "y": 0.08333333, }, Object { "x": 1627973520000, - "y": 0.628571428571429, + "y": 0.62857143, }, Object { "x": 1627973550000, - "y": 0.733333333333333, + "y": 0.73333333, }, Object { "x": 1627973580000, - "y": 0.490909090909091, + "y": 0.49090909, }, Object { "x": 1627973610000, - "y": 0.135593220338983, + "y": 0.13559322, }, Object { "x": 1627973640000, - "y": 0.692307692307692, + "y": 0.69230769, }, Object { "x": 1627973670000, - "y": 0.097165991902834, + "y": 0.09716599, }, Object { "x": 1627973700000, - "y": 0.303030303030303, + "y": 0.3030303, }, Object { "x": 1627973730000, - "y": 0.153846153846154, + "y": 0.15384615, }, Object { "x": 1627973760000, @@ -60,11 +60,11 @@ Object { }, Object { "x": 1627973790000, - "y": 0.0857142857142857, + "y": 0.08571429, }, Object { "x": 1627973820000, - "y": 0.155172413793103, + "y": 0.15517241, }, Object { "x": 1627973850000, @@ -76,31 +76,31 @@ Object { }, Object { "x": 1627973910000, - "y": 0.142857142857143, + "y": 0.14285714, }, Object { "x": 1627973940000, - "y": 0.0810810810810811, + "y": 0.08108108, }, Object { "x": 1627973970000, - "y": 0.473684210526316, + "y": 0.47368421, }, Object { "x": 1627974000000, - "y": 0.633333333333333, + "y": 0.63333333, }, Object { "x": 1627974030000, - "y": 0.111111111111111, + "y": 0.11111111, }, Object { "x": 1627974060000, - "y": 0.467741935483871, + "y": 0.46774194, }, Object { "x": 1627974090000, - "y": 0.129496402877698, + "y": 0.1294964, }, Object { "x": 1627974120000, @@ -108,19 +108,19 @@ Object { }, Object { "x": 1627974150000, - "y": 0.30188679245283, + "y": 0.30188679, }, Object { "x": 1627974180000, - "y": 0.464285714285714, + "y": 0.46428571, }, Object { "x": 1627974210000, - "y": 0.123674911660777, + "y": 0.12367491, }, Object { "x": 1627974240000, - "y": 0.384615384615385, + "y": 0.38461538, }, Object { "x": 1627974270000, @@ -128,19 +128,19 @@ Object { }, Object { "x": 1627974300000, - "y": 0.222222222222222, + "y": 0.22222222, }, Object { "x": 1627974330000, - "y": 0.00248447204968944, + "y": 0.00248447, }, Object { "x": 1627974360000, - "y": 0.0645161290322581, + "y": 0.06451613, }, Object { "x": 1627974390000, - "y": 0.569444444444444, + "y": 0.56944444, }, Object { "x": 1627974420000, @@ -152,19 +152,19 @@ Object { }, Object { "x": 1627974480000, - "y": 0.143646408839779, + "y": 0.14364641, }, Object { "x": 1627974510000, - "y": 0.298850574712644, + "y": 0.29885057, }, Object { "x": 1627974540000, - "y": 0.111111111111111, + "y": 0.11111111, }, Object { "x": 1627974570000, - "y": 0.267857142857143, + "y": 0.26785714, }, Object { "x": 1627974600000, @@ -172,11 +172,11 @@ Object { }, Object { "x": 1627974630000, - "y": 0.185185185185185, + "y": 0.18518519, }, Object { "x": 1627974660000, - "y": 0.0973451327433628, + "y": 0.09734513, }, Object { "x": 1627974690000, @@ -184,15 +184,15 @@ Object { }, Object { "x": 1627974720000, - "y": 0.480769230769231, + "y": 0.48076923, }, Object { "x": 1627974750000, - "y": 0.383458646616541, + "y": 0.38345865, }, Object { "x": 1627974780000, - "y": 0.153061224489796, + "y": 0.15306122, }, Object { "x": 1627974810000, @@ -200,23 +200,23 @@ Object { }, Object { "x": 1627974840000, - "y": 0.739130434782609, + "y": 0.73913043, }, Object { "x": 1627974870000, - "y": 0.260869565217391, + "y": 0.26086957, }, Object { "x": 1627974900000, - "y": 0.605633802816901, + "y": 0.6056338, }, Object { "x": 1627974930000, - "y": 0.326923076923077, + "y": 0.32692308, }, Object { "x": 1627974960000, - "y": 0.103448275862069, + "y": 0.10344828, }, Object { "x": 1627974990000, @@ -228,19 +228,19 @@ Object { }, Object { "x": 1627975050000, - "y": 0.114285714285714, + "y": 0.11428571, }, Object { "x": 1627975080000, - "y": 0.238636363636364, + "y": 0.23863636, }, Object { "x": 1627975110000, - "y": 0.684210526315789, + "y": 0.68421053, }, Object { "x": 1627975140000, - "y": 0.368421052631579, + "y": 0.36842105, }, Object { "x": 1627975170000, @@ -248,7 +248,7 @@ Object { }, Object { "x": 1627975200000, - "y": 0.235294117647059, + "y": 0.23529412, }, ], "hideLegend": false, @@ -265,7 +265,7 @@ Object { }, Object { "x": 1627973430000, - "y": 0.790322580645161, + "y": 0.79032258, }, Object { "x": 1627973460000, @@ -273,11 +273,11 @@ Object { }, Object { "x": 1627973490000, - "y": 0.876543209876543, + "y": 0.87654321, }, Object { "x": 1627973520000, - "y": 0.114285714285714, + "y": 0.11428571, }, Object { "x": 1627973550000, @@ -285,11 +285,11 @@ Object { }, Object { "x": 1627973580000, - "y": 0.309090909090909, + "y": 0.30909091, }, Object { "x": 1627973610000, - "y": 0.864406779661017, + "y": 0.86440678, }, Object { "x": 1627973640000, @@ -297,15 +297,15 @@ Object { }, Object { "x": 1627973670000, - "y": 0.862348178137652, + "y": 0.86234818, }, Object { "x": 1627973700000, - "y": 0.636363636363636, + "y": 0.63636364, }, Object { "x": 1627973730000, - "y": 0.846153846153846, + "y": 0.84615385, }, Object { "x": 1627973760000, @@ -313,11 +313,11 @@ Object { }, Object { "x": 1627973790000, - "y": 0.914285714285714, + "y": 0.91428571, }, Object { "x": 1627973820000, - "y": 0.844827586206897, + "y": 0.84482759, }, Object { "x": 1627973850000, @@ -329,11 +329,11 @@ Object { }, Object { "x": 1627973910000, - "y": 0.857142857142857, + "y": 0.85714286, }, Object { "x": 1627973940000, - "y": 0.918918918918919, + "y": 0.91891892, }, Object { "x": 1627973970000, @@ -345,15 +345,15 @@ Object { }, Object { "x": 1627974030000, - "y": 0.872222222222222, + "y": 0.87222222, }, Object { "x": 1627974060000, - "y": 0.290322580645161, + "y": 0.29032258, }, Object { "x": 1627974090000, - "y": 0.848920863309353, + "y": 0.84892086, }, Object { "x": 1627974120000, @@ -361,19 +361,19 @@ Object { }, Object { "x": 1627974150000, - "y": 0.613207547169811, + "y": 0.61320755, }, Object { "x": 1627974180000, - "y": 0.339285714285714, + "y": 0.33928571, }, Object { "x": 1627974210000, - "y": 0.787985865724382, + "y": 0.78798587, }, Object { "x": 1627974240000, - "y": 0.557692307692308, + "y": 0.55769231, }, Object { "x": 1627974270000, @@ -381,15 +381,15 @@ Object { }, Object { "x": 1627974300000, - "y": 0.685990338164251, + "y": 0.68599034, }, Object { "x": 1627974330000, - "y": 0.995807453416149, + "y": 0.99580745, }, Object { "x": 1627974360000, - "y": 0.935483870967742, + "y": 0.93548387, }, Object { "x": 1627974390000, @@ -405,15 +405,15 @@ Object { }, Object { "x": 1627974480000, - "y": 0.831491712707182, + "y": 0.83149171, }, Object { "x": 1627974510000, - "y": 0.505747126436782, + "y": 0.50574713, }, Object { "x": 1627974540000, - "y": 0.888888888888889, + "y": 0.88888889, }, Object { "x": 1627974570000, @@ -425,11 +425,11 @@ Object { }, Object { "x": 1627974630000, - "y": 0.71957671957672, + "y": 0.71957672, }, Object { "x": 1627974660000, - "y": 0.867256637168142, + "y": 0.86725664, }, Object { "x": 1627974690000, @@ -437,15 +437,15 @@ Object { }, Object { "x": 1627974720000, - "y": 0.288461538461538, + "y": 0.28846154, }, Object { "x": 1627974750000, - "y": 0.406015037593985, + "y": 0.40601504, }, Object { "x": 1627974780000, - "y": 0.775510204081633, + "y": 0.7755102, }, Object { "x": 1627974810000, @@ -457,7 +457,7 @@ Object { }, Object { "x": 1627974870000, - "y": 0.623188405797101, + "y": 0.62318841, }, Object { "x": 1627974900000, @@ -465,11 +465,11 @@ Object { }, Object { "x": 1627974930000, - "y": 0.423076923076923, + "y": 0.42307692, }, Object { "x": 1627974960000, - "y": 0.896551724137931, + "y": 0.89655172, }, Object { "x": 1627974990000, @@ -481,11 +481,11 @@ Object { }, Object { "x": 1627975050000, - "y": 0.885714285714286, + "y": 0.88571429, }, Object { "x": 1627975080000, - "y": 0.681818181818182, + "y": 0.68181818, }, Object { "x": 1627975110000, @@ -493,7 +493,7 @@ Object { }, Object { "x": 1627975140000, - "y": 0.456140350877193, + "y": 0.45614035, }, Object { "x": 1627975170000, @@ -501,7 +501,7 @@ Object { }, Object { "x": 1627975200000, - "y": 0.541176470588235, + "y": 0.54117647, }, ], "hideLegend": false, @@ -518,7 +518,7 @@ Object { }, Object { "x": 1627973430000, - "y": 0.0806451612903226, + "y": 0.08064516, }, Object { "x": 1627973460000, @@ -526,19 +526,19 @@ Object { }, Object { "x": 1627973490000, - "y": 0.0277777777777778, + "y": 0.02777778, }, Object { "x": 1627973520000, - "y": 0.171428571428571, + "y": 0.17142857, }, Object { "x": 1627973550000, - "y": 0.266666666666667, + "y": 0.26666667, }, Object { "x": 1627973580000, - "y": 0.181818181818182, + "y": 0.18181818, }, Object { "x": 1627973610000, @@ -546,15 +546,15 @@ Object { }, Object { "x": 1627973640000, - "y": 0.307692307692308, + "y": 0.30769231, }, Object { "x": 1627973670000, - "y": 0.0364372469635627, + "y": 0.03643725, }, Object { "x": 1627973700000, - "y": 0.0454545454545455, + "y": 0.04545455, }, Object { "x": 1627973730000, @@ -562,7 +562,7 @@ Object { }, Object { "x": 1627973760000, - "y": 0.0416666666666667, + "y": 0.04166667, }, Object { "x": 1627973790000, @@ -590,7 +590,7 @@ Object { }, Object { "x": 1627973970000, - "y": 0.526315789473684, + "y": 0.52631579, }, Object { "x": 1627974000000, @@ -598,15 +598,15 @@ Object { }, Object { "x": 1627974030000, - "y": 0.0166666666666667, + "y": 0.01666667, }, Object { "x": 1627974060000, - "y": 0.129032258064516, + "y": 0.12903226, }, Object { "x": 1627974090000, - "y": 0.0143884892086331, + "y": 0.01438849, }, Object { "x": 1627974120000, @@ -614,19 +614,19 @@ Object { }, Object { "x": 1627974150000, - "y": 0.0471698113207547, + "y": 0.04716981, }, Object { "x": 1627974180000, - "y": 0.160714285714286, + "y": 0.16071429, }, Object { "x": 1627974210000, - "y": 0.0565371024734982, + "y": 0.0565371, }, Object { "x": 1627974240000, - "y": 0.0384615384615385, + "y": 0.03846154, }, Object { "x": 1627974270000, @@ -634,11 +634,11 @@ Object { }, Object { "x": 1627974300000, - "y": 0.0579710144927536, + "y": 0.05797101, }, Object { "x": 1627974330000, - "y": 0.00108695652173913, + "y": 0.00108696, }, Object { "x": 1627974360000, @@ -646,7 +646,7 @@ Object { }, Object { "x": 1627974390000, - "y": 0.263888888888889, + "y": 0.26388889, }, Object { "x": 1627974420000, @@ -658,11 +658,11 @@ Object { }, Object { "x": 1627974480000, - "y": 0.0193370165745856, + "y": 0.01933702, }, Object { "x": 1627974510000, - "y": 0.183908045977011, + "y": 0.18390805, }, Object { "x": 1627974540000, @@ -670,7 +670,7 @@ Object { }, Object { "x": 1627974570000, - "y": 0.0357142857142857, + "y": 0.03571429, }, Object { "x": 1627974600000, @@ -678,11 +678,11 @@ Object { }, Object { "x": 1627974630000, - "y": 0.0793650793650794, + "y": 0.07936508, }, Object { "x": 1627974660000, - "y": 0.0265486725663717, + "y": 0.02654867, }, Object { "x": 1627974690000, @@ -690,15 +690,15 @@ Object { }, Object { "x": 1627974720000, - "y": 0.192307692307692, + "y": 0.19230769, }, Object { "x": 1627974750000, - "y": 0.150375939849624, + "y": 0.15037594, }, Object { "x": 1627974780000, - "y": 0.0561224489795918, + "y": 0.05612245, }, Object { "x": 1627974810000, @@ -706,15 +706,15 @@ Object { }, Object { "x": 1627974840000, - "y": 0.217391304347826, + "y": 0.2173913, }, Object { "x": 1627974870000, - "y": 0.115942028985507, + "y": 0.11594203, }, Object { "x": 1627974900000, - "y": 0.380281690140845, + "y": 0.38028169, }, Object { "x": 1627974930000, @@ -738,15 +738,15 @@ Object { }, Object { "x": 1627975080000, - "y": 0.0738636363636364, + "y": 0.07386364, }, Object { "x": 1627975110000, - "y": 0.157894736842105, + "y": 0.15789474, }, Object { "x": 1627975140000, - "y": 0.175438596491228, + "y": 0.1754386, }, Object { "x": 1627975170000, @@ -754,7 +754,7 @@ Object { }, Object { "x": 1627975200000, - "y": 0.211764705882353, + "y": 0.21176471, }, ], "hideLegend": false, @@ -771,7 +771,7 @@ Object { }, Object { "x": 1627973430000, - "y": 0.00403225806451613, + "y": 0.00403226, }, Object { "x": 1627973460000, @@ -779,11 +779,11 @@ Object { }, Object { "x": 1627973490000, - "y": 0.0123456790123457, + "y": 0.01234568, }, Object { "x": 1627973520000, - "y": 0.0857142857142857, + "y": 0.08571429, }, Object { "x": 1627973550000, @@ -791,7 +791,7 @@ Object { }, Object { "x": 1627973580000, - "y": 0.0181818181818182, + "y": 0.01818182, }, Object { "x": 1627973610000, @@ -803,11 +803,11 @@ Object { }, Object { "x": 1627973670000, - "y": 0.00404858299595142, + "y": 0.00404858, }, Object { "x": 1627973700000, - "y": 0.0151515151515152, + "y": 0.01515152, }, Object { "x": 1627973730000, @@ -815,7 +815,7 @@ Object { }, Object { "x": 1627973760000, - "y": 0.00520833333333333, + "y": 0.00520833, }, Object { "x": 1627973790000, @@ -847,7 +847,7 @@ Object { }, Object { "x": 1627974000000, - "y": 0.0166666666666667, + "y": 0.01666667, }, Object { "x": 1627974030000, @@ -855,11 +855,11 @@ Object { }, Object { "x": 1627974060000, - "y": 0.112903225806452, + "y": 0.11290323, }, Object { "x": 1627974090000, - "y": 0.00719424460431655, + "y": 0.00719424, }, Object { "x": 1627974120000, @@ -867,19 +867,19 @@ Object { }, Object { "x": 1627974150000, - "y": 0.0377358490566038, + "y": 0.03773585, }, Object { "x": 1627974180000, - "y": 0.0357142857142857, + "y": 0.03571429, }, Object { "x": 1627974210000, - "y": 0.0318021201413428, + "y": 0.03180212, }, Object { "x": 1627974240000, - "y": 0.0192307692307692, + "y": 0.01923077, }, Object { "x": 1627974270000, @@ -887,11 +887,11 @@ Object { }, Object { "x": 1627974300000, - "y": 0.0338164251207729, + "y": 0.03381643, }, Object { "x": 1627974330000, - "y": 0.00062111801242236, + "y": 0.00062112, }, Object { "x": 1627974360000, @@ -899,7 +899,7 @@ Object { }, Object { "x": 1627974390000, - "y": 0.0416666666666667, + "y": 0.04166667, }, Object { "x": 1627974420000, @@ -911,11 +911,11 @@ Object { }, Object { "x": 1627974480000, - "y": 0.00552486187845304, + "y": 0.00552486, }, Object { "x": 1627974510000, - "y": 0.0114942528735632, + "y": 0.01149425, }, Object { "x": 1627974540000, @@ -923,7 +923,7 @@ Object { }, Object { "x": 1627974570000, - "y": 0.0714285714285714, + "y": 0.07142857, }, Object { "x": 1627974600000, @@ -931,11 +931,11 @@ Object { }, Object { "x": 1627974630000, - "y": 0.0158730158730159, + "y": 0.01587302, }, Object { "x": 1627974660000, - "y": 0.00884955752212389, + "y": 0.00884956, }, Object { "x": 1627974690000, @@ -943,15 +943,15 @@ Object { }, Object { "x": 1627974720000, - "y": 0.0384615384615385, + "y": 0.03846154, }, Object { "x": 1627974750000, - "y": 0.0601503759398496, + "y": 0.06015038, }, Object { "x": 1627974780000, - "y": 0.0153061224489796, + "y": 0.01530612, }, Object { "x": 1627974810000, @@ -959,7 +959,7 @@ Object { }, Object { "x": 1627974840000, - "y": 0.0434782608695652, + "y": 0.04347826, }, Object { "x": 1627974870000, @@ -967,7 +967,7 @@ Object { }, Object { "x": 1627974900000, - "y": 0.0140845070422535, + "y": 0.01408451, }, Object { "x": 1627974930000, @@ -991,11 +991,11 @@ Object { }, Object { "x": 1627975080000, - "y": 0.00568181818181818, + "y": 0.00568182, }, Object { "x": 1627975110000, - "y": 0.157894736842105, + "y": 0.15789474, }, Object { "x": 1627975140000, @@ -1007,7 +1007,7 @@ Object { }, Object { "x": 1627975200000, - "y": 0.0117647058823529, + "y": 0.01176471, }, ], "hideLegend": false, diff --git a/x-pack/test/functional_search/tests/classic_navigation.ts b/x-pack/test/functional_search/tests/classic_navigation.ts index 7ec78394dae74..a290f7523f49c 100644 --- a/x-pack/test/functional_search/tests/classic_navigation.ts +++ b/x-pack/test/functional_search/tests/classic_navigation.ts @@ -42,7 +42,7 @@ export default function searchSolutionNavigation({ { id: 'Content', label: 'Content' }, { id: 'Indices', label: 'Indices' }, { id: 'Connectors', label: 'Connectors' }, - { id: 'Crawlers', label: 'Web crawlers' }, + { id: 'Crawlers', label: 'Web Crawlers' }, { id: 'Build', label: 'Build' }, { id: 'Playground', label: 'Playground' }, { id: 'SearchApplications', label: 'Search Applications' }, @@ -76,7 +76,7 @@ export default function searchSolutionNavigation({ await searchClassicNavigation.clickNavItem('Crawlers'); await searchClassicNavigation.expectNavItemActive('Crawlers'); await searchClassicNavigation.breadcrumbs.expectBreadcrumbExists('Content'); - await searchClassicNavigation.breadcrumbs.expectBreadcrumbExists('Web crawlers'); + await searchClassicNavigation.breadcrumbs.expectBreadcrumbExists('Web Crawlers'); // Check Build // > Playground diff --git a/x-pack/test/functional_search/tests/solution_navigation.ts b/x-pack/test/functional_search/tests/solution_navigation.ts index b64367b11675c..89cee21a81d66 100644 --- a/x-pack/test/functional_search/tests/solution_navigation.ts +++ b/x-pack/test/functional_search/tests/solution_navigation.ts @@ -54,7 +54,7 @@ export default function searchSolutionNavigation({ await solutionNavigation.sidenav.expectLinkExists({ text: 'Dashboards' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Indices' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Connectors' }); - await solutionNavigation.sidenav.expectLinkExists({ text: 'Web crawlers' }); + await solutionNavigation.sidenav.expectLinkExists({ text: 'Web Crawlers' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Playground' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Search applications' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Behavioral Analytics' }); @@ -147,7 +147,7 @@ export default function searchSolutionNavigation({ deepLinkId: 'enterpriseSearchContent:webCrawlers', }); await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Content' }); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Web crawlers' }); + await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Web Crawlers' }); await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ deepLinkId: 'enterpriseSearchContent:webCrawlers', }); diff --git a/x-pack/test_serverless/functional/page_objects/svl_api_keys.ts b/x-pack/test_serverless/functional/page_objects/svl_api_keys.ts index 2228967f29155..183a489a41e78 100644 --- a/x-pack/test_serverless/functional/page_objects/svl_api_keys.ts +++ b/x-pack/test_serverless/functional/page_objects/svl_api_keys.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { SecurityApiKey } from '@elastic/elasticsearch/lib/api/types'; import { FtrProviderContext } from '../ftr_provider_context'; const APIKEY_MASK = '•'.repeat(60); @@ -27,6 +28,10 @@ export function SvlApiKeysProvider({ getService, getPageObjects }: FtrProviderCo await browser.clearSessionStorage(); }, + async expectAPIKeyExists() { + await testSubjects.existOrFail('apiKeyFormAPIKey', { timeout: 1000 }); + }, + async expectAPIKeyAvailable() { await testSubjects.existOrFail('apiKeyFormAPIKey'); await retry.try(async () => { @@ -88,8 +93,19 @@ export function SvlApiKeysProvider({ getService, getPageObjects }: FtrProviderCo }, async deleteAPIKeys() { + const filterInvalid = (key: SecurityApiKey) => !key.invalidated; + const { api_keys: apiKeys } = await es.security.getApiKey(); - await es.security.invalidateApiKey({ ids: apiKeys.map((key) => key.id) }); + + const validKeys = apiKeys.filter(filterInvalid); + + if (validKeys.length === 0) { + return; + } + + await es.security.invalidateApiKey({ + ids: validKeys.map((key) => key.id), + }); }, async expectCreateApiKeyAction() { diff --git a/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts b/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts index ba370871c07ff..da966b21185c5 100644 --- a/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts +++ b/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts @@ -21,13 +21,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const esDeleteAllIndices = getService('esDeleteAllIndices'); const es = getService('es'); const browser = getService('browser'); + const retry = getService('retry'); const deleteAllTestIndices = async () => { await esDeleteAllIndices(['search-*', 'test-*']); }; - // Failing: See https://github.com/elastic/kibana/issues/200020 - describe.skip('Elasticsearch Start [Onboarding Empty State]', function () { + describe('Elasticsearch Start [Onboarding Empty State]', function () { describe('developer', function () { before(async () => { await pageObjects.svlCommonPage.loginWithRole('developer'); @@ -96,7 +96,20 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should show the api key in code view', async () => { await pageObjects.svlSearchElasticsearchStartPage.expectToBeOnStartPage(); await pageObjects.svlSearchElasticsearchStartPage.clickCodeViewButton(); + // sometimes the API key exists in the cluster and its lost in sessionStorage + // if fails we retry to delete the API key and refresh the browser + await retry.try( + async () => { + await pageObjects.svlApiKeys.expectAPIKeyExists(); + }, + async () => { + await pageObjects.svlApiKeys.deleteAPIKeys(); + await browser.refresh(); + await pageObjects.svlSearchElasticsearchStartPage.clickCodeViewButton(); + } + ); await pageObjects.svlApiKeys.expectAPIKeyAvailable(); + const apiKeyUI = await pageObjects.svlApiKeys.getAPIKeyFromUI(); const apiKeySession = await pageObjects.svlApiKeys.getAPIKeyFromSessionStorage(); diff --git a/x-pack/test_serverless/functional/test_suites/search/navigation.ts b/x-pack/test_serverless/functional/test_suites/search/navigation.ts index 74d1c59cbc8e5..abf4b0e2eef69 100644 --- a/x-pack/test_serverless/functional/test_suites/search/navigation.ts +++ b/x-pack/test_serverless/functional/test_suites/search/navigation.ts @@ -241,7 +241,7 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { await solutionNavigation.sidenav.expectLinkExists({ text: 'Data' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Index Management' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Connectors' }); - await solutionNavigation.sidenav.expectLinkExists({ text: 'Web crawlers' }); + await solutionNavigation.sidenav.expectLinkExists({ text: 'Web Crawlers' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Build' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Dev Tools' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Playground' }); diff --git a/x-pack/test_serverless/functional/test_suites/search/search_index_detail.ts b/x-pack/test_serverless/functional/test_suites/search/search_index_detail.ts index 7d47bd732746b..0dda7789b6f93 100644 --- a/x-pack/test_serverless/functional/test_suites/search/search_index_detail.ts +++ b/x-pack/test_serverless/functional/test_suites/search/search_index_detail.ts @@ -20,6 +20,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const svlSearchNavigation = getService('svlSearchNavigation'); const es = getService('es'); const security = getService('security'); + const browser = getService('browser'); + const retry = getService('retry'); const esDeleteAllIndices = getService('esDeleteAllIndices'); const indexName = 'test-my-index'; @@ -81,11 +83,21 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); }); - describe.skip('API key details', () => { - // Flaky test related with deleting API keys + describe('API key details', () => { it('should show api key', async () => { await pageObjects.svlApiKeys.deleteAPIKeys(); await svlSearchNavigation.navigateToIndexDetailPage(indexName); + // sometimes the API key exists in the cluster and its lost in sessionStorage + // if fails we retry to delete the API key and refresh the browser + await retry.try( + async () => { + await pageObjects.svlApiKeys.expectAPIKeyExists(); + }, + async () => { + await pageObjects.svlApiKeys.deleteAPIKeys(); + await browser.refresh(); + } + ); await pageObjects.svlApiKeys.expectAPIKeyAvailable(); const apiKey = await pageObjects.svlApiKeys.getAPIKeyFromUI(); await pageObjects.svlSearchIndexDetailPage.expectAPIKeyToBeVisibleInCodeBlock(apiKey); diff --git a/yarn.lock b/yarn.lock index b936d99ebe74a..31b75569d8c6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2403,12 +2403,11 @@ "@elastic/react-search-ui-views" "1.20.2" "@elastic/search-ui" "1.20.2" -"@elastic/request-converter@^8.16.2": - version "8.16.2" - resolved "https://registry.yarnpkg.com/@elastic/request-converter/-/request-converter-8.16.2.tgz#e82c5c794adf8da37795cb8656e2f0334460cb08" - integrity sha512-bljPrXbXkImBglTz5N8Rrpmzc64ahpZxOkBIKFBX1mnU3kv/JDeMjsv1rvfHXrkuhtQQ4kRRZqfwmqzJIwzlag== +"@elastic/request-converter@^8.17.0": + version "8.17.0" + resolved "https://registry.yarnpkg.com/@elastic/request-converter/-/request-converter-8.17.0.tgz#d2ef8f99f5a3e6c03a51859ad03e0e8a0d450032" + integrity sha512-f5WmQBbTdaDw9KrhVTuHeYbu0kulZfRUN9cNdFgCD78CRAVa353K1iqH5imikZ7NLIltN9itm5q5yyLvbHhs+w== dependencies: - child-process-promise "^2.2.1" commander "^12.1.0" find-my-way-ts "^0.1.2" handlebars "^4.7.8" @@ -5389,7 +5388,7 @@ version "0.0.0" uid "" -"@kbn/doc-links@link:packages/kbn-doc-links": +"@kbn/doc-links@link:src/platform/packages/shared/kbn-doc-links": version "0.0.0" uid "" @@ -15104,15 +15103,6 @@ cheerio@^1.0.0-rc.12, cheerio@^1.0.0-rc.3: parse5 "^7.0.0" parse5-htmlparser2-tree-adapter "^7.0.0" -child-process-promise@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/child-process-promise/-/child-process-promise-2.2.1.tgz#4730a11ef610fad450b8f223c79d31d7bdad8074" - integrity sha512-Fi4aNdqBsr0mv+jgWxcZ/7rAIC2mgihrptyVI4foh/rrjY/3BNjfP9+oaiFx/fzim+1ZyCNBae0DlyfQhSugog== - dependencies: - cross-spawn "^4.0.2" - node-version "^1.0.0" - promise-polyfill "^6.0.1" - chokidar@3.5.3, chokidar@^2.1.2, chokidar@^2.1.8, chokidar@^3.4.0, chokidar@^3.4.1, chokidar@^3.4.2, chokidar@^3.5.1, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -15994,14 +15984,6 @@ cronstrue@^1.51.0: resolved "https://registry.yarnpkg.com/cronstrue/-/cronstrue-1.51.0.tgz#7a63153d61d940344049037628da38a60784c8e2" integrity sha512-fSRAz/MV0TRjeNZKAsovmH/MSsly7+8np4XsfsrjOOz7sjxLrE9SmedRYAs3nPAtLLC5UsMpvenjXYRz463bMA== -cross-spawn@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - integrity sha512-yAXz/pA1tD8Gtg2S98Ekf/sewp3Lcp3YoFKJ4Hkp5h5yLWnKVTDU0kwjKJ8NDCYcfTLfyGkzTikst+jWypT1iA== - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -23582,7 +23564,7 @@ lru-cache@^10.2.0: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== -lru-cache@^4.0.0, lru-cache@^4.0.1, lru-cache@^4.1.5: +lru-cache@^4.0.0, lru-cache@^4.1.5: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== @@ -25121,11 +25103,6 @@ node-source-walk@^6.0.0, node-source-walk@^6.0.1, node-source-walk@^6.0.2: dependencies: "@babel/parser" "^7.21.8" -node-version@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/node-version/-/node-version-1.2.0.tgz#34fde3ffa8e1149bd323983479dda620e1b5060d" - integrity sha512-ma6oU4Sk0qOoKEAymVoTvk8EdXEobdS7m/mAGhDJ8Rouugho48crHBORAmy5BoOcv8wraPM6xumapQp5hl4iIQ== - nodemailer@^6.9.15: version "6.9.15" resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-6.9.15.tgz#57b79dc522be27e0e47ac16cc860aa0673e62e04" @@ -26955,11 +26932,6 @@ promise-inflight@^1.0.1: resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= -promise-polyfill@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-6.1.0.tgz#dfa96943ea9c121fca4de9b5868cb39d3472e057" - integrity sha512-g0LWaH0gFsxovsU7R5LrrhHhWAWiHRnh1GPrhXnPgYsDkIqjRYUYSZEsej/wtleDrz5xVSIDbeKfidztp2XHFQ== - promise-polyfill@^8.1.3: version "8.1.3" resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.1.3.tgz#8c99b3cf53f3a91c68226ffde7bde81d7f904116"