Skip to content

Commit 7e41af8

Browse files
Auto-generated API code (#2927)
1 parent 3d0a451 commit 7e41af8

File tree

14 files changed

+434
-298
lines changed

14 files changed

+434
-298
lines changed

docs/reference/api-reference.md

Lines changed: 68 additions & 61 deletions
Large diffs are not rendered by default.

src/api/api/cluster.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,12 @@ export default class Cluster {
3838
'cluster.allocation_explain': {
3939
path: [],
4040
body: [
41+
'current_node',
4142
'index',
42-
'shard',
4343
'primary',
44-
'current_node'
44+
'shard'
4545
],
4646
query: [
47-
'index',
48-
'shard',
49-
'primary',
50-
'current_node',
5147
'include_disk_info',
5248
'include_yes_decisions',
5349
'master_timeout'
@@ -226,7 +222,7 @@ export default class Cluster {
226222
}
227223

228224
/**
229-
* Explain the shard allocations. Get explanations for shard allocations in the cluster. This API accepts the current_node, index, primary and shard parameters in the request body or in query parameters, but not in both at the same time. For unassigned shards, it provides an explanation for why the shard is unassigned. For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node. This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise. Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API.
225+
* Explain the shard allocations. Get explanations for shard allocations in the cluster. For unassigned shards, it provides an explanation for why the shard is unassigned. For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node. This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise. Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API.
230226
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain | Elasticsearch API documentation}
231227
*/
232228
async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterAllocationExplainResponse>

src/api/api/get.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
4141
'routing',
4242
'_source',
4343
'_source_excludes',
44-
'_source_exclude_vectors',
4544
'_source_includes',
4645
'stored_fields',
4746
'version',

src/api/api/indices.ts

Lines changed: 3 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -419,15 +419,6 @@ export default class Indices {
419419
'verbose'
420420
]
421421
},
422-
'indices.get_data_stream_mappings': {
423-
path: [
424-
'name'
425-
],
426-
body: [],
427-
query: [
428-
'master_timeout'
429-
]
430-
},
431422
'indices.get_data_stream_options': {
432423
path: [
433424
'name'
@@ -598,19 +589,6 @@ export default class Indices {
598589
'timeout'
599590
]
600591
},
601-
'indices.put_data_stream_mappings': {
602-
path: [
603-
'name'
604-
],
605-
body: [
606-
'mappings'
607-
],
608-
query: [
609-
'dry_run',
610-
'master_timeout',
611-
'timeout'
612-
]
613-
},
614592
'indices.put_data_stream_options': {
615593
path: [
616594
'name'
@@ -1661,7 +1639,7 @@ export default class Indices {
16611639

16621640
/**
16631641
* Delete data stream options. Removes the data stream options from a data stream.
1664-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
1642+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/9.1/index.html | Elasticsearch API documentation}
16651643
*/
16661644
async deleteDataStreamOptions (this: That, params: T.IndicesDeleteDataStreamOptionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDeleteDataStreamOptionsResponse>
16671645
async deleteDataStreamOptions (this: That, params: T.IndicesDeleteDataStreamOptionsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesDeleteDataStreamOptionsResponse, unknown>>
@@ -2517,54 +2495,9 @@ export default class Indices {
25172495
return await this.transport.request({ path, method, querystring, body, meta }, options)
25182496
}
25192497

2520-
/**
2521-
* Get data stream mappings. Get mapping information for one or more data streams.
2522-
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-mappings | Elasticsearch API documentation}
2523-
*/
2524-
async getDataStreamMappings (this: That, params: T.IndicesGetDataStreamMappingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetDataStreamMappingsResponse>
2525-
async getDataStreamMappings (this: That, params: T.IndicesGetDataStreamMappingsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetDataStreamMappingsResponse, unknown>>
2526-
async getDataStreamMappings (this: That, params: T.IndicesGetDataStreamMappingsRequest, options?: TransportRequestOptions): Promise<T.IndicesGetDataStreamMappingsResponse>
2527-
async getDataStreamMappings (this: That, params: T.IndicesGetDataStreamMappingsRequest, options?: TransportRequestOptions): Promise<any> {
2528-
const {
2529-
path: acceptedPath
2530-
} = this.acceptedParams['indices.get_data_stream_mappings']
2531-
2532-
const userQuery = params?.querystring
2533-
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
2534-
2535-
let body: Record<string, any> | string | undefined
2536-
const userBody = params?.body
2537-
if (userBody != null) {
2538-
if (typeof userBody === 'string') {
2539-
body = userBody
2540-
} else {
2541-
body = { ...userBody }
2542-
}
2543-
}
2544-
2545-
for (const key in params) {
2546-
if (acceptedPath.includes(key)) {
2547-
continue
2548-
} else if (key !== 'body' && key !== 'querystring') {
2549-
// @ts-expect-error
2550-
querystring[key] = params[key]
2551-
}
2552-
}
2553-
2554-
const method = 'GET'
2555-
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_mappings`
2556-
const meta: TransportRequestMetadata = {
2557-
name: 'indices.get_data_stream_mappings',
2558-
pathParts: {
2559-
name: params.name
2560-
}
2561-
}
2562-
return await this.transport.request({ path, method, querystring, body, meta }, options)
2563-
}
2564-
25652498
/**
25662499
* Get data stream options. Get the data stream options configuration of one or more data streams.
2567-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
2500+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/9.1/index.html | Elasticsearch API documentation}
25682501
*/
25692502
async getDataStreamOptions (this: That, params: T.IndicesGetDataStreamOptionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetDataStreamOptionsResponse>
25702503
async getDataStreamOptions (this: That, params: T.IndicesGetDataStreamOptionsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetDataStreamOptionsResponse, unknown>>
@@ -3324,56 +3257,9 @@ export default class Indices {
33243257
return await this.transport.request({ path, method, querystring, body, meta }, options)
33253258
}
33263259

3327-
/**
3328-
* Update data stream mappings. This API can be used to override mappings on specific data streams. These overrides will take precedence over what is specified in the template that the data stream matches. The mapping change is only applied to new write indices that are created during rollover after this API is called. No indices are changed by this API.
3329-
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-mappings | Elasticsearch API documentation}
3330-
*/
3331-
async putDataStreamMappings (this: That, params: T.IndicesPutDataStreamMappingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutDataStreamMappingsResponse>
3332-
async putDataStreamMappings (this: That, params: T.IndicesPutDataStreamMappingsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutDataStreamMappingsResponse, unknown>>
3333-
async putDataStreamMappings (this: That, params: T.IndicesPutDataStreamMappingsRequest, options?: TransportRequestOptions): Promise<T.IndicesPutDataStreamMappingsResponse>
3334-
async putDataStreamMappings (this: That, params: T.IndicesPutDataStreamMappingsRequest, options?: TransportRequestOptions): Promise<any> {
3335-
const {
3336-
path: acceptedPath,
3337-
body: acceptedBody,
3338-
query: acceptedQuery
3339-
} = this.acceptedParams['indices.put_data_stream_mappings']
3340-
3341-
const userQuery = params?.querystring
3342-
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
3343-
3344-
let body: any = params.body ?? undefined
3345-
for (const key in params) {
3346-
if (acceptedBody.includes(key)) {
3347-
// @ts-expect-error
3348-
body = params[key]
3349-
} else if (acceptedPath.includes(key)) {
3350-
continue
3351-
} else if (key !== 'body' && key !== 'querystring') {
3352-
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
3353-
// @ts-expect-error
3354-
querystring[key] = params[key]
3355-
} else {
3356-
body = body ?? {}
3357-
// @ts-expect-error
3358-
body[key] = params[key]
3359-
}
3360-
}
3361-
}
3362-
3363-
const method = 'PUT'
3364-
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_mappings`
3365-
const meta: TransportRequestMetadata = {
3366-
name: 'indices.put_data_stream_mappings',
3367-
pathParts: {
3368-
name: params.name
3369-
}
3370-
}
3371-
return await this.transport.request({ path, method, querystring, body, meta }, options)
3372-
}
3373-
33743260
/**
33753261
* Update data stream options. Update the data stream options of the specified data streams.
3376-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
3262+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/9.1/index.html | Elasticsearch API documentation}
33773263
*/
33783264
async putDataStreamOptions (this: That, params: T.IndicesPutDataStreamOptionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutDataStreamOptionsResponse>
33793265
async putDataStreamOptions (this: That, params: T.IndicesPutDataStreamOptionsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutDataStreamOptionsResponse, unknown>>

src/api/api/inference.ts

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,19 @@ export default class Inference {
202202
'timeout'
203203
]
204204
},
205+
'inference.put_custom': {
206+
path: [
207+
'task_type',
208+
'custom_inference_id'
209+
],
210+
body: [
211+
'chunking_settings',
212+
'service',
213+
'service_settings',
214+
'task_settings'
215+
],
216+
query: []
217+
},
205218
'inference.put_deepseek': {
206219
path: [
207220
'task_type',
@@ -875,7 +888,7 @@ export default class Inference {
875888

876889
/**
877890
* Configure a Amazon SageMaker inference endpoint
878-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-service-amazon-sagemaker.html | Elasticsearch API documentation}
891+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/9.1/infer-service-amazon-sagemaker.html | Elasticsearch API documentation}
879892
*/
880893
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
881894
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
@@ -1151,6 +1164,64 @@ export default class Inference {
11511164
return await this.transport.request({ path, method, querystring, body, meta }, options)
11521165
}
11531166

1167+
/**
1168+
* Create a custom inference endpoint. The custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations. The custom service gives you the ability to define the headers, url, query parameters, request body, and secrets. The custom service supports the template replacement functionality, which enables you to define a template that can be replaced with the value associated with that key. Templates are portions of a string that start with `${` and end with `}`. The parameters `secret_parameters` and `task_settings` are checked for keys for template replacement. Template replacement is supported in the `request`, `headers`, `url`, and `query_parameters`. If the definition (key) is not found for a template, an error message is returned. In case of an endpoint definition like the following: ``` PUT _inference/text_embedding/test-text-embedding { "service": "custom", "service_settings": { "secret_parameters": { "api_key": "<some api key>" }, "url": "...endpoints.huggingface.cloud/v1/embeddings", "headers": { "Authorization": "Bearer ${api_key}", "Content-Type": "application/json" }, "request": "{\"input\": ${input}}", "response": { "json_parser": { "text_embeddings":"$.data[*].embedding[*]" } } } } ``` To replace `${api_key}` the `secret_parameters` and `task_settings` are checked for a key named `api_key`. > info > Templates should not be surrounded by quotes. Pre-defined templates: * `${input}` refers to the array of input strings that comes from the `input` field of the subsequent inference requests. * `${input_type}` refers to the input type translation values. * `${query}` refers to the query field used specifically for reranking tasks. * `${top_n}` refers to the `top_n` field available when performing rerank requests. * `${return_documents}` refers to the `return_documents` field available when performing rerank requests.
1169+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom | Elasticsearch API documentation}
1170+
*/
1171+
async putCustom (this: That, params: T.InferencePutCustomRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutCustomResponse>
1172+
async putCustom (this: That, params: T.InferencePutCustomRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutCustomResponse, unknown>>
1173+
async putCustom (this: That, params: T.InferencePutCustomRequest, options?: TransportRequestOptions): Promise<T.InferencePutCustomResponse>
1174+
async putCustom (this: That, params: T.InferencePutCustomRequest, options?: TransportRequestOptions): Promise<any> {
1175+
const {
1176+
path: acceptedPath,
1177+
body: acceptedBody,
1178+
query: acceptedQuery
1179+
} = this.acceptedParams['inference.put_custom']
1180+
1181+
const userQuery = params?.querystring
1182+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
1183+
1184+
let body: Record<string, any> | string | undefined
1185+
const userBody = params?.body
1186+
if (userBody != null) {
1187+
if (typeof userBody === 'string') {
1188+
body = userBody
1189+
} else {
1190+
body = { ...userBody }
1191+
}
1192+
}
1193+
1194+
for (const key in params) {
1195+
if (acceptedBody.includes(key)) {
1196+
body = body ?? {}
1197+
// @ts-expect-error
1198+
body[key] = params[key]
1199+
} else if (acceptedPath.includes(key)) {
1200+
continue
1201+
} else if (key !== 'body' && key !== 'querystring') {
1202+
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1203+
// @ts-expect-error
1204+
querystring[key] = params[key]
1205+
} else {
1206+
body = body ?? {}
1207+
// @ts-expect-error
1208+
body[key] = params[key]
1209+
}
1210+
}
1211+
}
1212+
1213+
const method = 'PUT'
1214+
const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.custom_inference_id.toString())}`
1215+
const meta: TransportRequestMetadata = {
1216+
name: 'inference.put_custom',
1217+
pathParts: {
1218+
task_type: params.task_type,
1219+
custom_inference_id: params.custom_inference_id
1220+
}
1221+
}
1222+
return await this.transport.request({ path, method, querystring, body, meta }, options)
1223+
}
1224+
11541225
/**
11551226
* Create a DeepSeek inference endpoint. Create an inference endpoint to perform an inference task with the `deepseek` service.
11561227
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-deepseek | Elasticsearch API documentation}

src/api/api/knn_search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
3838

3939
/**
4040
* Performs a kNN search.
41-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html | Elasticsearch API documentation}
41+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/9.1/search-search.html | Elasticsearch API documentation}
4242
*/
4343
export default async function KnnSearchApi (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
4444
export default async function KnnSearchApi (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>

src/api/api/ml.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4771,7 +4771,7 @@ export default class Ml {
47714771

47724772
/**
47734773
* Validate an anomaly detection job.
4774-
* @see {@link https://www.elastic.co/guide/en/machine-learning/master/ml-jobs.html | Elasticsearch API documentation}
4774+
* @see {@link https://www.elastic.co/guide/en/machine-learning/9.1/ml-jobs.html | Elasticsearch API documentation}
47754775
*/
47764776
async validate (this: That, params?: T.MlValidateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlValidateResponse>
47774777
async validate (this: That, params?: T.MlValidateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlValidateResponse, unknown>>

src/api/api/msearch.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
4343
'ignore_throttled',
4444
'ignore_unavailable',
4545
'include_named_queries_score',
46+
'index',
4647
'max_concurrent_searches',
4748
'max_concurrent_shard_requests',
4849
'pre_filter_shard_size',

0 commit comments

Comments
 (0)