diff --git a/output/schema/schema.json b/output/schema/schema.json index bb4ebe884a..e12ba4f8a9 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -12925,24 +12925,40 @@ }, { "availability": { - "stack": { + "serverless": { "stability": "beta", "visibility": "public" + }, + "stack": { + "since": "8.6.0", + "stability": "stable" } }, "description": "Updates certain properties of trained model deployment.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html", "name": "ml.update_trained_model_deployment", - "request": null, + "privileges": { + "cluster": [ + "manage_ml" + ] + }, + "request": { + "name": "Request", + "namespace": "ml.update_trained_model_deployment" + }, "requestBodyRequired": true, "requestMediaType": [ "application/json" ], - "response": null, + "response": { + "name": "Response", + "namespace": "ml.update_trained_model_deployment" + }, "responseMediaType": [ "application/json" ], - "stability": "beta", + "since": "8.6.0", + "stability": "stable", "urls": [ { "methods": [ @@ -165204,6 +165220,81 @@ }, "specLocation": "ml/update_model_snapshot/MlUpdateModelSnapshotResponse.ts#L22-L27" }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "description": "The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.", + "name": "number_of_allocations", + "required": false, + "serverDefault": 1, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + } + ] + }, + "description": "Starts a trained model deployment, which allocates the model to every machine learning node.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "ml.update_trained_model_deployment" + }, + "path": [ + { + "description": "The unique identifier of the trained model. Currently, only PyTorch models are supported.", + "name": "model_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentRequest.ts#L24-L50" + }, + { + "body": { + "kind": "properties", + "properties": [ + { + "name": "assignment", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "TrainedModelAssignment", + "namespace": "ml._types" + } + } + } + ] + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "ml.update_trained_model_deployment" + }, + "specLocation": "ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentResponse.ts#L22-L26" + }, { "attachedBehaviors": [ "CommonQueryParameters" diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 0dba2e0ac7..213a6c1e9f 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1078,12 +1078,6 @@ ], "response": [] }, - "ml.update_trained_model_deployment": { - "request": [ - "Missing request & response" - ], - "response": [] - }, "ml.validate": { "request": [], "response": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ce34c4914b..2060188b0f 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -15325,6 +15325,17 @@ export interface MlUpdateModelSnapshotResponse { model: MlModelSnapshot } +export interface MlUpdateTrainedModelDeploymentRequest extends RequestBase { + model_id: Id + body?: { + number_of_allocations?: integer + } +} + +export interface MlUpdateTrainedModelDeploymentResponse { + assignment: MlTrainedModelAssignment +} + export interface MlUpgradeJobSnapshotRequest extends RequestBase { job_id: Id snapshot_id: Id diff --git a/specification/ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentRequest.ts b/specification/ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentRequest.ts new file mode 100644 index 0000000000..4f5de2d821 --- /dev/null +++ b/specification/ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentRequest.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 { Id } from '@_types/common' +import { integer } from '@_types/Numeric' + +/** + * Starts a trained model deployment, which allocates the model to every machine learning node. + * @rest_spec_name ml.update_trained_model_deployment + * @availability stack since=8.6.0 stability=stable + * @availability serverless stability=beta visibility=public + * @cluster_privileges manage_ml + */ +export interface Request extends RequestBase { + path_parts: { + /** + * The unique identifier of the trained model. Currently, only PyTorch models are supported. + */ + model_id: Id + } + body: { + /** + * The number of model allocations on each node where the model is deployed. + * All allocations on a node share the same copy of the model in memory but use + * a separate set of threads to evaluate the model. + * Increasing this value generally increases the throughput. + * If this setting is greater than the number of hardware threads + * it will automatically be changed to a value less than the number of hardware threads. + * @server_default 1 + */ + number_of_allocations?: integer + } +} diff --git a/specification/ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentResponse.ts b/specification/ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentResponse.ts new file mode 100644 index 0000000000..cc28bf2212 --- /dev/null +++ b/specification/ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentResponse.ts @@ -0,0 +1,26 @@ +/* + * 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 { TrainedModelAssignment } from '../_types/TrainedModel' + +export class Response { + body: { + assignment: TrainedModelAssignment + } +}