diff --git a/output/schema/schema.json b/output/schema/schema.json index 7feac614f6..e2ed7cd1a9 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -32769,20 +32769,29 @@ "kind": "enum", "members": [ { + "aliases": [ + "GREEN" + ], "description": "All shards are assigned.", "name": "green" }, { + "aliases": [ + "YELLOW" + ], "description": "All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.", "name": "yellow" }, { + "aliases": [ + "RED" + ], "description": "One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.", "name": "red" } ], "name": { - "name": "Health", + "name": "HealthStatus", "namespace": "_types" } }, @@ -36430,24 +36439,6 @@ "namespace": "_types" } }, - { - "kind": "enum", - "members": [ - { - "name": "green" - }, - { - "name": "yellow" - }, - { - "name": "red" - } - ], - "name": { - "name": "WaitForStatus", - "namespace": "_types" - } - }, { "kind": "interface", "name": { @@ -69911,7 +69902,7 @@ "type": { "kind": "instance_of", "type": { - "name": "Health", + "name": "HealthStatus", "namespace": "_types" } } @@ -80109,27 +80100,6 @@ "namespace": "ccr.unfollow" } }, - { - "kind": "enum", - "members": [ - { - "description": "All shards are assigned.", - "name": "green" - }, - { - "description": "All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.", - "name": "yellow" - }, - { - "description": "One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.", - "name": "red" - } - ], - "name": { - "name": "ClusterStatus", - "namespace": "cluster._types" - } - }, { "kind": "interface", "name": { @@ -82003,7 +81973,7 @@ "type": { "kind": "instance_of", "type": { - "name": "Health", + "name": "HealthStatus", "namespace": "_types" } } @@ -82189,7 +82159,7 @@ "type": { "kind": "instance_of", "type": { - "name": "WaitForStatus", + "name": "HealthStatus", "namespace": "_types" } } @@ -82359,7 +82329,7 @@ "type": { "kind": "instance_of", "type": { - "name": "Health", + "name": "HealthStatus", "namespace": "_types" } } @@ -82465,7 +82435,7 @@ "type": { "kind": "instance_of", "type": { - "name": "Health", + "name": "HealthStatus", "namespace": "_types" } } @@ -85776,8 +85746,8 @@ "type": { "kind": "instance_of", "type": { - "name": "ClusterStatus", - "namespace": "cluster._types" + "name": "HealthStatus", + "namespace": "_types" } } }, @@ -89942,27 +89912,6 @@ } ] }, - { - "kind": "enum", - "members": [ - { - "description": "All shards are assigned.", - "name": "green" - }, - { - "description": "All primary shards are assigned, but one or more replica shards are unassigned.", - "name": "yellow" - }, - { - "description": "One or more primary shards are unassigned, so some data is unavailable.", - "name": "red" - } - ], - "name": { - "name": "DataStreamHealthStatus", - "namespace": "indices._types" - } - }, { "kind": "interface", "name": { @@ -95449,8 +95398,8 @@ "type": { "kind": "instance_of", "type": { - "name": "DataStreamHealthStatus", - "namespace": "indices._types" + "name": "HealthStatus", + "namespace": "_types" } } }, @@ -100236,7 +100185,7 @@ { "kind": "instance_of", "type": { - "name": "ShardStatus", + "name": "ShardStoreStatus", "namespace": "indices.shard_stores" } }, @@ -100245,7 +100194,7 @@ "value": { "kind": "instance_of", "type": { - "name": "ShardStatus", + "name": "ShardStoreStatus", "namespace": "indices.shard_stores" } } @@ -100290,31 +100239,6 @@ "namespace": "indices.shard_stores" } }, - { - "kind": "enum", - "members": [ - { - "description": "The primary shard and all replica shards are assigned.", - "name": "green" - }, - { - "description": "One or more replica shards are unassigned.", - "name": "yellow" - }, - { - "description": "The primary shard is unassigned.", - "name": "red" - }, - { - "description": "Return all shards, regardless of health status.", - "name": "all" - } - ], - "name": { - "name": "ShardStatus", - "namespace": "indices.shard_stores" - } - }, { "kind": "interface", "name": { @@ -100468,6 +100392,31 @@ } ] }, + { + "kind": "enum", + "members": [ + { + "description": "The primary shard and all replica shards are assigned.", + "name": "green" + }, + { + "description": "One or more replica shards are unassigned.", + "name": "yellow" + }, + { + "description": "The primary shard is unassigned.", + "name": "red" + }, + { + "description": "Return all shards, regardless of health status.", + "name": "all" + } + ], + "name": { + "name": "ShardStoreStatus", + "namespace": "indices.shard_stores" + } + }, { "kind": "interface", "name": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index f30d03ee88..a44fad4777 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2040,7 +2040,7 @@ export interface GetStats { total: long } -export type Health = 'green' | 'yellow' | 'red' +export type HealthStatus = 'green' | 'GREEN' | 'yellow' | 'YELLOW' | 'red' | 'RED' export type Host = string @@ -2445,8 +2445,6 @@ export type WaitForActiveShards = integer | WaitForActiveShardOptions export type WaitForEvents = 'immediate' | 'urgent' | 'high' | 'normal' | 'low' | 'languid' -export type WaitForStatus = 'green' | 'yellow' | 'red' - export interface WarmerStats { current: long total: long @@ -6212,7 +6210,7 @@ export interface CatIndicesRequest extends CatCatRequestBase { index?: Indices bytes?: Bytes expand_wildcards?: ExpandWildcards - health?: Health + health?: HealthStatus include_unloaded_segments?: boolean pri?: boolean } @@ -7737,8 +7735,6 @@ export interface CcrUnfollowRequest extends RequestBase { export interface CcrUnfollowResponse extends AcknowledgedResponseBase { } -export type ClusterClusterStatus = 'green' | 'yellow' | 'red' - export interface ClusterComponentTemplate { name: Name component_template: ClusterComponentTemplateNode @@ -7932,7 +7928,7 @@ export interface ClusterHealthIndexHealthStats { number_of_shards: integer relocating_shards: integer shards?: Record - status: Health + status: HealthStatus unassigned_shards: integer } @@ -7948,7 +7944,7 @@ export interface ClusterHealthRequest extends RequestBase { wait_for_nodes?: string wait_for_no_initializing_shards?: boolean wait_for_no_relocating_shards?: boolean - wait_for_status?: WaitForStatus + wait_for_status?: HealthStatus } export interface ClusterHealthResponse { @@ -7964,7 +7960,7 @@ export interface ClusterHealthResponse { number_of_nodes: integer number_of_pending_tasks: integer relocating_shards: integer - status: Health + status: HealthStatus task_max_waiting_in_queue_millis: EpochMillis timed_out: boolean unassigned_shards: integer @@ -7975,7 +7971,7 @@ export interface ClusterHealthShardHealthStats { initializing_shards: integer primary_active: boolean relocating_shards: integer - status: Health + status: HealthStatus unassigned_shards: integer } @@ -8358,7 +8354,7 @@ export interface ClusterStatsResponse extends NodesNodesResponseBase { cluster_uuid: Uuid indices: ClusterStatsClusterIndices nodes: ClusterStatsClusterNodes - status: ClusterClusterStatus + status: HealthStatus timestamp: long } @@ -8857,8 +8853,6 @@ export interface IndicesDataStream { hidden?: boolean } -export type IndicesDataStreamHealthStatus = 'green' | 'yellow' | 'red' - export interface IndicesFielddataFrequencyFilter { max: double min: double @@ -9476,7 +9470,7 @@ export interface IndicesGetDataStreamIndicesGetDataStreamItem { template: Name hidden: boolean system?: boolean - status: IndicesDataStreamHealthStatus + status: HealthStatus ilm_policy?: Name _meta?: Metadata } @@ -9985,15 +9979,13 @@ export interface IndicesShardStoresRequest extends RequestBase { allow_no_indices?: boolean expand_wildcards?: ExpandWildcards ignore_unavailable?: boolean - status?: IndicesShardStoresShardStatus | IndicesShardStoresShardStatus[] + status?: IndicesShardStoresShardStoreStatus | IndicesShardStoresShardStoreStatus[] } export interface IndicesShardStoresResponse { indices: Record } -export type IndicesShardStoresShardStatus = 'green' | 'yellow' | 'red' | 'all' - export interface IndicesShardStoresShardStore { allocation: IndicesShardStoresShardStoreAllocation allocation_id: Id @@ -10012,6 +10004,8 @@ export interface IndicesShardStoresShardStoreException { type: string } +export type IndicesShardStoresShardStoreStatus = 'green' | 'yellow' | 'red' | 'all' + export interface IndicesShardStoresShardStoreWrapper { stores: IndicesShardStoresShardStore[] } diff --git a/specification/_types/common.ts b/specification/_types/common.ts index 1b5ff62c88..8fbfd166db 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -195,12 +195,22 @@ export type ExpandWildcards = ExpandWildcard | ExpandWildcard[] /** * Health status of the cluster, based on the state of its primary and replica shards. */ -export enum Health { - /** All shards are assigned. */ +export enum HealthStatus { + // ES will send this enum as upper or lowercase depending on the APIs + /** + * All shards are assigned. + * @aliases GREEN + */ green = 0, - /** All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired. */ + /** + * All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired. + * @aliases YELLOW + */ yellow = 1, - /** One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned. */ + /** + * One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned. + * @aliases RED + */ red = 2 } @@ -263,12 +273,6 @@ export enum WaitForEvents { languid = 5 } -export enum WaitForStatus { - green = 0, - yellow = 1, - red = 2 -} - // Additional properties are the meta fields export class InlineGet implements AdditionalProperties diff --git a/specification/cat/indices/CatIndicesRequest.ts b/specification/cat/indices/CatIndicesRequest.ts index b1a9e29e97..6aa0531af1 100644 --- a/specification/cat/indices/CatIndicesRequest.ts +++ b/specification/cat/indices/CatIndicesRequest.ts @@ -18,7 +18,7 @@ */ import { CatRequestBase } from '@cat/_types/CatBase' -import { Bytes, ExpandWildcards, Health, Indices } from '@_types/common' +import { Bytes, ExpandWildcards, HealthStatus, Indices } from '@_types/common' /** * @rest_spec_name cat.indices @@ -32,7 +32,7 @@ export interface Request extends CatRequestBase { query_parameters: { bytes?: Bytes expand_wildcards?: ExpandWildcards - health?: Health + health?: HealthStatus include_unloaded_segments?: boolean pri?: boolean } diff --git a/specification/cluster/_types/ClusterStatus.ts b/specification/cluster/_types/ClusterStatus.ts deleted file mode 100644 index 031ebc0245..0000000000 --- a/specification/cluster/_types/ClusterStatus.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html - */ -export enum ClusterStatus { - /** All shards are assigned. */ - green = 0, - /** All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired. */ - yellow = 1, - /** One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned. */ - red = 2 -} diff --git a/specification/cluster/health/ClusterHealthRequest.ts b/specification/cluster/health/ClusterHealthRequest.ts index 5514ab5a11..fa232b5fba 100644 --- a/specification/cluster/health/ClusterHealthRequest.ts +++ b/specification/cluster/health/ClusterHealthRequest.ts @@ -20,11 +20,11 @@ import { RequestBase } from '@_types/Base' import { ExpandWildcards, + HealthStatus, Indices, Level, WaitForActiveShards, - WaitForEvents, - WaitForStatus + WaitForEvents } from '@_types/common' import { Time } from '@_types/Time' @@ -90,6 +90,6 @@ export interface Request extends RequestBase { /** * One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status. */ - wait_for_status?: WaitForStatus + wait_for_status?: HealthStatus } } diff --git a/specification/cluster/health/ClusterHealthResponse.ts b/specification/cluster/health/ClusterHealthResponse.ts index 456be5df3f..b238502c88 100644 --- a/specification/cluster/health/ClusterHealthResponse.ts +++ b/specification/cluster/health/ClusterHealthResponse.ts @@ -18,7 +18,7 @@ */ import { Dictionary } from '@spec_utils/Dictionary' -import { Health, IndexName } from '@_types/common' +import { HealthStatus, IndexName } from '@_types/common' import { integer, Percentage } from '@_types/Numeric' import { EpochMillis } from '@_types/Time' import { IndexHealthStats } from './types' @@ -49,7 +49,7 @@ export class Response { number_of_pending_tasks: integer /** The number of shards that are under relocation. */ relocating_shards: integer - status: Health + status: HealthStatus /** The time expressed in milliseconds since the earliest initiated task is waiting for being performed. */ task_max_waiting_in_queue_millis: EpochMillis /** If false the response returned within the period of time that is specified by the timeout parameter (30s by default) */ diff --git a/specification/cluster/health/types.ts b/specification/cluster/health/types.ts index c75f9e0fa7..d93ed4439e 100644 --- a/specification/cluster/health/types.ts +++ b/specification/cluster/health/types.ts @@ -18,7 +18,7 @@ */ import { Dictionary } from '@spec_utils/Dictionary' -import { Health } from '@_types/common' +import { HealthStatus } from '@_types/common' import { integer } from '@_types/Numeric' export class IndexHealthStats { @@ -29,7 +29,7 @@ export class IndexHealthStats { number_of_shards: integer relocating_shards: integer shards?: Dictionary - status: Health + status: HealthStatus unassigned_shards: integer } @@ -38,6 +38,6 @@ export class ShardHealthStats { initializing_shards: integer primary_active: boolean relocating_shards: integer - status: Health + status: HealthStatus unassigned_shards: integer } diff --git a/specification/cluster/stats/ClusterStatsResponse.ts b/specification/cluster/stats/ClusterStatsResponse.ts index cde088d642..56e78f5262 100644 --- a/specification/cluster/stats/ClusterStatsResponse.ts +++ b/specification/cluster/stats/ClusterStatsResponse.ts @@ -17,9 +17,8 @@ * under the License. */ -import { ClusterStatus } from '@cluster/_types/ClusterStatus' import { NodesResponseBase } from '@nodes/_types/NodesResponseBase' -import { Name, Uuid } from '@_types/common' +import { HealthStatus, Name, Uuid } from '@_types/common' import { long } from '@_types/Numeric' import { ClusterIndices, ClusterNodes } from './types' @@ -46,7 +45,7 @@ export class Response extends NodesResponseBase { /** * Health status of the cluster, based on the state of its primary and replica shards. */ - status: ClusterStatus + status: HealthStatus /** * Unix timestamp, in milliseconds, of the last time the cluster statistics were refreshed. * @doc_url https://en.wikipedia.org/wiki/Unix_time diff --git a/specification/indices/get_data_stream/IndicesGetDataStreamResponse.ts b/specification/indices/get_data_stream/IndicesGetDataStreamResponse.ts index ea6a7fac5b..8620b92f49 100644 --- a/specification/indices/get_data_stream/IndicesGetDataStreamResponse.ts +++ b/specification/indices/get_data_stream/IndicesGetDataStreamResponse.ts @@ -17,10 +17,10 @@ * under the License. */ -import { DataStreamHealthStatus } from '@indices/_types/DataStreamStatus' import { DataStreamName, Field, + HealthStatus, IndexName, Metadata, Name, @@ -41,7 +41,7 @@ export class IndicesGetDataStreamItem { hidden: boolean /** @since 7.10.0 */ system?: boolean - status: DataStreamHealthStatus + status: HealthStatus ilm_policy?: Name /** @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-meta-field.html */ _meta?: Metadata diff --git a/specification/indices/shard_stores/IndicesShardStoresRequest.ts b/specification/indices/shard_stores/IndicesShardStoresRequest.ts index 8454c370ca..5c008de280 100644 --- a/specification/indices/shard_stores/IndicesShardStoresRequest.ts +++ b/specification/indices/shard_stores/IndicesShardStoresRequest.ts @@ -19,7 +19,7 @@ import { RequestBase } from '@_types/Base' import { ExpandWildcards, Indices } from '@_types/common' -import { ShardStatus } from './types' +import { ShardStoreStatus } from './types' /** * @rest_spec_name indices.shard_stores @@ -54,6 +54,6 @@ export interface Request extends RequestBase { /** * List of shard health statuses used to limit the request. */ - status?: ShardStatus | ShardStatus[] + status?: ShardStoreStatus | ShardStoreStatus[] } } diff --git a/specification/indices/shard_stores/types.ts b/specification/indices/shard_stores/types.ts index f603087e9c..ebcb64d167 100644 --- a/specification/indices/shard_stores/types.ts +++ b/specification/indices/shard_stores/types.ts @@ -52,7 +52,7 @@ export class ShardStoreWrapper { stores: ShardStore[] } -export enum ShardStatus { +export enum ShardStoreStatus { /** The primary shard and all replica shards are assigned. */ green = 0, /** One or more replica shards are unassigned. */