From e2cad6a1b843d841fcc6ae2def91d5374519c552 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 19 Sep 2024 09:04:54 -0700 Subject: [PATCH 1/2] Add overlay for deep objects in ML analysis_config, datafeed_config, and transform source (#2904) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- Makefile | 4 +- ...aml => elasticsearch-shared-overlays.yaml} | 73 ++++++++++++++++++- 2 files changed, 74 insertions(+), 3 deletions(-) rename docs/overlays/{elasticsearch-shared-example-overlays.yaml => elasticsearch-shared-overlays.yaml} (52%) diff --git a/Makefile b/Makefile index e5a047d692..0f717615a6 100644 --- a/Makefile +++ b/Makefile @@ -61,10 +61,10 @@ contrib: | generate license-check spec-format-fix transform-to-openapi filter-fo overlay-docs: ## Apply overlays to OpenAPI documents @npx bump overlay "output/openapi/elasticsearch-serverless-openapi.json" "docs/overlays/elasticsearch-serverless-openapi-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi.tmp1.json" - @npx bump overlay "output/openapi/elasticsearch-serverless-openapi.tmp1.json" "docs/overlays/elasticsearch-shared-example-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi.tmp2.json" + @npx bump overlay "output/openapi/elasticsearch-serverless-openapi.tmp1.json" "docs/overlays/elasticsearch-shared-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi.tmp2.json" @npx @redocly/cli bundle output/openapi/elasticsearch-serverless-openapi.tmp2.json --ext json -o output/openapi/elasticsearch-serverless-openapi.examples.json @npx bump overlay "output/openapi/elasticsearch-openapi.json" "docs/overlays/elasticsearch-openapi-overlays.yaml" > "output/openapi/elasticsearch-openapi.tmp1.json" - @npx bump overlay "output/openapi/elasticsearch-openapi.tmp1.json" "docs/overlays/elasticsearch-shared-example-overlays.yaml" > "output/openapi/elasticsearch-openapi.tmp2.json" + @npx bump overlay "output/openapi/elasticsearch-openapi.tmp1.json" "docs/overlays/elasticsearch-shared-overlays.yaml" > "output/openapi/elasticsearch-openapi.tmp2.json" @npx @redocly/cli bundle output/openapi/elasticsearch-openapi.tmp2.json --ext json -o output/openapi/elasticsearch-openapi.examples.json rm output/openapi/elasticsearch-serverless-openapi.tmp*.json rm output/openapi/elasticsearch-openapi.tmp*.json diff --git a/docs/overlays/elasticsearch-shared-example-overlays.yaml b/docs/overlays/elasticsearch-shared-overlays.yaml similarity index 52% rename from docs/overlays/elasticsearch-shared-example-overlays.yaml rename to docs/overlays/elasticsearch-shared-overlays.yaml index 11ca8f7182..1f72f24ce9 100644 --- a/docs/overlays/elasticsearch-shared-example-overlays.yaml +++ b/docs/overlays/elasticsearch-shared-overlays.yaml @@ -1,9 +1,80 @@ # Overlays that are applicable to both Elasticsearch and Elasticsearch Serverless OpenAPI documents overlay: 1.0.0 info: - title: Overlays for examples that apply to both Elasticsearcb and Elasticsearch Serverless OpenAPI documents + title: Overlays for changes that apply to both Elasticsearch and Elasticsearch Serverless OpenAPI documents version: 0.0.1 actions: +# Abbreviate and annotate items that are not shown in Bump.sh due to depth limits + - target: "$.components['schemas']['ml._types:Datafeed'].properties.query" + description: Remove query object from anomaly detection datafeed + remove: true + - target: "$.components['schemas']['ml._types:Datafeed'].properties" + description: Re-add a simplified query object in anomaly detection datafeed + update: + query: + x-abbreviated: true + type: object + description: > + The Elasticsearch query domain-specific language (DSL). + This value corresponds to the query object in an Elasticsearch search POST body. + All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. + By default, this property has the following value: `{"match_all": {"boost": 1}}`. + externalDocs: + url: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html + description: Query DSL + - target: "$.components['schemas']['ml._types:CategorizationAnalyzerDefinition'].properties.tokenizer" + description: Remove tokenizer object from ML anomaly detection analysis config + remove: true + - target: "$.components['schemas']['ml._types:CategorizationAnalyzerDefinition'].properties" + description: Re-add a simplified tokenizer object in anomaly detection analysis config + update: + tokenizer: + x-abbreviated: true + oneOf: + - type: object + - type: string + description: > + The name or definition of the tokenizer to use after character filters are applied. + This property is compulsory if `categorization_analyzer` is specified as an object. + Machine learning provides a tokenizer called `ml_standard` that tokenizes in a way that has been determined to produce good categorization results on a variety of log file formats for logs in English. + If you want to use that tokenizer but change the character or token filters, specify `"tokenizer": "ml_standard"` in your `categorization_analyzer`. + Additionally, the `ml_classic` tokenizer is available, which tokenizes in the same way as the non-customizable tokenizer in old versions of the product (before 6.2). + `ml_classic` was the default categorization tokenizer in versions 6.2 to 7.13, so if you need categorization identical to the default for jobs created in these versions, specify `"tokenizer": "ml_classic"` in your `categorization_analyzer`. + externalDocs: + url: https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-tokenizers.html + description: Tokenizer reference + - target: "$.components['schemas']['ml._types:DataframeAnalyticsSource'].properties.query" + description: Remove query object from data frame analytics source + remove: true + - target: "$.components['schemas']['ml._types:DataframeAnalyticsSource'].properties" + description: Re-add a simplified query object in data frame analytics source + update: + query: + x-abbreviated: true + type: object + description: > + The Elasticsearch query domain-specific language (DSL). + This value corresponds to the query object in an Elasticsearch search POST body. + All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. + By default, this property has the following value: `{"match_all": {}}`. + externalDocs: + url: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html + description: Query DSL + - target: "$.components['schemas']['transform._types:Source'].properties.query" + description: Remove query object from transform source + remove: true + - target: "$.components['schemas']['transform._types:Source'].properties" + description: Re-add a simplified query object in transform source + update: + query: + x-abbreviated: true + type: object + description: > + A query clause that retrieves a subset of data from the source index. + externalDocs: + url: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html + description: Query DSL +# Examples - target: "$.components['requestBodies']['async_search.submit']" description: "Add example for asynch search submit request" update: From 2c958abee523a8c25bb627a33317fc4e2b20bb97 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 23 Sep 2024 10:37:05 -0700 Subject: [PATCH 2/2] [OpenAPI] Minor 8.x fixes --- .spectral.yaml | 2 ++ .../elasticsearch-openapi-overlays.yaml | 2 +- ...ticsearch-serverless-openapi-overlays.yaml | 2 +- output/openapi/elasticsearch-openapi.json | 1 + output/schema/schema.json | 27 +++++++++++-------- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.spectral.yaml b/.spectral.yaml index 109addd298..a480fc14c1 100644 --- a/.spectral.yaml +++ b/.spectral.yaml @@ -19,6 +19,8 @@ rules: operation-operationId-valid-in-url: warn operation-tag-defined: warn operation-tags: warn + # Parameters + path-params: warn # Responses operation-success-response: warn # Schema diff --git a/docs/overlays/elasticsearch-openapi-overlays.yaml b/docs/overlays/elasticsearch-openapi-overlays.yaml index a745316d09..150925def5 100644 --- a/docs/overlays/elasticsearch-openapi-overlays.yaml +++ b/docs/overlays/elasticsearch-openapi-overlays.yaml @@ -11,7 +11,7 @@ actions: description: > ## Documentation source and versions - This documentation is derived from the `main` branch of the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification) repository. + This documentation is derived from the `8.x` branch of the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification) repository. It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/). x-doc-license: name: Attribution-NonCommercial-NoDerivatives 4.0 International diff --git a/docs/overlays/elasticsearch-serverless-openapi-overlays.yaml b/docs/overlays/elasticsearch-serverless-openapi-overlays.yaml index d084f0e5a1..83e3dfd796 100644 --- a/docs/overlays/elasticsearch-serverless-openapi-overlays.yaml +++ b/docs/overlays/elasticsearch-serverless-openapi-overlays.yaml @@ -15,7 +15,7 @@ actions: ## Documentation source and versions - This documentation is derived from the `main` branch of the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification) repository. + This documentation is derived from the `8.x` branch of the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification) repository. It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/). x-doc-license: name: Attribution-NonCommercial-NoDerivatives 4.0 International diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index d318702470..35a985a32c 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -105180,6 +105180,7 @@ }, "remote_indices": { "description": "A list of remote indices permissions entries.", + "x-available-since": "8.14.0", "type": "array", "items": { "$ref": "#/components/schemas/security._types:RemoteIndicesPrivileges" diff --git a/output/schema/schema.json b/output/schema/schema.json index 9b563272e6..9f78607065 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -185096,7 +185096,7 @@ } } ], - "specLocation": "security/_types/Privileges.ts#L373-L375" + "specLocation": "security/_types/Privileges.ts#L372-L374" }, { "kind": "interface", @@ -185613,7 +185613,7 @@ } } ], - "specLocation": "security/_types/Privileges.ts#L369-L371" + "specLocation": "security/_types/Privileges.ts#L368-L370" }, { "kind": "enum", @@ -185726,7 +185726,7 @@ "name": "IndexPrivilege", "namespace": "security._types" }, - "specLocation": "security/_types/Privileges.ts#L325-L367" + "specLocation": "security/_types/Privileges.ts#L324-L366" }, { "kind": "interface", @@ -185819,7 +185819,7 @@ "name": "IndicesPrivilegesQuery", "namespace": "security._types" }, - "specLocation": "security/_types/Privileges.ts#L280-L288", + "specLocation": "security/_types/Privileges.ts#L279-L287", "type": { "kind": "union_of", "items": [ @@ -185869,7 +185869,7 @@ } } ], - "specLocation": "security/_types/Privileges.ts#L377-L379" + "specLocation": "security/_types/Privileges.ts#L376-L378" }, { "kind": "interface", @@ -185992,7 +185992,7 @@ } } ], - "specLocation": "security/_types/Privileges.ts#L226-L254" + "specLocation": "security/_types/Privileges.ts#L225-L253" }, { "kind": "interface", @@ -186484,7 +186484,7 @@ "name": "RoleTemplateInlineQuery", "namespace": "security._types" }, - "specLocation": "security/_types/Privileges.ts#L322-L323", + "specLocation": "security/_types/Privileges.ts#L321-L322", "type": { "kind": "union_of", "items": [ @@ -186527,7 +186527,7 @@ } } ], - "specLocation": "security/_types/Privileges.ts#L290-L300" + "specLocation": "security/_types/Privileges.ts#L289-L299" }, { "kind": "interface", @@ -186615,7 +186615,7 @@ } ], "shortcutProperty": "source", - "specLocation": "security/_types/Privileges.ts#L302-L320" + "specLocation": "security/_types/Privileges.ts#L301-L319" }, { "kind": "enum", @@ -186826,7 +186826,7 @@ } } ], - "specLocation": "security/_types/Privileges.ts#L256-L278" + "specLocation": "security/_types/Privileges.ts#L255-L277" }, { "kind": "interface", @@ -192451,6 +192451,11 @@ } }, { + "availability": { + "stack": { + "since": "8.14.0" + } + }, "description": "A list of remote indices permissions entries.", "name": "remote_indices", "required": false, @@ -192566,7 +192571,7 @@ } } ], - "specLocation": "security/put_role/SecurityPutRoleRequest.ts#L31-L89" + "specLocation": "security/put_role/SecurityPutRoleRequest.ts#L31-L91" }, { "kind": "response",