From 0897226a882608906bea8bbc8a97355761df5033 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 17 Nov 2025 17:20:51 +0400 Subject: [PATCH 1/5] Add profiling stubs The purpose is to add enough data to generate the rest-api-spec. --- compiler/src/steps/validate-model.ts | 7 - output/schema/schema.json | 228 +++++++++++++++++- output/typescript/types.ts | 24 ++ specification/_doc_ids/table.csv | 1 + .../flamegraph/ProfilingFlamegraphRequest.ts | 39 +++ .../flamegraph/ProfilingFlamegraphResponse.ts | 25 ++ .../ProfilingStacktracesRequest.ts | 39 +++ .../ProfilingStacktracesResponse.ts | 25 ++ .../status/ProfilingStatusRequest.ts | 55 +++++ .../status/ProfilingStatusResponse.ts | 24 ++ specification/profiling/status/types.ts | 24 ++ specification/tsconfig.json | 1 + 12 files changed, 476 insertions(+), 16 deletions(-) create mode 100644 specification/profiling/flamegraph/ProfilingFlamegraphRequest.ts create mode 100644 specification/profiling/flamegraph/ProfilingFlamegraphResponse.ts create mode 100644 specification/profiling/stacktraces/ProfilingStacktracesRequest.ts create mode 100644 specification/profiling/stacktraces/ProfilingStacktracesResponse.ts create mode 100644 specification/profiling/status/ProfilingStatusRequest.ts create mode 100644 specification/profiling/status/ProfilingStatusResponse.ts create mode 100644 specification/profiling/status/types.ts diff --git a/compiler/src/steps/validate-model.ts b/compiler/src/steps/validate-model.ts index cbdd60a130..e65a6278f2 100644 --- a/compiler/src/steps/validate-model.ts +++ b/compiler/src/steps/validate-model.ts @@ -37,8 +37,6 @@ enum JsonEvent { array = 'array' } -const privateNamespaces = ['_internal', 'profiling'] - /** * Validates the internal consistency of the model (doesn't check the json spec) * @@ -220,11 +218,6 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma function validateEndpoint (endpoint: model.Endpoint): void { setRootContext(endpoint.name, 'request') - // Skip validation for internal endpoints - if (privateNamespaces.some(ns => endpoint.name.startsWith(ns))) { - return - } - if (endpoint.request !== null) { const reqType = getTypeDef(endpoint.request) diff --git a/output/schema/schema.json b/output/schema/schema.json index f070877591..dfa4a51c55 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -16703,15 +16703,22 @@ "visibility": "private" } }, - "description": "Extracts a UI-optimized structure to render flamegraphs from Universal Profiling", + "description": "Returns basic information about the status of Universal Profiling.", + "docId": "universal-profiling", "docUrl": "https://www.elastic.co/guide/en/observability/current/universal-profiling.html", "name": "profiling.flamegraph", - "request": null, + "request": { + "name": "Request", + "namespace": "profiling.flamegraph" + }, "requestBodyRequired": true, "requestMediaType": [ "application/json" ], - "response": null, + "response": { + "name": "Response", + "namespace": "profiling.flamegraph" + }, "responseMediaType": [ "application/json" ], @@ -16731,15 +16738,22 @@ "visibility": "private" } }, - "description": "Extracts raw stacktrace information from Universal Profiling", + "description": "Extracts raw stacktrace information from Universal Profiling.", + "docId": "universal-profiling", "docUrl": "https://www.elastic.co/guide/en/observability/current/universal-profiling.html", "name": "profiling.stacktraces", - "request": null, + "request": { + "name": "Request", + "namespace": "profiling.stacktraces" + }, "requestBodyRequired": true, "requestMediaType": [ "application/json" ], - "response": null, + "response": { + "name": "Response", + "namespace": "profiling.stacktraces" + }, "responseMediaType": [ "application/json" ], @@ -16759,12 +16773,19 @@ "visibility": "private" } }, - "description": "Returns basic information about the status of Universal Profiling", + "description": "Returns basic information about the status of Universal Profiling.", + "docId": "universal-profiling", "docUrl": "https://www.elastic.co/guide/en/observability/current/universal-profiling.html", "name": "profiling.status", - "request": null, + "request": { + "name": "Request", + "namespace": "profiling.status" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "profiling.status" + }, "responseMediaType": [ "application/json" ], @@ -232634,6 +232655,195 @@ ], "specLocation": "nodes/usage/NodesUsageResponse.ts#L25-L28" }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "value", + "codegenName": "conditions", + "value": { + "kind": "user_defined_value" + } + }, + "description": "Returns basic information about the status of Universal Profiling.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "profiling.flamegraph" + }, + "path": [], + "query": [], + "specLocation": "profiling/flamegraph/ProfilingFlamegraphRequest.ts#L23-L39" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "flamegraph", + "value": { + "kind": "user_defined_value" + } + }, + "name": { + "name": "Response", + "namespace": "profiling.flamegraph" + }, + "specLocation": "profiling/flamegraph/ProfilingFlamegraphResponse.ts#L22-L25" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "value", + "codegenName": "conditions", + "value": { + "kind": "user_defined_value" + } + }, + "description": "Extracts raw stacktrace information from Universal Profiling.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "profiling.stacktraces" + }, + "path": [], + "query": [], + "specLocation": "profiling/stacktraces/ProfilingStacktracesRequest.ts#L23-L39" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "flamegraph", + "value": { + "kind": "user_defined_value" + } + }, + "name": { + "name": "Response", + "namespace": "profiling.stacktraces" + }, + "specLocation": "profiling/stacktraces/ProfilingStacktracesResponse.ts#L22-L25" + }, + { + "kind": "enum", + "members": [ + { + "name": "RUNNING" + }, + { + "name": "STOPPING" + }, + { + "name": "STOPPED" + } + ], + "name": { + "name": "ProfilingOperationMode", + "namespace": "profiling.status" + }, + "specLocation": "profiling/status/types.ts#L20-L24" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Returns basic information about the status of Universal Profiling.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "profiling.status" + }, + "path": [], + "query": [ + { + "description": "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "Whether to return immediately or wait until resources have been created", + "name": "wait_for_resources_created", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "profiling/status/ProfilingStatusRequest.ts#L23-L55" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "operation_mode", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ProfilingOperationMode", + "namespace": "profiling.status" + } + } + } + ] + }, + "name": { + "name": "Response", + "namespace": "profiling.status" + }, + "specLocation": "profiling/status/ProfilingStatusResponse.ts#L22-L24" + }, { "kind": "interface", "name": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index b13f830b19..2e500d8bf6 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -19705,6 +19705,30 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { nodes: Record } +export interface ProfilingFlamegraphRequest extends RequestBase { + body?: any +} + +export type ProfilingFlamegraphResponse = any + +export interface ProfilingStacktracesRequest extends RequestBase { + body?: any +} + +export type ProfilingStacktracesResponse = any + +export type ProfilingStatusProfilingOperationMode = 'RUNNING' | 'STOPPING' | 'STOPPED' + +export interface ProfilingStatusRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration + wait_for_resources_created?: boolean +} + +export interface ProfilingStatusResponse { + operation_mode: ProfilingStatusProfilingOperationMode +} + export interface ProjectTagsProjectTags { origin: Partial> linked_projects?: Record diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index ecc06c3d61..72966a7bd4 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -936,6 +936,7 @@ time-value,https://github.com/elastic/elasticsearch/blob/current/libs/core/src/m time-zone-id,https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html,, transform-set-upgrade-mode,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-set-upgrade-mode,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/transform-set-upgrade-mode.html, trim-processor,https://www.elastic.co/docs/reference/enrich-processor/trim-processor,, +universal-profiling,https://www.elastic.co/guide/en/observability/current/universal-profiling.html,, update-by-query,https://www.elastic.co/docs/reference/elasticsearch/rest-apis/update-by-query-api,, update-dfanalytics,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-data-frame-analytics,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/update-dfanalytics.html, update-desired-nodes,https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cluster,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/cluster.html, diff --git a/specification/profiling/flamegraph/ProfilingFlamegraphRequest.ts b/specification/profiling/flamegraph/ProfilingFlamegraphRequest.ts new file mode 100644 index 0000000000..da2dcc4cef --- /dev/null +++ b/specification/profiling/flamegraph/ProfilingFlamegraphRequest.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +import { RequestBase } from '@_types/Base' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' + +/** + * Returns basic information about the status of Universal Profiling. + * + * @rest_spec_name profiling.flamegraph + * @availability stack stability=stable visibility=private + * @doc_id universal-profiling + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_profiling/flamegraph' + methods: ['POST'] + } + ] + /** @codegen_name conditions */ + body: UserDefinedValue +} diff --git a/specification/profiling/flamegraph/ProfilingFlamegraphResponse.ts b/specification/profiling/flamegraph/ProfilingFlamegraphResponse.ts new file mode 100644 index 0000000000..a794f99949 --- /dev/null +++ b/specification/profiling/flamegraph/ProfilingFlamegraphResponse.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' + +export class Response { + /** @codegen_name flamegraph */ + body: UserDefinedValue +} diff --git a/specification/profiling/stacktraces/ProfilingStacktracesRequest.ts b/specification/profiling/stacktraces/ProfilingStacktracesRequest.ts new file mode 100644 index 0000000000..6a44713c85 --- /dev/null +++ b/specification/profiling/stacktraces/ProfilingStacktracesRequest.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +import { RequestBase } from '@_types/Base' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' + +/** + * Extracts raw stacktrace information from Universal Profiling. + * + * @rest_spec_name profiling.stacktraces + * @availability stack stability=stable visibility=private + * @doc_id universal-profiling + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_profiling/stacktraces' + methods: ['POST'] + } + ] + /** @codegen_name conditions */ + body: UserDefinedValue +} diff --git a/specification/profiling/stacktraces/ProfilingStacktracesResponse.ts b/specification/profiling/stacktraces/ProfilingStacktracesResponse.ts new file mode 100644 index 0000000000..a794f99949 --- /dev/null +++ b/specification/profiling/stacktraces/ProfilingStacktracesResponse.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' + +export class Response { + /** @codegen_name flamegraph */ + body: UserDefinedValue +} diff --git a/specification/profiling/status/ProfilingStatusRequest.ts b/specification/profiling/status/ProfilingStatusRequest.ts new file mode 100644 index 0000000000..e214193301 --- /dev/null +++ b/specification/profiling/status/ProfilingStatusRequest.ts @@ -0,0 +1,55 @@ +/* + * 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. + */ + +import { RequestBase } from '@_types/Base' +import { Duration } from '@_types/Time' + +/** + * Returns basic information about the status of Universal Profiling. + * + * @rest_spec_name profiling.status + * @availability stack stability=stable visibility=private + * @doc_id universal-profiling + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_profiling/status' + methods: ['GET'] + } + ] + query_parameters: { + /** + * Period to wait for a connection to the master node. + * If no response is received before the timeout expires, the request fails and returns an error. + * @server_default 30s + */ + master_timeout?: Duration + /** + * Period to wait for a response. + * If no response is received before the timeout expires, the request fails and returns an error. + * @server_default 30s + */ + timeout?: Duration + /** + * Whether to return immediately or wait until resources have been created + */ + wait_for_resources_created?: boolean + } +} diff --git a/specification/profiling/status/ProfilingStatusResponse.ts b/specification/profiling/status/ProfilingStatusResponse.ts new file mode 100644 index 0000000000..1fd2e69375 --- /dev/null +++ b/specification/profiling/status/ProfilingStatusResponse.ts @@ -0,0 +1,24 @@ +/* + * 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. + */ + +import { ProfilingOperationMode } from './types' + +export class Response { + body: { operation_mode: ProfilingOperationMode } +} diff --git a/specification/profiling/status/types.ts b/specification/profiling/status/types.ts new file mode 100644 index 0000000000..7b5295e105 --- /dev/null +++ b/specification/profiling/status/types.ts @@ -0,0 +1,24 @@ +/* + * 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. + */ + +export enum ProfilingOperationMode { + RUNNING, + STOPPING, + STOPPED +} diff --git a/specification/tsconfig.json b/specification/tsconfig.json index a3e164744e..0b28dc8982 100644 --- a/specification/tsconfig.json +++ b/specification/tsconfig.json @@ -42,6 +42,7 @@ "@ml/*": ["ml/*"], "@monitoring/*": ["monitoring/*"], "@nodes/*": ["nodes/*"], + "@profiling/*": ["profiling/*"], "@project/*": ["project/*"], "@query_ruleset/*": ["query_ruleset/*"], "@rollup/*": ["rollup/*"], From 2a71045e4c78c5482213d98006a43cc8f0432ae0 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 21 Nov 2025 17:08:01 +0400 Subject: [PATCH 2/5] Add _internal endpoints They are only here for the purpose of generating rest-api-spec files, so a lot of the content is empty. --- .../InternalDeleteDesiredBalanceRequest.ts | 44 ++++++++++++ .../InternalDeleteDesiredBalanceResponse.ts | 24 +++++++ .../InternalDeleteDesiredNodesRequest.ts | 50 ++++++++++++++ .../InternalDeleteDesiredNodesResponse.ts | 24 +++++++ .../InternalGetDesiredBalanceRequest.ts | 44 ++++++++++++ .../InternalGetDesiredBalanceResponse.ts | 25 +++++++ .../InternalGetDesiredNodesRequest.ts | 44 ++++++++++++ .../InternalGetDesiredNodesResponse.ts | 25 +++++++ .../InternalPrevalidateNodeRemovalRequest.ts | 64 ++++++++++++++++++ .../InternalPrevalidateNodeRemovalResponse.ts | 25 +++++++ .../InternalUpdateDesiredNodesRequest.ts | 67 +++++++++++++++++++ .../InternalUpdateDesiredNodesResponse.ts | 25 +++++++ 12 files changed, 461 insertions(+) create mode 100644 specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts create mode 100644 specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts create mode 100644 specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts create mode 100644 specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts create mode 100644 specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts create mode 100644 specification/_internal/get_desired_balance/InternalGetDesiredBalanceResponse.ts create mode 100644 specification/_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts create mode 100644 specification/_internal/get_desired_nodes/InternalGetDesiredNodesResponse.ts create mode 100644 specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts create mode 100644 specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalResponse.ts create mode 100644 specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts create mode 100644 specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesResponse.ts diff --git a/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts new file mode 100644 index 0000000000..25bba1b4e0 --- /dev/null +++ b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +import { RequestBase } from '@_types/Base' +import { Duration } from '@_types/Time' + + +/** + * This API is a diagnostics API and the output should not be relied upon for building applications + * + * @rest_spec_name _internal.delete_desired_balance + * @availability stack stability=experimental visibility=private + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_internal/desired_balance' + methods: ['DELETE'] + } + ] + query_parameters: { + /** + * Period to wait for a connection to the master node. + * @server_default 30s + */ + master_timeout?: Duration + } +} \ No newline at end of file diff --git a/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts new file mode 100644 index 0000000000..b94a0a69e4 --- /dev/null +++ b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts @@ -0,0 +1,24 @@ +/* + * 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. + */ + +import { Void } from '@spec_utils/VoidValue' + +export class Response { + body: Void +} \ No newline at end of file diff --git a/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts new file mode 100644 index 0000000000..9e8ad20b95 --- /dev/null +++ b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +import { RequestBase } from '@_types/Base' +import { Duration } from '@_types/Time' + + +/** + * Designed for indirect use by ECE/ESS and ECK, direct use is not supported. + * + * @rest_spec_name _internal.delete_desired_nodes + * @availability stack stability=experimental visibility=private + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_internal/desired_nodes' + methods: ['DELETE'] + } + ] + query_parameters: { + /** + * Period to wait for a connection to the master node. + * @server_default 30s + */ + master_timeout?: Duration + /** + * Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * @server_default 30s + */ + timeout?: Duration + + } +} \ No newline at end of file diff --git a/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts new file mode 100644 index 0000000000..b94a0a69e4 --- /dev/null +++ b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts @@ -0,0 +1,24 @@ +/* + * 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. + */ + +import { Void } from '@spec_utils/VoidValue' + +export class Response { + body: Void +} \ No newline at end of file diff --git a/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts b/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts new file mode 100644 index 0000000000..5e1669a9ec --- /dev/null +++ b/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +import { RequestBase } from '@_types/Base' +import { Duration } from '@_types/Time' + + +/** + * This API is a diagnostics API and the output should not be relied upon for building applications + * + * @rest_spec_name _internal.get_desired_balance + * @availability stack stability=experimental visibility=private + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_internal/desired_balance' + methods: ['GET'] + } + ] + query_parameters: { + /** + * Period to wait for a connection to the master node. + * @server_default 30s + */ + master_timeout?: Duration + } +} \ No newline at end of file diff --git a/specification/_internal/get_desired_balance/InternalGetDesiredBalanceResponse.ts b/specification/_internal/get_desired_balance/InternalGetDesiredBalanceResponse.ts new file mode 100644 index 0000000000..831d24c574 --- /dev/null +++ b/specification/_internal/get_desired_balance/InternalGetDesiredBalanceResponse.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' + +export class Response { + /** @codegen_name body */ + body: UserDefinedValue +} diff --git a/specification/_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts b/specification/_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts new file mode 100644 index 0000000000..c0cd30c571 --- /dev/null +++ b/specification/_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +import { RequestBase } from '@_types/Base' +import { Duration } from '@_types/Time' + + +/** + * Gets the latest desired nodes + * + * @rest_spec_name _internal.get_desired_nodes + * @availability stack stability=experimental visibility=private + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_internal/desired_nodes/_latest' + methods: ['GET'] + } + ] + query_parameters: { + /** + * Period to wait for a connection to the master node. + * @server_default 30s + */ + master_timeout?: Duration + } +} \ No newline at end of file diff --git a/specification/_internal/get_desired_nodes/InternalGetDesiredNodesResponse.ts b/specification/_internal/get_desired_nodes/InternalGetDesiredNodesResponse.ts new file mode 100644 index 0000000000..831d24c574 --- /dev/null +++ b/specification/_internal/get_desired_nodes/InternalGetDesiredNodesResponse.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' + +export class Response { + /** @codegen_name body */ + body: UserDefinedValue +} diff --git a/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts b/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts new file mode 100644 index 0000000000..bbb7d972b6 --- /dev/null +++ b/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts @@ -0,0 +1,64 @@ +/* + * 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. + */ + +import { RequestBase } from '@_types/Base' +import { Duration } from '@_types/Time' + + +/** + * Prevalidates node removal from the cluster + * + * @rest_spec_name _internal.prevalidate_node_removal + * @availability stack stability=experimental visibility=private + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_internal/prevalidate_node_removal' + methods: ['POST'] + } + ] + query_parameters: { + /** + * A comma-separated list of node names to prevalidate + * @server_default [] + */ + names?: string[] + /** + * A comma-separated list of node IDs to prevalidate + * @server_default [] + */ + ids?: string[] + /** + * A comma-separated list of node external IDs to prevalidate + * @server_default [] + */ + external_ids?: string[] + /** + * Period to wait for a connection to the master node. + * @server_default 30s + */ + master_timeout?: Duration + /** + * Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * @server_default 30s + */ + timeout?: Duration + } +} \ No newline at end of file diff --git a/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalResponse.ts b/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalResponse.ts new file mode 100644 index 0000000000..831d24c574 --- /dev/null +++ b/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalResponse.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' + +export class Response { + /** @codegen_name body */ + body: UserDefinedValue +} diff --git a/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts b/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts new file mode 100644 index 0000000000..539e648241 --- /dev/null +++ b/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts @@ -0,0 +1,67 @@ +/* + * 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. + */ + +import { RequestBase } from '@_types/Base' +import { long } from '@_types/Numeric' +import { Duration } from '@_types/Time' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' + + +/** + * Designed for indirect use by ECE/ESS and ECK, direct use is not supported. + * + * @rest_spec_name _internal.update_desired_nodes + * @availability stack stability=experimental visibility=private + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_internal/desired_nodes/{history_id}/{version}' + methods: ['PUT'] + } + ] + path_parts: { + /** + * The history ID + */ + history_id: string + /** + * The version number + */ + version?: long + } + query_parameters: { + /** + * Simulate the update + */ + dry_run?: boolean + /** + * Period to wait for a connection to the master node. + * @server_default 30s + */ + master_timeout?: Duration + /** + * Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * @server_default 30s + */ + timeout?: Duration + } + /** @codegen_name body */ + body: UserDefinedValue +} \ No newline at end of file diff --git a/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesResponse.ts b/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesResponse.ts new file mode 100644 index 0000000000..1ffb53282b --- /dev/null +++ b/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesResponse.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +export class Response { + body: { + replaced_existing_history_id: boolean + dry_run: boolean + } +} From 94841235eac9485ca0fef340bd7acdcdbe12a5f1 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 21 Nov 2025 17:15:29 +0400 Subject: [PATCH 3/5] Fix lint --- .../InternalDeleteDesiredBalanceRequest.ts | 5 ++--- .../InternalDeleteDesiredBalanceResponse.ts | 2 +- .../InternalDeleteDesiredNodesRequest.ts | 4 +--- .../InternalDeleteDesiredNodesResponse.ts | 2 +- .../get_desired_balance/InternalGetDesiredBalanceRequest.ts | 5 ++--- .../get_desired_nodes/InternalGetDesiredNodesRequest.ts | 5 ++--- .../InternalPrevalidateNodeRemovalRequest.ts | 5 ++--- .../InternalUpdateDesiredNodesRequest.ts | 5 ++--- 8 files changed, 13 insertions(+), 20 deletions(-) diff --git a/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts index 25bba1b4e0..5ae988ac69 100644 --- a/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts +++ b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts @@ -20,9 +20,8 @@ import { RequestBase } from '@_types/Base' import { Duration } from '@_types/Time' - /** - * This API is a diagnostics API and the output should not be relied upon for building applications + * This API is a diagnostics API and the output should not be relied upon for building applications. * * @rest_spec_name _internal.delete_desired_balance * @availability stack stability=experimental visibility=private @@ -41,4 +40,4 @@ export interface Request extends RequestBase { */ master_timeout?: Duration } -} \ No newline at end of file +} diff --git a/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts index b94a0a69e4..cf4f9c0d87 100644 --- a/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts +++ b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts @@ -21,4 +21,4 @@ import { Void } from '@spec_utils/VoidValue' export class Response { body: Void -} \ No newline at end of file +} diff --git a/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts index 9e8ad20b95..046c42fbcd 100644 --- a/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts +++ b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts @@ -20,7 +20,6 @@ import { RequestBase } from '@_types/Base' import { Duration } from '@_types/Time' - /** * Designed for indirect use by ECE/ESS and ECK, direct use is not supported. * @@ -45,6 +44,5 @@ export interface Request extends RequestBase { * @server_default 30s */ timeout?: Duration - } -} \ No newline at end of file +} diff --git a/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts index b94a0a69e4..cf4f9c0d87 100644 --- a/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts +++ b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts @@ -21,4 +21,4 @@ import { Void } from '@spec_utils/VoidValue' export class Response { body: Void -} \ No newline at end of file +} diff --git a/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts b/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts index 5e1669a9ec..5b1ace6e51 100644 --- a/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts +++ b/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts @@ -20,9 +20,8 @@ import { RequestBase } from '@_types/Base' import { Duration } from '@_types/Time' - /** - * This API is a diagnostics API and the output should not be relied upon for building applications + * This API is a diagnostics API and the output should not be relied upon for building applications. * * @rest_spec_name _internal.get_desired_balance * @availability stack stability=experimental visibility=private @@ -41,4 +40,4 @@ export interface Request extends RequestBase { */ master_timeout?: Duration } -} \ No newline at end of file +} diff --git a/specification/_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts b/specification/_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts index c0cd30c571..fca80bae87 100644 --- a/specification/_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts +++ b/specification/_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts @@ -20,9 +20,8 @@ import { RequestBase } from '@_types/Base' import { Duration } from '@_types/Time' - /** - * Gets the latest desired nodes + * Gets the latest desired nodes. * * @rest_spec_name _internal.get_desired_nodes * @availability stack stability=experimental visibility=private @@ -41,4 +40,4 @@ export interface Request extends RequestBase { */ master_timeout?: Duration } -} \ No newline at end of file +} diff --git a/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts b/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts index bbb7d972b6..51d8f05a8d 100644 --- a/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts +++ b/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts @@ -20,9 +20,8 @@ import { RequestBase } from '@_types/Base' import { Duration } from '@_types/Time' - /** - * Prevalidates node removal from the cluster + * Prevalidates node removal from the cluster. * * @rest_spec_name _internal.prevalidate_node_removal * @availability stack stability=experimental visibility=private @@ -61,4 +60,4 @@ export interface Request extends RequestBase { */ timeout?: Duration } -} \ No newline at end of file +} diff --git a/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts b/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts index 539e648241..4d4229b8cf 100644 --- a/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts +++ b/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts @@ -22,7 +22,6 @@ import { long } from '@_types/Numeric' import { Duration } from '@_types/Time' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' - /** * Designed for indirect use by ECE/ESS and ECK, direct use is not supported. * @@ -44,7 +43,7 @@ export interface Request extends RequestBase { /** * The version number */ - version?: long + version: long } query_parameters: { /** @@ -64,4 +63,4 @@ export interface Request extends RequestBase { } /** @codegen_name body */ body: UserDefinedValue -} \ No newline at end of file +} From 3c44395b3180bf6016edb4ffb98b7354e39d12d1 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 21 Nov 2025 18:34:45 +0400 Subject: [PATCH 4/5] Update tsconfig.json --- specification/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/tsconfig.json b/specification/tsconfig.json index 0b28dc8982..b89482b901 100644 --- a/specification/tsconfig.json +++ b/specification/tsconfig.json @@ -17,6 +17,7 @@ "baseUrl": "./", "paths": { "@_types/*": ["_types/*"], + "@_internal/*": ["_internal/*"], "@global/*": ["_global/*"], "@spec_utils/*": ["_spec_utils/*"], "@async_search/*": ["async_search/*"], From 276877547f18c1cef42bda701cdb9cd74c5ffc87 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 21 Nov 2025 18:35:10 +0400 Subject: [PATCH 5/5] Run make contrib --- output/schema/schema.json | 520 ++++++++++++++++++++++++++- output/schema/validation-errors.json | 10 +- output/typescript/types.ts | 49 +++ specification/package-lock.json | 1 + 4 files changed, 563 insertions(+), 17 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index dfa4a51c55..640b7bce8c 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -14,12 +14,18 @@ "visibility": "private" } }, - "description": "This API is a diagnostics API and the output should not be relied upon for building applications", + "description": "This API is a diagnostics API and the output should not be relied upon for building applications.", "docUrl": null, "name": "_internal.delete_desired_balance", - "request": null, + "request": { + "name": "Request", + "namespace": "_internal.delete_desired_balance" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "_internal.delete_desired_balance" + }, "responseMediaType": [ "application/json" ], @@ -42,9 +48,15 @@ "description": "Designed for indirect use by ECE/ESS and ECK, direct use is not supported.", "docUrl": null, "name": "_internal.delete_desired_nodes", - "request": null, + "request": { + "name": "Request", + "namespace": "_internal.delete_desired_nodes" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "_internal.delete_desired_nodes" + }, "responseMediaType": [ "application/json" ], @@ -64,12 +76,18 @@ "visibility": "private" } }, - "description": "This API is a diagnostics API and the output should not be relied upon for building applications", + "description": "This API is a diagnostics API and the output should not be relied upon for building applications.", "docUrl": null, "name": "_internal.get_desired_balance", - "request": null, + "request": { + "name": "Request", + "namespace": "_internal.get_desired_balance" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "_internal.get_desired_balance" + }, "responseMediaType": [ "application/json" ], @@ -89,12 +107,18 @@ "visibility": "private" } }, - "description": "Gets the latest desired nodes", + "description": "Gets the latest desired nodes.", "docUrl": null, "name": "_internal.get_desired_nodes", - "request": null, + "request": { + "name": "Request", + "namespace": "_internal.get_desired_nodes" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "_internal.get_desired_nodes" + }, "responseMediaType": [ "application/json" ], @@ -114,12 +138,18 @@ "visibility": "private" } }, - "description": "Prevalidates node removal from the cluster", + "description": "Prevalidates node removal from the cluster.", "docUrl": null, "name": "_internal.prevalidate_node_removal", - "request": null, + "request": { + "name": "Request", + "namespace": "_internal.prevalidate_node_removal" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "_internal.prevalidate_node_removal" + }, "responseMediaType": [ "application/json" ], @@ -142,12 +172,18 @@ "description": "Designed for indirect use by ECE/ESS and ECK, direct use is not supported.", "docUrl": null, "name": "_internal.update_desired_nodes", - "request": null, + "request": { + "name": "Request", + "namespace": "_internal.update_desired_nodes" + }, "requestBodyRequired": true, "requestMediaType": [ "application/json" ], - "response": null, + "response": { + "name": "Response", + "namespace": "_internal.update_desired_nodes" + }, "responseMediaType": [ "application/json" ], @@ -50793,6 +50829,458 @@ ], "specLocation": "_global/update_by_query_rethrottle/UpdateByQueryRethrottleNode.ts#L25-L27" }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "This API is a diagnostics API and the output should not be relied upon for building applications.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "_internal.delete_desired_balance" + }, + "path": [], + "query": [ + { + "description": "Period to wait for a connection to the master node.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts#L23-L43" + }, + { + "kind": "response", + "body": { + "kind": "no_body" + }, + "name": { + "name": "Response", + "namespace": "_internal.delete_desired_balance" + }, + "specLocation": "_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts#L22-L24" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Designed for indirect use by ECE/ESS and ECK, direct use is not supported.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "_internal.delete_desired_nodes" + }, + "path": [], + "query": [ + { + "description": "Period to wait for a connection to the master node.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts#L23-L48" + }, + { + "kind": "response", + "body": { + "kind": "no_body" + }, + "name": { + "name": "Response", + "namespace": "_internal.delete_desired_nodes" + }, + "specLocation": "_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts#L22-L24" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "This API is a diagnostics API and the output should not be relied upon for building applications.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "_internal.get_desired_balance" + }, + "path": [], + "query": [ + { + "description": "Period to wait for a connection to the master node.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts#L23-L43" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "body", + "value": { + "kind": "user_defined_value" + } + }, + "name": { + "name": "Response", + "namespace": "_internal.get_desired_balance" + }, + "specLocation": "_internal/get_desired_balance/InternalGetDesiredBalanceResponse.ts#L22-L25" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Gets the latest desired nodes.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "_internal.get_desired_nodes" + }, + "path": [], + "query": [ + { + "description": "Period to wait for a connection to the master node.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts#L23-L43" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "body", + "value": { + "kind": "user_defined_value" + } + }, + "name": { + "name": "Response", + "namespace": "_internal.get_desired_nodes" + }, + "specLocation": "_internal/get_desired_nodes/InternalGetDesiredNodesResponse.ts#L22-L25" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Prevalidates node removal from the cluster.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "_internal.prevalidate_node_removal" + }, + "path": [], + "query": [ + { + "description": "A comma-separated list of node names to prevalidate", + "name": "names", + "required": false, + "serverDefault": [], + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "A comma-separated list of node IDs to prevalidate", + "name": "ids", + "required": false, + "serverDefault": [], + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "A comma-separated list of node external IDs to prevalidate", + "name": "external_ids", + "required": false, + "serverDefault": [], + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "Period to wait for a connection to the master node.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts#L23-L63" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "body", + "value": { + "kind": "user_defined_value" + } + }, + "name": { + "name": "Response", + "namespace": "_internal.prevalidate_node_removal" + }, + "specLocation": "_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalResponse.ts#L22-L25" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "value", + "codegenName": "body", + "value": { + "kind": "user_defined_value" + } + }, + "description": "Designed for indirect use by ECE/ESS and ECK, direct use is not supported.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "_internal.update_desired_nodes" + }, + "path": [ + { + "description": "The history ID", + "name": "history_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The version number", + "name": "version", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + } + ], + "query": [ + { + "description": "Simulate the update", + "name": "dry_run", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "Period to wait for a connection to the master node.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts#L25-L66" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "replaced_existing_history_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "dry_run", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ] + }, + "name": { + "name": "Response", + "namespace": "_internal.update_desired_nodes" + }, + "specLocation": "_internal/update_desired_nodes/InternalUpdateDesiredNodesResponse.ts#L20-L25" + }, { "kind": "interface", "name": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 8468a8d9cf..bc536fe83f 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1,5 +1,13 @@ { - "endpointErrors": {}, + "endpointErrors": { + "_internal.update_desired_nodes": { + "request": [ + "Request: query parameter 'master_timeout' does not exist in the json spec", + "Request: query parameter 'timeout' does not exist in the json spec" + ], + "response": [] + } + }, "generalErrors": [ "Dangling type '_global.scripts_painless_execute:PainlessExecutionPosition'", "Dangling type '_global.scripts_painless_execute:PainlessScript'", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 2e500d8bf6..2c073f7312 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2172,6 +2172,55 @@ export interface UpdateByQueryRethrottleUpdateByQueryRethrottleNode extends Spec tasks: Record } +export interface InternalDeleteDesiredBalanceRequest extends RequestBase { + master_timeout?: Duration +} + +export type InternalDeleteDesiredBalanceResponse = boolean + +export interface InternalDeleteDesiredNodesRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration +} + +export type InternalDeleteDesiredNodesResponse = boolean + +export interface InternalGetDesiredBalanceRequest extends RequestBase { + master_timeout?: Duration +} + +export type InternalGetDesiredBalanceResponse = any + +export interface InternalGetDesiredNodesRequest extends RequestBase { + master_timeout?: Duration +} + +export type InternalGetDesiredNodesResponse = any + +export interface InternalPrevalidateNodeRemovalRequest extends RequestBase { + names?: string[] + ids?: string[] + external_ids?: string[] + master_timeout?: Duration + timeout?: Duration +} + +export type InternalPrevalidateNodeRemovalResponse = any + +export interface InternalUpdateDesiredNodesRequest extends RequestBase { + history_id: string + version: long + dry_run?: boolean + master_timeout?: Duration + timeout?: Duration + body?: any +} + +export interface InternalUpdateDesiredNodesResponse { + replaced_existing_history_id: boolean + dry_run: boolean +} + export interface SpecUtilsBaseNode { attributes: Record host: Host diff --git a/specification/package-lock.json b/specification/package-lock.json index dd53efddba..edb05d78ec 100644 --- a/specification/package-lock.json +++ b/specification/package-lock.json @@ -19,6 +19,7 @@ "license": "Apache-2.0", "dependencies": { "@typescript-eslint/utils": "^8.32.1", + "markdownlint": "^0.39.0", "typescript": "^5.8.3" }, "devDependencies": {