From d042b613f174165bec756ab927d86f6011c41128 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 1 Dec 2025 15:10:50 +0400 Subject: [PATCH] Add optional request bodies to three ML APIs (#5752) * Add optional body to three ML APIs * Fix lint (cherry picked from commit 650c9f1db0f4eac6f28f4ad69d7d8202a3986893) --- .../MlStartDataFrameAnalyticsRequest.ts | 12 +++++++ .../MlStopDataFrameAnalyticsRequest.ts | 32 +++++++++++++++++++ .../MlStopTrainedModelDeploymentRequest.ts | 20 ++++++++++++ 3 files changed, 64 insertions(+) diff --git a/specification/ml/start_data_frame_analytics/MlStartDataFrameAnalyticsRequest.ts b/specification/ml/start_data_frame_analytics/MlStartDataFrameAnalyticsRequest.ts index 17f4a901a0..b3795eccfe 100644 --- a/specification/ml/start_data_frame_analytics/MlStartDataFrameAnalyticsRequest.ts +++ b/specification/ml/start_data_frame_analytics/MlStartDataFrameAnalyticsRequest.ts @@ -66,4 +66,16 @@ export interface Request extends RequestBase { */ timeout?: Duration } + body?: { + /** + * If provided, must be the same identifier as in the path. + */ + id?: Id + /** + * Controls the amount of time to wait until the data frame analytics job + * starts. + * @server_default 20s + */ + timeout?: Duration + } } diff --git a/specification/ml/stop_data_frame_analytics/MlStopDataFrameAnalyticsRequest.ts b/specification/ml/stop_data_frame_analytics/MlStopDataFrameAnalyticsRequest.ts index 8155c2ae88..75e8b94fd0 100644 --- a/specification/ml/stop_data_frame_analytics/MlStopDataFrameAnalyticsRequest.ts +++ b/specification/ml/stop_data_frame_analytics/MlStopDataFrameAnalyticsRequest.ts @@ -76,4 +76,36 @@ export interface Request extends RequestBase { */ timeout?: Duration } + body?: { + /** + * If provided, must be the same identifier as in the path. + */ + id?: Id + /** + * Specifies what to do when the request: + * + * 1. Contains wildcard expressions and there are no data frame analytics + * jobs that match. + * 2. Contains the _all string or no identifiers and there are no matches. + * 3. Contains wildcard expressions and there are only partial matches. + * + * The default value is true, which returns an empty data_frame_analytics + * array when there are no matches and the subset of results when there are + * partial matches. If this parameter is false, the request returns a 404 + * status code when there are no matches or only partial matches. + * @server_default true + */ + allow_no_match?: boolean + /** + * If true, the data frame analytics job is stopped forcefully. + * @server_default false + */ + force?: boolean + /** + * Controls the amount of time to wait until the data frame analytics job + * stops. Defaults to 20 seconds. + * @server_default 20s + */ + timeout?: Duration + } } diff --git a/specification/ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentRequest.ts b/specification/ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentRequest.ts index 7eaf0b5785..614f213bb6 100644 --- a/specification/ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentRequest.ts +++ b/specification/ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentRequest.ts @@ -59,4 +59,24 @@ export interface Request extends RequestBase { */ force?: boolean } + body?: { + /** + * 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. + * If `false`, the request returns a 404 status code when there are no matches or only partial matches. + * @server_default true + */ + allow_no_match?: boolean + /** + * Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you + * restart the model deployment. + * @server_default false + */ + force?: boolean + } }