From fff4bd39d24e162daa0d792ae90ecf9a779c944d Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 8 Dec 2025 06:03:43 +0000 Subject: [PATCH] Auto-generated API code --- docs/reference.asciidoc | 5 +++- src/api/api/ml.ts | 52 +++++++++++++++++++++++++++++++------ src/api/api/transform.ts | 12 ++++----- src/api/types.ts | 27 +++++++++++++++---- src/api/typesWithBodyKey.ts | 50 +++++++++++++++++++++++++++-------- 5 files changed, 115 insertions(+), 31 deletions(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 5ceeca323..a5dfaa910 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -11330,6 +11330,7 @@ client.ml.stopTrainedModelDeployment({ model_id }) * *Request (object):* ** *`model_id` (string)*: The unique identifier of the trained model. +** *`id` (Optional, string)*: If provided, must be the same identifier as in the path. ** *`allow_no_match` (Optional, boolean)*: Specifies what to do when the request: contains wildcard expressions and there are no deployments that match; contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches. @@ -16140,7 +16141,9 @@ index will not be deleted [discrete] ==== get_node_stats -Retrieves transform usage information for transform nodes +Get node stats. + +Get per-node information about transform usage. [source,ts] ---- client.transform.getNodeStats() diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index 2974edb05..c686a190c 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -2401,12 +2401,24 @@ export default class Ml { async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['id'] + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['id', 'timeout'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { // @ts-expect-error @@ -2521,12 +2533,24 @@ export default class Ml { async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['id'] + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['id', 'allow_no_match', 'force', 'timeout'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { // @ts-expect-error @@ -2598,11 +2622,23 @@ export default class Ml { async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] + const acceptedBody: string[] = ['id', 'allow_no_match', 'force'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { // @ts-expect-error diff --git a/src/api/api/transform.ts b/src/api/api/transform.ts index 658b583bf..7795eef64 100644 --- a/src/api/api/transform.ts +++ b/src/api/api/transform.ts @@ -77,13 +77,12 @@ export default class Transform { } /** - * Retrieves transform usage information for transform nodes - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-transform-node-stats.html | Elasticsearch API documentation} + * Get node stats. Get per-node information about transform usage. */ - async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptions): Promise + async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -93,6 +92,7 @@ export default class Transform { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } diff --git a/src/api/types.ts b/src/api/types.ts index 86956a803..e8b9b58f0 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -11679,14 +11679,10 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration - downsampling?: IndicesDataStreamLifecycleDownsampling + downsampling?: IndicesDownsamplingRound[] enabled?: boolean } -export interface IndicesDataStreamLifecycleDownsampling { - rounds: IndicesDownsamplingRound[] -} - export interface IndicesDataStreamLifecycleRolloverConditions { min_age?: Duration max_age?: string @@ -17790,6 +17786,7 @@ export interface MlStopDatafeedResponse { export interface MlStopTrainedModelDeploymentRequest extends RequestBase { model_id: Id + id?: Id allow_no_match?: boolean force?: boolean } @@ -21900,6 +21897,26 @@ export interface TransformDeleteTransformRequest extends RequestBase { export type TransformDeleteTransformResponse = AcknowledgedResponseBase +export interface TransformGetNodeStatsRequest extends RequestBase { +} + +export type TransformGetNodeStatsResponse = TransformGetNodeStatsTransformNodeFullStats + +export interface TransformGetNodeStatsTransformNodeFullStatsKeys { + total: TransformGetNodeStatsTransformNodeStats +} +export type TransformGetNodeStatsTransformNodeFullStats = TransformGetNodeStatsTransformNodeFullStatsKeys +& { [property: string]: TransformGetNodeStatsTransformNodeStats } + +export interface TransformGetNodeStatsTransformNodeStats { + scheduler: TransformGetNodeStatsTransformSchedulerStats +} + +export interface TransformGetNodeStatsTransformSchedulerStats { + registered_transform_count: integer + peek_transform?: string +} + export interface TransformGetTransformRequest extends RequestBase { transform_id?: Names allow_no_match?: boolean diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 78147a571..f12d9400e 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -11882,14 +11882,10 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration - downsampling?: IndicesDataStreamLifecycleDownsampling + downsampling?: IndicesDownsamplingRound[] enabled?: boolean } -export interface IndicesDataStreamLifecycleDownsampling { - rounds: IndicesDownsamplingRound[] -} - export interface IndicesDataStreamLifecycleRolloverConditions { min_age?: Duration max_age?: string @@ -18161,7 +18157,11 @@ export type MlSetUpgradeModeResponse = AcknowledgedResponseBase export interface MlStartDataFrameAnalyticsRequest extends RequestBase { id: Id - timeout?: Duration + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + id?: Id + timeout?: Duration + } } export interface MlStartDataFrameAnalyticsResponse { @@ -18206,9 +18206,13 @@ export interface MlStartTrainedModelDeploymentResponse { export interface MlStopDataFrameAnalyticsRequest extends RequestBase { id: Id - allow_no_match?: boolean - force?: boolean - timeout?: Duration + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + id?: Id + allow_no_match?: boolean + force?: boolean + timeout?: Duration + } } export interface MlStopDataFrameAnalyticsResponse { @@ -18231,8 +18235,12 @@ export interface MlStopDatafeedResponse { export interface MlStopTrainedModelDeploymentRequest extends RequestBase { model_id: Id - allow_no_match?: boolean - force?: boolean + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + id?: Id + allow_no_match?: boolean + force?: boolean + } } export interface MlStopTrainedModelDeploymentResponse { @@ -22538,6 +22546,26 @@ export interface TransformDeleteTransformRequest extends RequestBase { export type TransformDeleteTransformResponse = AcknowledgedResponseBase +export interface TransformGetNodeStatsRequest extends RequestBase { +} + +export type TransformGetNodeStatsResponse = TransformGetNodeStatsTransformNodeFullStats + +export interface TransformGetNodeStatsTransformNodeFullStatsKeys { + total: TransformGetNodeStatsTransformNodeStats +} +export type TransformGetNodeStatsTransformNodeFullStats = TransformGetNodeStatsTransformNodeFullStatsKeys +& { [property: string]: TransformGetNodeStatsTransformNodeStats } + +export interface TransformGetNodeStatsTransformNodeStats { + scheduler: TransformGetNodeStatsTransformSchedulerStats +} + +export interface TransformGetNodeStatsTransformSchedulerStats { + registered_transform_count: integer + peek_transform?: string +} + export interface TransformGetTransformRequest extends RequestBase { transform_id?: Names allow_no_match?: boolean