From f50e3962fe2dedb67b7eb5458e26c21c4e6dad0d Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Tue, 12 Dec 2023 15:34:07 +0100 Subject: [PATCH] Add codegen_name annotations to ManagedBy (#2368) --- .github/workflows/validate-pr.yml | 2 +- .../elasticsearch-serverless-openapi.json | 30 +--- output/schema/schema.json | 157 +++++++++--------- output/typescript/types.ts | 8 +- specification/indices/_types/DataStream.ts | 3 + 5 files changed, 93 insertions(+), 107 deletions(-) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index a66deb73eb..5f227bd870 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -18,7 +18,7 @@ jobs: if: github.repository_owner == 'elastic' # this action will fail if executed from a fork runs-on: ubuntu-latest env: - STACK_VERSION: 8.10-SNAPSHOT + STACK_VERSION: 8.12-SNAPSHOT steps: - uses: actions/checkout@v2 diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 9d1f3e3f58..57f0ef61f2 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -48522,7 +48522,7 @@ "$ref": "#/components/schemas/_types:Name" }, "next_generation_managed_by": { - "$ref": "#/components/schemas/_types:ManagedBy" + "$ref": "#/components/schemas/indices._types:ManagedBy" }, "prefer_ilm": { "description": "Indicates if ILM should take precedence over DSL in case both are configured to managed this data stream.", @@ -48571,26 +48571,12 @@ "timestamp_field" ] }, - "_types:ManagedBy": { - "oneOf": [ - { - "type": "string", - "enum": [ - "Index Lifecycle Management" - ] - }, - { - "type": "string", - "enum": [ - "Data stream lifecycle" - ] - }, - { - "type": "string", - "enum": [ - "Unmanaged" - ] - } + "indices._types:ManagedBy": { + "type": "string", + "enum": [ + "Index Lifecycle Management", + "Data stream lifecycle", + "Unmanaged" ] }, "indices._types:DataStreamIndex": { @@ -48606,7 +48592,7 @@ "$ref": "#/components/schemas/_types:Name" }, "managed_by": { - "$ref": "#/components/schemas/_types:ManagedBy" + "$ref": "#/components/schemas/indices._types:ManagedBy" }, "prefer_ilm": { "description": "Indicates if ILM should take precedence over DSL in case both are configured to manage this index.", diff --git a/output/schema/schema.json b/output/schema/schema.json index 4795dd0e76..24c14ea7b1 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -40293,7 +40293,7 @@ "name": "AggregateName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L150-L154", + "specLocation": "_types/common.ts#L145-L149", "type": { "kind": "instance_of", "type": { @@ -40502,7 +40502,7 @@ "name": "ByteSize", "namespace": "_types" }, - "specLocation": "_types/common.ts#L101-L102", + "specLocation": "_types/common.ts#L96-L97", "type": { "items": [ { @@ -40555,7 +40555,7 @@ "name": "Bytes", "namespace": "_types" }, - "specLocation": "_types/common.ts#L174-L192" + "specLocation": "_types/common.ts#L169-L187" }, { "kind": "type_alias", @@ -40698,7 +40698,7 @@ "name": "ClusterInfoTarget", "namespace": "_types" }, - "specLocation": "_types/common.ts#L389-L395" + "specLocation": "_types/common.ts#L384-L390" }, { "kind": "type_alias", @@ -40706,7 +40706,7 @@ "name": "ClusterInfoTargets", "namespace": "_types" }, - "specLocation": "_types/common.ts#L397-L397", + "specLocation": "_types/common.ts#L392-L392", "type": { "items": [ { @@ -40925,7 +40925,7 @@ "name": "Conflicts", "namespace": "_types" }, - "specLocation": "_types/common.ts#L194-L203" + "specLocation": "_types/common.ts#L189-L198" }, { "kind": "interface", @@ -41058,7 +41058,7 @@ "name": "DataStreamName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L96-L97", + "specLocation": "_types/common.ts#L91-L92", "type": { "kind": "instance_of", "type": { @@ -41073,7 +41073,7 @@ "name": "DataStreamNames", "namespace": "_types" }, - "specLocation": "_types/common.ts#L99-L99", + "specLocation": "_types/common.ts#L94-L94", "type": { "items": [ { @@ -41446,7 +41446,7 @@ "namespace": "_types" }, "properties": [], - "specLocation": "_types/common.ts#L165-L166" + "specLocation": "_types/common.ts#L160-L161" }, { "generics": [ @@ -41654,7 +41654,7 @@ "name": "ExpandWildcard", "namespace": "_types" }, - "specLocation": "_types/common.ts#L212-L226" + "specLocation": "_types/common.ts#L207-L221" }, { "kind": "type_alias", @@ -41662,7 +41662,7 @@ "name": "ExpandWildcards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L228-L228", + "specLocation": "_types/common.ts#L223-L223", "type": { "items": [ { @@ -41693,7 +41693,7 @@ "name": "Field", "namespace": "_types" }, - "specLocation": "_types/common.ts#L143-L144", + "specLocation": "_types/common.ts#L138-L139", "type": { "kind": "instance_of", "type": { @@ -42007,7 +42007,7 @@ "name": "Fields", "namespace": "_types" }, - "specLocation": "_types/common.ts#L145-L145", + "specLocation": "_types/common.ts#L140-L140", "type": { "items": [ { @@ -42102,7 +42102,7 @@ "name": "Fuzziness", "namespace": "_types" }, - "specLocation": "_types/common.ts#L138-L139", + "specLocation": "_types/common.ts#L133-L134", "type": { "items": [ { @@ -42717,7 +42717,7 @@ "name": "HealthStatus", "namespace": "_types" }, - "specLocation": "_types/common.ts#L230-L250" + "specLocation": "_types/common.ts#L225-L245" }, { "kind": "type_alias", @@ -42740,7 +42740,7 @@ "name": "HttpHeaders", "namespace": "_types" }, - "specLocation": "_types/common.ts#L163-L163", + "specLocation": "_types/common.ts#L158-L158", "type": { "key": { "kind": "instance_of", @@ -43217,7 +43217,7 @@ } } ], - "specLocation": "_types/common.ts#L343-L370" + "specLocation": "_types/common.ts#L338-L365" }, { "inherits": { @@ -43356,7 +43356,7 @@ } } ], - "specLocation": "_types/common.ts#L332-L341" + "specLocation": "_types/common.ts#L327-L336" }, { "inherits": { @@ -43609,7 +43609,7 @@ "name": "Level", "namespace": "_types" }, - "specLocation": "_types/common.ts#L260-L264" + "specLocation": "_types/common.ts#L255-L259" }, { "kind": "enum", @@ -43630,31 +43630,6 @@ }, "specLocation": "_types/Lifecycle.ts#L20-L24" }, - { - "kind": "type_alias", - "name": { - "name": "ManagedBy", - "namespace": "_types" - }, - "specLocation": "_types/common.ts#L80-L83", - "type": { - "items": [ - { - "kind": "literal_value", - "value": "Index Lifecycle Management" - }, - { - "kind": "literal_value", - "value": "Data stream lifecycle" - }, - { - "kind": "literal_value", - "value": "Unmanaged" - } - ], - "kind": "union_of" - } - }, { "kind": "type_alias", "name": { @@ -43889,7 +43864,7 @@ "name": "Metadata", "namespace": "_types" }, - "specLocation": "_types/common.ts#L104-L104", + "specLocation": "_types/common.ts#L99-L99", "type": { "key": { "kind": "instance_of", @@ -43944,7 +43919,7 @@ "name": "MinimumShouldMatch", "namespace": "_types" }, - "specLocation": "_types/common.ts#L168-L172", + "specLocation": "_types/common.ts#L163-L167", "type": { "items": [ { @@ -43973,7 +43948,7 @@ "name": "MultiTermQueryRewrite", "namespace": "_types" }, - "specLocation": "_types/common.ts#L140-L141", + "specLocation": "_types/common.ts#L135-L136", "type": { "kind": "instance_of", "type": { @@ -43988,7 +43963,7 @@ "name": "Name", "namespace": "_types" }, - "specLocation": "_types/common.ts#L85-L85", + "specLocation": "_types/common.ts#L80-L80", "type": { "kind": "instance_of", "type": { @@ -44003,7 +43978,7 @@ "name": "Names", "namespace": "_types" }, - "specLocation": "_types/common.ts#L86-L86", + "specLocation": "_types/common.ts#L81-L81", "type": { "items": [ { @@ -44033,7 +44008,7 @@ "name": "Namespace", "namespace": "_types" }, - "specLocation": "_types/common.ts#L88-L88", + "specLocation": "_types/common.ts#L83-L83", "type": { "kind": "instance_of", "type": { @@ -44259,7 +44234,7 @@ "name": "NodeName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L93-L94", + "specLocation": "_types/common.ts#L88-L89", "type": { "kind": "instance_of", "type": { @@ -44595,7 +44570,7 @@ "name": "OpType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L266-L275" + "specLocation": "_types/common.ts#L261-L270" }, { "kind": "type_alias", @@ -44603,7 +44578,7 @@ "name": "Password", "namespace": "_types" }, - "specLocation": "_types/common.ts#L206-L206", + "specLocation": "_types/common.ts#L201-L201", "type": { "kind": "instance_of", "type": { @@ -44645,7 +44620,7 @@ "name": "PipelineName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L91-L91", + "specLocation": "_types/common.ts#L86-L86", "type": { "kind": "instance_of", "type": { @@ -44772,7 +44747,7 @@ "name": "PropertyName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L135-L135", + "specLocation": "_types/common.ts#L130-L130", "type": { "kind": "instance_of", "type": { @@ -45044,7 +45019,7 @@ "name": "Refresh", "namespace": "_types" }, - "specLocation": "_types/common.ts#L277-L284" + "specLocation": "_types/common.ts#L272-L279" }, { "kind": "interface", @@ -45146,7 +45121,7 @@ "name": "RelationName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L136-L136", + "specLocation": "_types/common.ts#L131-L131", "type": { "kind": "instance_of", "type": { @@ -46064,7 +46039,7 @@ "name": "SearchType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L286-L291" + "specLocation": "_types/common.ts#L281-L286" }, { "kind": "interface", @@ -46379,7 +46354,7 @@ "name": "SequenceNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L133-L133", + "specLocation": "_types/common.ts#L128-L128", "type": { "kind": "instance_of", "type": { @@ -46394,7 +46369,7 @@ "name": "Service", "namespace": "_types" }, - "specLocation": "_types/common.ts#L89-L89", + "specLocation": "_types/common.ts#L84-L84", "type": { "kind": "instance_of", "type": { @@ -46613,7 +46588,7 @@ "name": "Slices", "namespace": "_types" }, - "specLocation": "_types/common.ts#L372-L377", + "specLocation": "_types/common.ts#L367-L372", "type": { "items": [ { @@ -46646,7 +46621,7 @@ "name": "SlicesCalculation", "namespace": "_types" }, - "specLocation": "_types/common.ts#L379-L387" + "specLocation": "_types/common.ts#L374-L382" }, { "kind": "type_alias", @@ -47042,7 +47017,7 @@ "name": "SuggestMode", "namespace": "_types" }, - "specLocation": "_types/common.ts#L293-L306" + "specLocation": "_types/common.ts#L288-L301" }, { "description": "The suggestion name as returned from the server. Depending whether typed_keys is specified this could come back\nin the form of `name#type` instead of simply `name`", @@ -47051,7 +47026,7 @@ "name": "SuggestionName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L156-L160", + "specLocation": "_types/common.ts#L151-L155", "type": { "kind": "instance_of", "type": { @@ -47120,7 +47095,7 @@ "name": "TaskId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L137-L137", + "specLocation": "_types/common.ts#L132-L132", "type": { "items": [ { @@ -47196,7 +47171,7 @@ "name": "ThreadType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L308-L314" + "specLocation": "_types/common.ts#L303-L309" }, { "description": "Time of day, expressed as HH:MM:SS", @@ -47552,7 +47527,7 @@ "name": "Username", "namespace": "_types" }, - "specLocation": "_types/common.ts#L205-L205", + "specLocation": "_types/common.ts#L200-L200", "type": { "kind": "instance_of", "type": { @@ -47567,7 +47542,7 @@ "name": "Uuid", "namespace": "_types" }, - "specLocation": "_types/common.ts#L130-L130", + "specLocation": "_types/common.ts#L125-L125", "type": { "kind": "instance_of", "type": { @@ -47582,7 +47557,7 @@ "name": "VersionNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L107-L107", + "specLocation": "_types/common.ts#L102-L102", "type": { "kind": "instance_of", "type": { @@ -47597,7 +47572,7 @@ "name": "VersionString", "namespace": "_types" }, - "specLocation": "_types/common.ts#L109-L109", + "specLocation": "_types/common.ts#L104-L104", "type": { "kind": "instance_of", "type": { @@ -47629,7 +47604,7 @@ "name": "VersionType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L111-L127" + "specLocation": "_types/common.ts#L106-L122" }, { "kind": "enum", @@ -47645,7 +47620,7 @@ "name": "WaitForActiveShardOptions", "namespace": "_types" }, - "specLocation": "_types/common.ts#L316-L320" + "specLocation": "_types/common.ts#L311-L315" }, { "codegenNames": [ @@ -47657,7 +47632,7 @@ "name": "WaitForActiveShards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L147-L148", + "specLocation": "_types/common.ts#L142-L143", "type": { "items": [ { @@ -47704,7 +47679,7 @@ "name": "WaitForEvents", "namespace": "_types" }, - "specLocation": "_types/common.ts#L322-L329" + "specLocation": "_types/common.ts#L317-L324" }, { "kind": "interface", @@ -110679,7 +110654,7 @@ "kind": "instance_of", "type": { "name": "ManagedBy", - "namespace": "_types" + "namespace": "indices._types" } } }, @@ -110813,7 +110788,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L33-L105" + "specLocation": "indices/_types/DataStream.ts#L41-L113" }, { "kind": "interface", @@ -110866,7 +110841,7 @@ "kind": "instance_of", "type": { "name": "ManagedBy", - "namespace": "_types" + "namespace": "indices._types" } } }, @@ -110883,7 +110858,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L114-L135" + "specLocation": "indices/_types/DataStream.ts#L122-L143" }, { "description": "Data lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration.", @@ -111130,7 +111105,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L107-L112" + "specLocation": "indices/_types/DataStream.ts#L115-L120" }, { "kind": "interface", @@ -111151,7 +111126,7 @@ } } ], - "specLocation": "indices/_types/DataStream.ts#L137-L139" + "specLocation": "indices/_types/DataStream.ts#L145-L147" }, { "kind": "interface", @@ -113265,6 +113240,28 @@ ], "specLocation": "indices/_types/IndexSettings.ts#L554-L561" }, + { + "kind": "enum", + "members": [ + { + "codegenName": "ilm", + "name": "Index Lifecycle Management" + }, + { + "codegenName": "datastream", + "name": "Data stream lifecycle" + }, + { + "codegenName": "unmanaged", + "name": "Unmanaged" + } + ], + "name": { + "name": "ManagedBy", + "namespace": "indices._types" + }, + "specLocation": "indices/_types/DataStream.ts#L32-L39" + }, { "description": "Mapping Limit Settings", "docId": "mapping-settings-limit", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 80680827fb..88c0cde8e5 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2356,8 +2356,6 @@ export type Level = 'cluster' | 'indices' | 'shards' export type LifecycleOperationMode = 'RUNNING' | 'STOPPING' | 'STOPPED' -export type ManagedBy = 'Index Lifecycle Management' | 'Data stream lifecycle' | 'Unmanaged' - export type MapboxVectorTiles = ArrayBuffer export interface MergesStats { @@ -9682,7 +9680,7 @@ export interface IndicesDataStream { generation: integer hidden: boolean ilm_policy?: Name - next_generation_managed_by: ManagedBy + next_generation_managed_by: IndicesManagedBy prefer_ilm: boolean indices: IndicesDataStreamIndex[] lifecycle?: IndicesDataStreamLifecycleWithRollover @@ -9698,7 +9696,7 @@ export interface IndicesDataStreamIndex { index_name: IndexName index_uuid: Uuid ilm_policy?: Name - managed_by: ManagedBy + managed_by: IndicesManagedBy prefer_ilm: boolean } @@ -9947,6 +9945,8 @@ export interface IndicesIndexingSlowlogTresholds { index?: IndicesSlowlogTresholdLevels } +export type IndicesManagedBy = 'Index Lifecycle Management' | 'Data stream lifecycle' | 'Unmanaged' + export interface IndicesMappingLimitSettings { coerce?: boolean total_fields?: IndicesMappingLimitSettingsTotalFields diff --git a/specification/indices/_types/DataStream.ts b/specification/indices/_types/DataStream.ts index aeb9b20fbe..d8f2514853 100644 --- a/specification/indices/_types/DataStream.ts +++ b/specification/indices/_types/DataStream.ts @@ -30,8 +30,11 @@ import { integer } from '@_types/Numeric' import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle' enum ManagedBy { + /** @codegen_name ilm */ 'Index Lifecycle Management', + /** @codegen_name datastream */ 'Data stream lifecycle', + /** @codegen_name unmanaged */ 'Unmanaged' }