diff --git a/docs/reference/api-reference.md b/docs/reference/api-reference.md index bd2887163..7d7ef29bb 100644 --- a/docs/reference/api-reference.md +++ b/docs/reference/api-reference.md @@ -10758,6 +10758,7 @@ client.ml.stopTrainedModelDeployment({ model_id }) #### Request (object) [_request_ml.stop_trained_model_deployment] - **`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. @@ -15304,9 +15305,11 @@ index will not be deleted - **`timeout` (Optional, string \| -1 \| 0)**: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. ## client.transform.getNodeStats [_transform.get_node_stats] -Retrieves transform usage information for transform nodes +Get node stats. -[Endpoint documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-node-stats.html) +Get per-node information about transform usage. + +[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-node-stats) ```ts client.transform.getNodeStats() diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index a47ec8993..59c8f9d0d 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -766,10 +766,11 @@ export default class Ml { ] }, 'ml.start_data_frame_analytics': { - path: [ - 'id' + path: [], + body: [ + 'id', + 'timeout' ], - body: [], query: [ 'timeout' ] @@ -808,10 +809,13 @@ export default class Ml { ] }, 'ml.stop_data_frame_analytics': { - path: [ - 'id' + path: [], + body: [ + 'id', + 'allow_no_match', + 'force', + 'timeout' ], - body: [], query: [ 'allow_no_match', 'force', @@ -837,7 +841,11 @@ export default class Ml { path: [ 'model_id' ], - body: [], + body: [ + 'id', + 'allow_no_match', + 'force' + ], query: [ 'allow_no_match', 'force' @@ -4519,7 +4527,9 @@ export default class Ml { async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { - path: acceptedPath + path: acceptedPath, + body: acceptedBody, + query: acceptedQuery } = this[kAcceptedParams]['ml.start_data_frame_analytics'] const userQuery = params?.querystring @@ -4536,11 +4546,21 @@ export default class Ml { } 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' && key !== 'querystring') { - // @ts-expect-error - querystring[key] = params[key] + if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) { + // @ts-expect-error + querystring[key] = params[key] + } else { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } } } @@ -4553,6 +4573,8 @@ export default class Ml { }, acceptedParams: [ 'id', + 'id', + 'timeout', 'timeout' ] } @@ -4703,7 +4725,9 @@ export default class Ml { async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { - path: acceptedPath + path: acceptedPath, + body: acceptedBody, + query: acceptedQuery } = this[kAcceptedParams]['ml.stop_data_frame_analytics'] const userQuery = params?.querystring @@ -4720,11 +4744,21 @@ export default class Ml { } 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' && key !== 'querystring') { - // @ts-expect-error - querystring[key] = params[key] + if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) { + // @ts-expect-error + querystring[key] = params[key] + } else { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } } } @@ -4736,9 +4770,13 @@ export default class Ml { id: params.id }, acceptedParams: [ + 'id', 'id', 'allow_no_match', 'force', + 'timeout', + 'allow_no_match', + 'force', 'timeout' ] } @@ -4820,7 +4858,9 @@ export default class Ml { async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { const { - path: acceptedPath + path: acceptedPath, + body: acceptedBody, + query: acceptedQuery } = this[kAcceptedParams]['ml.stop_trained_model_deployment'] const userQuery = params?.querystring @@ -4837,11 +4877,21 @@ export default class Ml { } 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' && key !== 'querystring') { - // @ts-expect-error - querystring[key] = params[key] + if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) { + // @ts-expect-error + querystring[key] = params[key] + } else { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } } } @@ -4854,6 +4904,9 @@ export default class Ml { }, acceptedParams: [ 'model_id', + 'id', + 'allow_no_match', + 'force', 'allow_no_match', 'force' ] diff --git a/src/api/api/transform.ts b/src/api/api/transform.ts index 1bddfe7b8..7b392a54d 100644 --- a/src/api/api/transform.ts +++ b/src/api/api/transform.ts @@ -248,13 +248,13 @@ export default class Transform { } /** - * Retrieves transform usage information for transform nodes - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/9.2/get-transform-node-stats.html | Elasticsearch API documentation} + * Get node stats. Get per-node information about transform usage. + * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-node-stats | Elasticsearch API documentation} */ - async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise - async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { + async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest, options?: TransportRequestOptions): Promise + async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath } = this[kAcceptedParams]['transform.get_node_stats'] @@ -277,6 +277,7 @@ export default class Transform { if (acceptedPath.includes(key)) { continue } else if (key !== 'body' && key !== 'querystring') { + // @ts-expect-error querystring[key] = params[key] } } diff --git a/src/api/types.ts b/src/api/types.ts index 555e505ca..89fc975d6 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -19666,18 +19666,13 @@ export interface IndicesDataStreamLifecycle { * Any time after this duration the document could be deleted. * When empty, every document in this data stream will be stored indefinitely. */ data_retention?: Duration - /** The downsampling configuration to execute for the managed backing index after rollover. */ - downsampling?: IndicesDataStreamLifecycleDownsampling + /** The list of downsampling rounds to execute as part of this downsampling configuration */ + downsampling?: IndicesDownsamplingRound[] /** If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle * that's disabled (enabled: `false`) will have no effect on the data stream. */ enabled?: boolean } -export interface IndicesDataStreamLifecycleDownsampling { - /** The list of downsampling rounds to execute as part of this downsampling configuration */ - rounds: IndicesDownsamplingRound[] -} - export interface IndicesDataStreamLifecycleRolloverConditions { min_age?: Duration max_age?: string @@ -31127,6 +31122,8 @@ export interface MlStopDatafeedResponse { export interface MlStopTrainedModelDeploymentRequest extends RequestBase { /** The unique identifier of the trained model. */ model_id: Id + /** If provided, must be the same identifier as in the path. */ + id?: Id /** 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. @@ -31136,9 +31133,9 @@ export interface MlStopTrainedModelDeploymentRequest extends RequestBase { * restart the model deployment. */ force?: boolean /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { model_id?: never, allow_no_match?: never, force?: never } + body?: string | { [key: string]: any } & { model_id?: never, id?: never, allow_no_match?: never, force?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { model_id?: never, allow_no_match?: never, force?: never } + querystring?: { [key: string]: any } & { model_id?: never, id?: never, allow_no_match?: never, force?: never } } export interface MlStopTrainedModelDeploymentResponse { @@ -38615,6 +38612,30 @@ export interface TransformDeleteTransformRequest extends RequestBase { export type TransformDeleteTransformResponse = AcknowledgedResponseBase +export interface TransformGetNodeStatsRequest extends RequestBase { + /** All values in `body` will be added to the request body. */ + body?: string | { [key: string]: any } + /** All values in `querystring` will be added to the request querystring. */ + querystring?: { [key: string]: any } +} + +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 { /** Identifier for the transform. It can be a transform identifier or a * wildcard expression. You can get information for all transforms by using