From 7c59eda3db406f339f5650d4fb3d552f4e857ec7 Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 11 Aug 2021 12:00:42 +0200 Subject: [PATCH] API generation --- api/api/ml.js | 4 ++++ api/requestParams.d.ts | 3 ++- docs/reference.asciidoc | 32 +++++++++++++++++++------------- index.d.ts | 16 ++++++++-------- 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a/api/api/ml.js b/api/api/ml.js index 545403d3b..bcc953e9d 100644 --- a/api/api/ml.js +++ b/api/api/ml.js @@ -1056,6 +1056,10 @@ MlApi.prototype.inferTrainedModelDeployment = function mlInferTrainedModelDeploy const err = new this[kConfigurationError]('Missing required parameter: model_id or modelId') return handleError(err, callback) } + if (params.body == null) { + const err = new this[kConfigurationError]('Missing required parameter: body') + return handleError(err, callback) + } let { method, body, modelId, model_id, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 73f98a8cf..151072bc9 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -1737,9 +1737,10 @@ export interface MlGetTrainedModelsStats extends Generic { size?: number; } -export interface MlInferTrainedModelDeployment extends Generic { +export interface MlInferTrainedModelDeployment extends Generic { model_id: string; timeout?: string; + body: T; } export interface MlInfo extends Generic { diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 888f72f82..276398f41 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -1949,7 +1949,7 @@ link:{ref}/cluster-allocation-explain.html[Documentation] + |`boolean` - Return information about disk usage and shard sizes (default: false) |`body` -|`object` - The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' +|`object` - The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard' |=== @@ -7144,17 +7144,22 @@ _Default:_ `100` ---- client.ml.inferTrainedModelDeployment({ model_id: string, - timeout: string + timeout: string, + body: object }) ---- -link:{ref}/ml-df-analytics-apis.html[Documentation] + +link:{ref}/infer-trained-model-deployment.html[Documentation] + [cols=2*] |=== |`model_id` or `modelId` -|`string` - The ID of the model to perform inference on +|`string` - The unique identifier of the trained model. |`timeout` -|`string` - Controls the time to wait for the inference result +|`string` - Controls the amount of time to wait for inference results. + +_Default:_ `10s` + +|`body` +|`object` - The input text to be evaluated. |=== @@ -7621,14 +7626,15 @@ client.ml.startTrainedModelDeployment({ timeout: string }) ---- -link:{ref}/ml-df-analytics-apis.html[Documentation] + +link:{ref}/start-trained-model-deployment.html[Documentation] + [cols=2*] |=== |`model_id` or `modelId` -|`string` - The ID of the model to deploy +|`string` - The unique identifier of the trained model. |`timeout` -|`string` - Controls the time to wait until the model is deployed +|`string` - Controls the amount of time to wait for the model to deploy. + +_Default:_ `20s` |=== @@ -7713,11 +7719,11 @@ client.ml.stopTrainedModelDeployment({ model_id: string }) ---- -link:{ref}/ml-df-analytics-apis.html[Documentation] + +link:{ref}/stop-trained-model-deployment.html[Documentation] + [cols=2*] |=== |`model_id` or `modelId` -|`string` - The ID of the model to undeploy +|`string` - The unique identifier of the trained model. |=== @@ -10603,7 +10609,7 @@ client.sql.clearCursor({ body: object }) ---- -link:{ref}/sql-pagination.html[Documentation] + +link:{ref}/clear-sql-cursor-api.html[Documentation] + [cols=2*] |=== |`body` @@ -10690,7 +10696,7 @@ client.sql.query({ body: object }) ---- -link:{ref}/sql-rest-overview.html[Documentation] + +link:{ref}/sql-search-api.html[Documentation] + {jsclient}/sql_query_examples.html[Code Example] + [cols=2*] |=== @@ -10711,7 +10717,7 @@ client.sql.translate({ body: object }) ---- -link:{ref}/sql-translate.html[Documentation] + +link:{ref}/sql-translate-api.html[Documentation] + [cols=2*] |=== |`body` diff --git a/index.d.ts b/index.d.ts index 0dae77481..5de87f4b9 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1650,14 +1650,14 @@ declare class Client { getTrainedModelsStats, TContext = Context>(callback: callbackFn): TransportRequestCallback getTrainedModelsStats, TContext = Context>(params: RequestParams.MlGetTrainedModelsStats, callback: callbackFn): TransportRequestCallback getTrainedModelsStats, TContext = Context>(params: RequestParams.MlGetTrainedModelsStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - infer_trained_model_deployment, TContext = Context>(params?: RequestParams.MlInferTrainedModelDeployment, options?: TransportRequestOptions): TransportRequestPromise> - infer_trained_model_deployment, TContext = Context>(callback: callbackFn): TransportRequestCallback - infer_trained_model_deployment, TContext = Context>(params: RequestParams.MlInferTrainedModelDeployment, callback: callbackFn): TransportRequestCallback - infer_trained_model_deployment, TContext = Context>(params: RequestParams.MlInferTrainedModelDeployment, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - inferTrainedModelDeployment, TContext = Context>(params?: RequestParams.MlInferTrainedModelDeployment, options?: TransportRequestOptions): TransportRequestPromise> - inferTrainedModelDeployment, TContext = Context>(callback: callbackFn): TransportRequestCallback - inferTrainedModelDeployment, TContext = Context>(params: RequestParams.MlInferTrainedModelDeployment, callback: callbackFn): TransportRequestCallback - inferTrainedModelDeployment, TContext = Context>(params: RequestParams.MlInferTrainedModelDeployment, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + infer_trained_model_deployment, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlInferTrainedModelDeployment, options?: TransportRequestOptions): TransportRequestPromise> + infer_trained_model_deployment, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback + infer_trained_model_deployment, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlInferTrainedModelDeployment, callback: callbackFn): TransportRequestCallback + infer_trained_model_deployment, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlInferTrainedModelDeployment, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + inferTrainedModelDeployment, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlInferTrainedModelDeployment, options?: TransportRequestOptions): TransportRequestPromise> + inferTrainedModelDeployment, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback + inferTrainedModelDeployment, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlInferTrainedModelDeployment, callback: callbackFn): TransportRequestCallback + inferTrainedModelDeployment, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlInferTrainedModelDeployment, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback info, TContext = Context>(params?: RequestParams.MlInfo, options?: TransportRequestOptions): TransportRequestPromise> info, TContext = Context>(callback: callbackFn): TransportRequestCallback info, TContext = Context>(params: RequestParams.MlInfo, callback: callbackFn): TransportRequestCallback