From 5d36257241d01a23ae17249fd81987439e56c30f Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 3 Jun 2024 19:33:01 +0100 Subject: [PATCH] Auto-generated code for 8.13 (#2263) --- docs/reference.asciidoc | 15 +++++++++++++-- src/api/api/ml.ts | 26 +++++++++++++++++++------- src/api/types.ts | 23 +++++++++++++++++------ src/api/typesWithBodyKey.ts | 26 ++++++++++++++++++++------ 4 files changed, 69 insertions(+), 21 deletions(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index fd3e6caa3..0c38272c4 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -4243,7 +4243,7 @@ a new date field is added instead of string. not used at all by Elasticsearch, but can be used to store application-specific metadata. ** *`numeric_detection` (Optional, boolean)*: Automatically map strings into numeric data types for all fields. -** *`properties` (Optional, Record)*: Mapping for a field. For new fields, this mapping can include: +** *`properties` (Optional, Record)*: Mapping for a field. For new fields, this mapping can include: - Field name - Field data type @@ -6935,9 +6935,20 @@ Updates certain properties of trained model deployment. {ref}/update-trained-model-deployment.html[Endpoint documentation] [source,ts] ---- -client.ml.updateTrainedModelDeployment() +client.ml.updateTrainedModelDeployment({ model_id }) ---- +[discrete] +==== Arguments + +* *Request (object):* +** *`model_id` (string)*: The unique identifier of the trained model. Currently, only PyTorch models are supported. +** *`number_of_allocations` (Optional, number)*: 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. [discrete] ==== upgrade_job_snapshot diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index c100e7315..a7323bd3d 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -2417,19 +2417,31 @@ export default class Ml { * Updates certain properties of trained model deployment. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.13/update-trained-model-deployment.html | Elasticsearch API documentation} */ - async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest | TB.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest | TB.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest | TB.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise + async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest | TB.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] + const acceptedBody: string[] = ['number_of_allocations'] 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 + } - params = params ?? {} 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 querystring[key] = params[key] } } diff --git a/src/api/types.ts b/src/api/types.ts index 59a81724e..94a3b061d 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -810,7 +810,7 @@ export interface MsearchTemplateTemplateConfig { } export interface MtermvectorsOperation { - _id: Id + _id?: Id _index?: IndexName doc?: any fields?: Fields @@ -1412,7 +1412,7 @@ export type SearchHighlighterType = 'plain' | 'fvh' | 'unified' | string export interface SearchHit { _index: IndexName - _id: Id + _id?: Id _score?: double | null _explanation?: ExplainExplanation fields?: Record @@ -4963,7 +4963,7 @@ export interface MappingFieldNamesField { enabled: boolean } -export type MappingFieldType = 'none' | 'geo_point' | 'geo_shape' | 'ip' | 'binary' | 'keyword' | 'text' | 'search_as_you_type' | 'date' | 'date_nanos' | 'boolean' | 'completion' | 'nested' | 'object' | 'murmur3' | 'token_count' | 'percolator' | 'integer' | 'long' | 'short' | 'byte' | 'float' | 'half_float' | 'scaled_float' | 'double' | 'integer_range' | 'float_range' | 'long_range' | 'double_range' | 'date_range' | 'ip_range' | 'alias' | 'join' | 'rank_feature' | 'rank_features' | 'flattened' | 'shape' | 'histogram' | 'constant_keyword' | 'aggregate_metric_double' | 'dense_vector' | 'sparse_vector' | 'match_only_text' +export type MappingFieldType = 'none' | 'geo_point' | 'geo_shape' | 'ip' | 'binary' | 'keyword' | 'text' | 'search_as_you_type' | 'date' | 'date_nanos' | 'boolean' | 'completion' | 'nested' | 'object' | 'version' | 'murmur3' | 'token_count' | 'percolator' | 'integer' | 'long' | 'short' | 'byte' | 'float' | 'half_float' | 'scaled_float' | 'double' | 'integer_range' | 'float_range' | 'long_range' | 'double_range' | 'date_range' | 'ip_range' | 'alias' | 'join' | 'rank_feature' | 'rank_features' | 'flattened' | 'shape' | 'histogram' | 'constant_keyword' | 'aggregate_metric_double' | 'dense_vector' | 'sparse_vector' | 'match_only_text' export interface MappingFlattenedProperty extends MappingPropertyBase { boost?: double @@ -5061,6 +5061,8 @@ export interface MappingKeywordProperty extends MappingDocValuesPropertyBase { eager_global_ordinals?: boolean index?: boolean index_options?: MappingIndexOptions + script?: Script + on_script_error?: MappingOnScriptError normalizer?: string norms?: boolean null_value?: string @@ -14465,6 +14467,15 @@ export interface MlUpdateModelSnapshotResponse { model: MlModelSnapshot } +export interface MlUpdateTrainedModelDeploymentRequest extends RequestBase { + model_id: Id + number_of_allocations?: integer +} + +export interface MlUpdateTrainedModelDeploymentResponse { + assignment: MlTrainedModelAssignment +} + export interface MlUpgradeJobSnapshotRequest extends RequestBase { job_id: Id snapshot_id: Id @@ -15145,7 +15156,7 @@ export interface NodesInfoNodeInfoRepositoriesUrl { export interface NodesInfoNodeInfoScript { allowed_types: string - disable_max_compilations_rate: string + disable_max_compilations_rate?: string } export interface NodesInfoNodeInfoSearch { @@ -15163,7 +15174,7 @@ export interface NodesInfoNodeInfoSettings { repositories?: NodesInfoNodeInfoRepositories discovery?: NodesInfoNodeInfoDiscover action?: NodesInfoNodeInfoAction - client: NodesInfoNodeInfoClient + client?: NodesInfoNodeInfoClient http: NodesInfoNodeInfoSettingsHttp bootstrap?: NodesInfoNodeInfoBootstrap transport: NodesInfoNodeInfoSettingsTransport @@ -15235,7 +15246,7 @@ export interface NodesInfoNodeInfoSettingsIngest { } export interface NodesInfoNodeInfoSettingsNetwork { - host: Host + host?: Host } export interface NodesInfoNodeInfoSettingsNode { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index ef34770ae..15d38a8e7 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -840,7 +840,7 @@ export interface MsearchTemplateTemplateConfig { } export interface MtermvectorsOperation { - _id: Id + _id?: Id _index?: IndexName doc?: any fields?: Fields @@ -1467,7 +1467,7 @@ export type SearchHighlighterType = 'plain' | 'fvh' | 'unified' | string export interface SearchHit { _index: IndexName - _id: Id + _id?: Id _score?: double | null _explanation?: ExplainExplanation fields?: Record @@ -5036,7 +5036,7 @@ export interface MappingFieldNamesField { enabled: boolean } -export type MappingFieldType = 'none' | 'geo_point' | 'geo_shape' | 'ip' | 'binary' | 'keyword' | 'text' | 'search_as_you_type' | 'date' | 'date_nanos' | 'boolean' | 'completion' | 'nested' | 'object' | 'murmur3' | 'token_count' | 'percolator' | 'integer' | 'long' | 'short' | 'byte' | 'float' | 'half_float' | 'scaled_float' | 'double' | 'integer_range' | 'float_range' | 'long_range' | 'double_range' | 'date_range' | 'ip_range' | 'alias' | 'join' | 'rank_feature' | 'rank_features' | 'flattened' | 'shape' | 'histogram' | 'constant_keyword' | 'aggregate_metric_double' | 'dense_vector' | 'sparse_vector' | 'match_only_text' +export type MappingFieldType = 'none' | 'geo_point' | 'geo_shape' | 'ip' | 'binary' | 'keyword' | 'text' | 'search_as_you_type' | 'date' | 'date_nanos' | 'boolean' | 'completion' | 'nested' | 'object' | 'version' | 'murmur3' | 'token_count' | 'percolator' | 'integer' | 'long' | 'short' | 'byte' | 'float' | 'half_float' | 'scaled_float' | 'double' | 'integer_range' | 'float_range' | 'long_range' | 'double_range' | 'date_range' | 'ip_range' | 'alias' | 'join' | 'rank_feature' | 'rank_features' | 'flattened' | 'shape' | 'histogram' | 'constant_keyword' | 'aggregate_metric_double' | 'dense_vector' | 'sparse_vector' | 'match_only_text' export interface MappingFlattenedProperty extends MappingPropertyBase { boost?: double @@ -5134,6 +5134,8 @@ export interface MappingKeywordProperty extends MappingDocValuesPropertyBase { eager_global_ordinals?: boolean index?: boolean index_options?: MappingIndexOptions + script?: Script + on_script_error?: MappingOnScriptError normalizer?: string norms?: boolean null_value?: string @@ -14759,6 +14761,18 @@ export interface MlUpdateModelSnapshotResponse { model: MlModelSnapshot } +export interface MlUpdateTrainedModelDeploymentRequest extends RequestBase { + model_id: Id + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + number_of_allocations?: integer + } +} + +export interface MlUpdateTrainedModelDeploymentResponse { + assignment: MlTrainedModelAssignment +} + export interface MlUpgradeJobSnapshotRequest extends RequestBase { job_id: Id snapshot_id: Id @@ -15444,7 +15458,7 @@ export interface NodesInfoNodeInfoRepositoriesUrl { export interface NodesInfoNodeInfoScript { allowed_types: string - disable_max_compilations_rate: string + disable_max_compilations_rate?: string } export interface NodesInfoNodeInfoSearch { @@ -15462,7 +15476,7 @@ export interface NodesInfoNodeInfoSettings { repositories?: NodesInfoNodeInfoRepositories discovery?: NodesInfoNodeInfoDiscover action?: NodesInfoNodeInfoAction - client: NodesInfoNodeInfoClient + client?: NodesInfoNodeInfoClient http: NodesInfoNodeInfoSettingsHttp bootstrap?: NodesInfoNodeInfoBootstrap transport: NodesInfoNodeInfoSettingsTransport @@ -15534,7 +15548,7 @@ export interface NodesInfoNodeInfoSettingsIngest { } export interface NodesInfoNodeInfoSettingsNetwork { - host: Host + host?: Host } export interface NodesInfoNodeInfoSettingsNode {