From 17b2a155aa0d3b6e71b77a72db068be8982febd6 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 21 Nov 2025 18:40:52 +0400 Subject: [PATCH] Add profiling and _internal stubs (#5686) * Add profiling stubs The purpose is to add enough data to generate the rest-api-spec. * Add _internal endpoints They are only here for the purpose of generating rest-api-spec files, so a lot of the content is empty. * Fix lint * Update tsconfig.json * Run make contrib (cherry picked from commit 5f707dbb77b8cda8a97ab02fad08b15f73d06ef1) # Conflicts: # output/schema/validation-errors.json # output/typescript/types.ts # specification/_doc_ids/table.csv # specification/tsconfig.json --- compiler/src/steps/validate-model.ts | 7 - output/schema/schema.json | 743 +++++++++++++++++- output/schema/validation-errors.json | 7 + output/typescript/types.ts | 73 ++ specification/_doc_ids/table.csv | 1 + .../InternalDeleteDesiredBalanceRequest.ts | 43 + .../InternalDeleteDesiredBalanceResponse.ts | 24 + .../InternalDeleteDesiredNodesRequest.ts | 48 ++ .../InternalDeleteDesiredNodesResponse.ts | 24 + .../InternalGetDesiredBalanceRequest.ts | 43 + .../InternalGetDesiredBalanceResponse.ts | 25 + .../InternalGetDesiredNodesRequest.ts | 43 + .../InternalGetDesiredNodesResponse.ts | 25 + .../InternalPrevalidateNodeRemovalRequest.ts | 63 ++ .../InternalPrevalidateNodeRemovalResponse.ts | 25 + .../InternalUpdateDesiredNodesRequest.ts | 66 ++ .../InternalUpdateDesiredNodesResponse.ts | 25 + .../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 | 2 + 25 files changed, 1486 insertions(+), 32 deletions(-) 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 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 ca21d98f86..973642eab1 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) * @@ -281,11 +279,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 7641fcd47f..d9be283f9a 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" ], @@ -15796,15 +15832,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" ], @@ -15824,15 +15867,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" ], @@ -15852,12 +15902,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" ], @@ -49378,6 +49435,455 @@ ], "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", + "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", + "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", + "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": { @@ -223425,6 +223931,193 @@ ], "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", + "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", + "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/schema/validation-errors.json b/output/schema/validation-errors.json index b7249ea9e4..1821e9ab1e 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1,5 +1,12 @@ { "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": [] + }, "monitoring.bulk": { "request": [ "Request: different number of urls in the json spec", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index b2e42c9d5b..aa32456ba1 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 @@ -19207,6 +19256,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 QueryRulesQueryRule { rule_id: Id type: QueryRulesQueryRuleType diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 79b31ddeeb..a922c74612 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -897,6 +897,7 @@ time-value,https://github.com/elastic/elasticsearch/blob/{branch}/libs/core/src/ 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/guide/en/elasticsearch/reference/{branch}/trim-processor.html,, +universal-profiling,https://www.elastic.co/guide/en/observability/current/universal-profiling.html,, unfreeze-index-api,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/unfreeze-index-api.html,, update-dfanalytics,https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-ml-update-data-frame-analytics,, update-desired-nodes,https://www.elastic.co/docs/api/doc/elasticsearch/v8/group/endpoint-cluster,, diff --git a/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts new file mode 100644 index 0000000000..5ae988ac69 --- /dev/null +++ b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceRequest.ts @@ -0,0 +1,43 @@ +/* + * 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 + } +} diff --git a/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts b/specification/_internal/delete_desired_balance/InternalDeleteDesiredBalanceResponse.ts new file mode 100644 index 0000000000..cf4f9c0d87 --- /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 +} diff --git a/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts new file mode 100644 index 0000000000..046c42fbcd --- /dev/null +++ b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesRequest.ts @@ -0,0 +1,48 @@ +/* + * 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 + } +} diff --git a/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts b/specification/_internal/delete_desired_nodes/InternalDeleteDesiredNodesResponse.ts new file mode 100644 index 0000000000..cf4f9c0d87 --- /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 +} diff --git a/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts b/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts new file mode 100644 index 0000000000..5b1ace6e51 --- /dev/null +++ b/specification/_internal/get_desired_balance/InternalGetDesiredBalanceRequest.ts @@ -0,0 +1,43 @@ +/* + * 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 + } +} 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..fca80bae87 --- /dev/null +++ b/specification/_internal/get_desired_nodes/InternalGetDesiredNodesRequest.ts @@ -0,0 +1,43 @@ +/* + * 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 + } +} 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..51d8f05a8d --- /dev/null +++ b/specification/_internal/prevalidate_node_removal/InternalPrevalidateNodeRemovalRequest.ts @@ -0,0 +1,63 @@ +/* + * 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 + } +} 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..4d4229b8cf --- /dev/null +++ b/specification/_internal/update_desired_nodes/InternalUpdateDesiredNodesRequest.ts @@ -0,0 +1,66 @@ +/* + * 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 +} 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 + } +} 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 867d8f0655..c24cbdb120 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/*"], @@ -42,6 +43,7 @@ "@ml/*": ["ml/*"], "@monitoring/*": ["monitoring/*"], "@nodes/*": ["nodes/*"], + "@profiling/*": ["profiling/*"], "@query_ruleset/*": ["query_ruleset/*"], "@rollup/*": ["rollup/*"], "@searchable_snapshots/*": ["searchable_snapshots/*"],