From 03c1ac4d179e447d23b4d66a1459bea1e2461ed7 Mon Sep 17 00:00:00 2001 From: Toby Brain Date: Tue, 1 Oct 2024 04:14:11 +1000 Subject: [PATCH] Support global_data_tags in the policy update request (#194421) ## Summary https://github.com/elastic/kibana/pull/183563 adds support for `global_data_tags` however the field is not added to the update request definition in the OpenAPI spec. This PR defines the field within the API spec. Related to https://github.com/elastic/terraform-provider-elasticstack/pull/730 ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit d922ee1f8c1051633d58b34b5f272619687786de) --- .../output/kibana.serverless.staging.yaml | 11 +++++++++++ oas_docs/output/kibana.serverless.yaml | 11 +++++++++++ oas_docs/output/kibana.staging.yaml | 11 +++++++++++ oas_docs/output/kibana.yaml | 11 +++++++++++ .../plugins/fleet/common/openapi/bundled.json | 19 ++++++++++++++++++- .../plugins/fleet/common/openapi/bundled.yaml | 11 +++++++++++ .../schemas/agent_policy_update_request.yaml | 9 +++++++++ 7 files changed, 82 insertions(+), 1 deletion(-) diff --git a/oas_docs/output/kibana.serverless.staging.yaml b/oas_docs/output/kibana.serverless.staging.yaml index 25e24d418662e..5ad039b419ace 100644 --- a/oas_docs/output/kibana.serverless.staging.yaml +++ b/oas_docs/output/kibana.serverless.staging.yaml @@ -19857,6 +19857,17 @@ components: force: description: Force agent policy creation even if packages are not verified. type: boolean + global_data_tags: + items: + additionalProperties: + oneOf: + - type: string + - type: number + description: >- + User defined data tags that are added to all of the inputs. The + values can be strings or numbers. + type: object + type: array inactivity_timeout: type: integer is_protected: diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 79a90f2d19a09..5c99031eec30b 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -12821,6 +12821,17 @@ components: force: description: Force agent policy creation even if packages are not verified. type: boolean + global_data_tags: + items: + additionalProperties: + oneOf: + - type: string + - type: number + description: >- + User defined data tags that are added to all of the inputs. The + values can be strings or numbers. + type: object + type: array inactivity_timeout: type: integer is_protected: diff --git a/oas_docs/output/kibana.staging.yaml b/oas_docs/output/kibana.staging.yaml index a4f5f7287e30e..2aff7aaf5aefd 100644 --- a/oas_docs/output/kibana.staging.yaml +++ b/oas_docs/output/kibana.staging.yaml @@ -27633,6 +27633,17 @@ components: force: description: Force agent policy creation even if packages are not verified. type: boolean + global_data_tags: + items: + additionalProperties: + oneOf: + - type: string + - type: number + description: >- + User defined data tags that are added to all of the inputs. The + values can be strings or numbers. + type: object + type: array inactivity_timeout: type: integer is_protected: diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index bf9e44e80f8c1..a6fbf9d43fcda 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -19780,6 +19780,17 @@ components: force: description: Force agent policy creation even if packages are not verified. type: boolean + global_data_tags: + items: + additionalProperties: + oneOf: + - type: string + - type: number + description: >- + User defined data tags that are added to all of the inputs. The + values can be strings or numbers. + type: object + type: array inactivity_timeout: type: integer is_protected: diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index 2d74305ad3bd5..7ddd44baacf2d 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -7812,6 +7812,23 @@ "force": { "type": "boolean", "description": "Force agent policy creation even if packages are not verified." + }, + "global_data_tags": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "description": "User defined data tags that are added to all of the inputs. The values can be strings or numbers." + } } }, "required": [ @@ -9563,4 +9580,4 @@ "basicAuth": [] } ] -} +} \ No newline at end of file diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index c36758e8a4432..d60963068b8e5 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -5011,6 +5011,17 @@ components: force: type: boolean description: Force agent policy creation even if packages are not verified. + global_data_tags: + type: array + items: + type: object + additionalProperties: + oneOf: + - type: string + - type: number + description: >- + User defined data tags that are added to all of the inputs. The + values can be strings or numbers. required: - name - namespace diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/agent_policy_update_request.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/agent_policy_update_request.yaml index 7fb5581aa79e4..1d1dbd45037ae 100644 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/agent_policy_update_request.yaml +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/agent_policy_update_request.yaml @@ -47,6 +47,15 @@ properties: force: type: boolean description: Force agent policy creation even if packages are not verified. + global_data_tags: + type: array + items: + type: object + additionalProperties: + oneOf: + - type: string + - type: number + description: User defined data tags that are added to all of the inputs. The values can be strings or numbers. required: - name - namespace