Skip to content

Commit 1ff79eb

Browse files
Auto-generated API code (#2896)
Co-authored-by: Josh Mock <[email protected]>
1 parent f5611e7 commit 1ff79eb

File tree

8 files changed

+589
-129
lines changed

8 files changed

+589
-129
lines changed

docs/reference/api-reference.md

Lines changed: 106 additions & 60 deletions
Large diffs are not rendered by default.

src/api/api/indices.ts

Lines changed: 118 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ export default class Indices {
419419
'verbose'
420420
]
421421
},
422+
'indices.get_data_stream_mappings': {
423+
path: [
424+
'name'
425+
],
426+
body: [],
427+
query: []
428+
},
422429
'indices.get_data_stream_options': {
423430
path: [
424431
'name'
@@ -589,6 +596,13 @@ export default class Indices {
589596
'timeout'
590597
]
591598
},
599+
'indices.put_data_stream_mappings': {
600+
path: [
601+
'name'
602+
],
603+
body: [],
604+
query: []
605+
},
592606
'indices.put_data_stream_options': {
593607
path: [
594608
'name'
@@ -739,7 +753,13 @@ export default class Indices {
739753
'block'
740754
],
741755
body: [],
742-
query: []
756+
query: [
757+
'allow_no_indices',
758+
'expand_wildcards',
759+
'ignore_unavailable',
760+
'master_timeout',
761+
'timeout'
762+
]
743763
},
744764
'indices.resolve_cluster': {
745765
path: [
@@ -2486,6 +2506,51 @@ export default class Indices {
24862506
return await this.transport.request({ path, method, querystring, body, meta }, options)
24872507
}
24882508

2509+
/**
2510+
* Gets a data stream's mappings
2511+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation}
2512+
*/
2513+
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
2514+
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
2515+
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
2516+
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
2517+
const {
2518+
path: acceptedPath
2519+
} = this.acceptedParams['indices.get_data_stream_mappings']
2520+
2521+
const userQuery = params?.querystring
2522+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
2523+
2524+
let body: Record<string, any> | string | undefined
2525+
const userBody = params?.body
2526+
if (userBody != null) {
2527+
if (typeof userBody === 'string') {
2528+
body = userBody
2529+
} else {
2530+
body = { ...userBody }
2531+
}
2532+
}
2533+
2534+
params = params ?? {}
2535+
for (const key in params) {
2536+
if (acceptedPath.includes(key)) {
2537+
continue
2538+
} else if (key !== 'body' && key !== 'querystring') {
2539+
querystring[key] = params[key]
2540+
}
2541+
}
2542+
2543+
const method = 'GET'
2544+
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_mappings`
2545+
const meta: TransportRequestMetadata = {
2546+
name: 'indices.get_data_stream_mappings',
2547+
pathParts: {
2548+
name: params.name
2549+
}
2550+
}
2551+
return await this.transport.request({ path, method, querystring, body, meta }, options)
2552+
}
2553+
24892554
/**
24902555
* Get data stream options. Get the data stream options configuration of one or more data streams.
24912556
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
@@ -3248,6 +3313,51 @@ export default class Indices {
32483313
return await this.transport.request({ path, method, querystring, body, meta }, options)
32493314
}
32503315

3316+
/**
3317+
* Updates a data stream's mappings
3318+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation}
3319+
*/
3320+
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
3321+
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
3322+
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
3323+
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
3324+
const {
3325+
path: acceptedPath
3326+
} = this.acceptedParams['indices.put_data_stream_mappings']
3327+
3328+
const userQuery = params?.querystring
3329+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
3330+
3331+
let body: Record<string, any> | string | undefined
3332+
const userBody = params?.body
3333+
if (userBody != null) {
3334+
if (typeof userBody === 'string') {
3335+
body = userBody
3336+
} else {
3337+
body = { ...userBody }
3338+
}
3339+
}
3340+
3341+
params = params ?? {}
3342+
for (const key in params) {
3343+
if (acceptedPath.includes(key)) {
3344+
continue
3345+
} else if (key !== 'body' && key !== 'querystring') {
3346+
querystring[key] = params[key]
3347+
}
3348+
}
3349+
3350+
const method = 'PUT'
3351+
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_mappings`
3352+
const meta: TransportRequestMetadata = {
3353+
name: 'indices.put_data_stream_mappings',
3354+
pathParts: {
3355+
name: params.name
3356+
}
3357+
}
3358+
return await this.transport.request({ path, method, querystring, body, meta }, options)
3359+
}
3360+
32513361
/**
32523362
* Update data stream options. Update the data stream options of the specified data streams.
32533363
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
@@ -3729,13 +3839,13 @@ export default class Indices {
37293839
}
37303840

37313841
/**
3732-
* Removes a block from an index.
3733-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html | Elasticsearch API documentation}
3842+
* Remove an index block. Remove an index block from an index. Index blocks limit the operations allowed on an index by blocking specific operation types.
3843+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-remove-block | Elasticsearch API documentation}
37343844
*/
3735-
async removeBlock (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
3736-
async removeBlock (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
3737-
async removeBlock (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
3738-
async removeBlock (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
3845+
async removeBlock (this: That, params: T.IndicesRemoveBlockRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesRemoveBlockResponse>
3846+
async removeBlock (this: That, params: T.IndicesRemoveBlockRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesRemoveBlockResponse, unknown>>
3847+
async removeBlock (this: That, params: T.IndicesRemoveBlockRequest, options?: TransportRequestOptions): Promise<T.IndicesRemoveBlockResponse>
3848+
async removeBlock (this: That, params: T.IndicesRemoveBlockRequest, options?: TransportRequestOptions): Promise<any> {
37393849
const {
37403850
path: acceptedPath
37413851
} = this.acceptedParams['indices.remove_block']
@@ -3753,11 +3863,11 @@ export default class Indices {
37533863
}
37543864
}
37553865

3756-
params = params ?? {}
37573866
for (const key in params) {
37583867
if (acceptedPath.includes(key)) {
37593868
continue
37603869
} else if (key !== 'body' && key !== 'querystring') {
3870+
// @ts-expect-error
37613871
querystring[key] = params[key]
37623872
}
37633873
}

src/api/api/inference.ts

Lines changed: 125 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ export default class Inference {
127127
],
128128
query: []
129129
},
130+
'inference.put_amazonsagemaker': {
131+
path: [
132+
'task_type',
133+
'amazonsagemaker_inference_id'
134+
],
135+
body: [],
136+
query: []
137+
},
130138
'inference.put_anthropic': {
131139
path: [
132140
'task_type',
@@ -179,6 +187,18 @@ export default class Inference {
179187
],
180188
query: []
181189
},
190+
'inference.put_deepseek': {
191+
path: [
192+
'task_type',
193+
'deepseek_inference_id'
194+
],
195+
body: [
196+
'chunking_settings',
197+
'service',
198+
'service_settings'
199+
],
200+
query: []
201+
},
182202
'inference.put_elasticsearch': {
183203
path: [
184204
'task_type',
@@ -644,7 +664,7 @@ export default class Inference {
644664
}
645665

646666
/**
647-
* Create an inference endpoint. IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs. The following integrations are available through the inference API. You can find the available task types next to the integration name: * AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`) * Amazon Bedrock (`completion`, `text_embedding`) * Anthropic (`completion`) * Azure AI Studio (`completion`, `text_embedding`) * Azure OpenAI (`completion`, `text_embedding`) * Cohere (`completion`, `rerank`, `text_embedding`) * Elasticsearch (`rerank`, `sparse_embedding`, `text_embedding` - this service is for built-in models and models uploaded through Eland) * ELSER (`sparse_embedding`) * Google AI Studio (`completion`, `text_embedding`) * Google Vertex AI (`rerank`, `text_embedding`) * Hugging Face (`chat_completion`, `completion`, `rerank`, `text_embedding`) * Mistral (`chat_completion`, `completion`, `text_embedding`) * OpenAI (`chat_completion`, `completion`, `text_embedding`) * VoyageAI (`text_embedding`, `rerank`) * Watsonx inference integration (`text_embedding`) * JinaAI (`text_embedding`, `rerank`)
667+
* Create an inference endpoint. IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs. The following integrations are available through the inference API. You can find the available task types next to the integration name: * AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`) * Amazon Bedrock (`completion`, `text_embedding`) * Anthropic (`completion`) * Azure AI Studio (`completion`, `text_embedding`) * Azure OpenAI (`completion`, `text_embedding`) * Cohere (`completion`, `rerank`, `text_embedding`) * DeepSeek (`completion`, `chat_completion`) * Elasticsearch (`rerank`, `sparse_embedding`, `text_embedding` - this service is for built-in models and models uploaded through Eland) * ELSER (`sparse_embedding`) * Google AI Studio (`completion`, `text_embedding`) * Google Vertex AI (`rerank`, `text_embedding`) * Hugging Face (`chat_completion`, `completion`, `rerank`, `text_embedding`) * Mistral (`chat_completion`, `completion`, `text_embedding`) * OpenAI (`chat_completion`, `completion`, `text_embedding`) * VoyageAI (`text_embedding`, `rerank`) * Watsonx inference integration (`text_embedding`) * JinaAI (`text_embedding`, `rerank`)
648668
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put | Elasticsearch API documentation}
649669
*/
650670
async put (this: That, params: T.InferencePutRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutResponse>
@@ -814,6 +834,52 @@ export default class Inference {
814834
return await this.transport.request({ path, method, querystring, body, meta }, options)
815835
}
816836

837+
/**
838+
* Configure a Amazon SageMaker inference endpoint
839+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-service-amazon-sagemaker.html | Elasticsearch API documentation}
840+
*/
841+
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
842+
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
843+
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
844+
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
845+
const {
846+
path: acceptedPath
847+
} = this.acceptedParams['inference.put_amazonsagemaker']
848+
849+
const userQuery = params?.querystring
850+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
851+
852+
let body: Record<string, any> | string | undefined
853+
const userBody = params?.body
854+
if (userBody != null) {
855+
if (typeof userBody === 'string') {
856+
body = userBody
857+
} else {
858+
body = { ...userBody }
859+
}
860+
}
861+
862+
params = params ?? {}
863+
for (const key in params) {
864+
if (acceptedPath.includes(key)) {
865+
continue
866+
} else if (key !== 'body' && key !== 'querystring') {
867+
querystring[key] = params[key]
868+
}
869+
}
870+
871+
const method = 'PUT'
872+
const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.amazonsagemaker_inference_id.toString())}`
873+
const meta: TransportRequestMetadata = {
874+
name: 'inference.put_amazonsagemaker',
875+
pathParts: {
876+
task_type: params.task_type,
877+
amazonsagemaker_inference_id: params.amazonsagemaker_inference_id
878+
}
879+
}
880+
return await this.transport.request({ path, method, querystring, body, meta }, options)
881+
}
882+
817883
/**
818884
* Create an Anthropic inference endpoint. Create an inference endpoint to perform an inference task with the `anthropic` service.
819885
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-anthropic | Elasticsearch API documentation}
@@ -1046,6 +1112,64 @@ export default class Inference {
10461112
return await this.transport.request({ path, method, querystring, body, meta }, options)
10471113
}
10481114

1115+
/**
1116+
* Create a DeepSeek inference endpoint. Create an inference endpoint to perform an inference task with the `deepseek` service.
1117+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-deepseek | Elasticsearch API documentation}
1118+
*/
1119+
async putDeepseek (this: That, params: T.InferencePutDeepseekRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutDeepseekResponse>
1120+
async putDeepseek (this: That, params: T.InferencePutDeepseekRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutDeepseekResponse, unknown>>
1121+
async putDeepseek (this: That, params: T.InferencePutDeepseekRequest, options?: TransportRequestOptions): Promise<T.InferencePutDeepseekResponse>
1122+
async putDeepseek (this: That, params: T.InferencePutDeepseekRequest, options?: TransportRequestOptions): Promise<any> {
1123+
const {
1124+
path: acceptedPath,
1125+
body: acceptedBody,
1126+
query: acceptedQuery
1127+
} = this.acceptedParams['inference.put_deepseek']
1128+
1129+
const userQuery = params?.querystring
1130+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
1131+
1132+
let body: Record<string, any> | string | undefined
1133+
const userBody = params?.body
1134+
if (userBody != null) {
1135+
if (typeof userBody === 'string') {
1136+
body = userBody
1137+
} else {
1138+
body = { ...userBody }
1139+
}
1140+
}
1141+
1142+
for (const key in params) {
1143+
if (acceptedBody.includes(key)) {
1144+
body = body ?? {}
1145+
// @ts-expect-error
1146+
body[key] = params[key]
1147+
} else if (acceptedPath.includes(key)) {
1148+
continue
1149+
} else if (key !== 'body' && key !== 'querystring') {
1150+
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1151+
// @ts-expect-error
1152+
querystring[key] = params[key]
1153+
} else {
1154+
body = body ?? {}
1155+
// @ts-expect-error
1156+
body[key] = params[key]
1157+
}
1158+
}
1159+
}
1160+
1161+
const method = 'PUT'
1162+
const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.deepseek_inference_id.toString())}`
1163+
const meta: TransportRequestMetadata = {
1164+
name: 'inference.put_deepseek',
1165+
pathParts: {
1166+
task_type: params.task_type,
1167+
deepseek_inference_id: params.deepseek_inference_id
1168+
}
1169+
}
1170+
return await this.transport.request({ path, method, querystring, body, meta }, options)
1171+
}
1172+
10491173
/**
10501174
* Create an Elasticsearch inference endpoint. Create an inference endpoint to perform an inference task with the `elasticsearch` service. > info > Your Elasticsearch deployment contains preconfigured ELSER and E5 inference endpoints, you only need to create the enpoints using the API if you want to customize the settings. If you use the ELSER or the E5 model through the `elasticsearch` service, the API request will automatically download and deploy the model if it isn't downloaded yet. > info > You might see a 502 bad gateway error in the response when using the Kibana Console. This error usually just reflects a timeout, while the model downloads in the background. You can check the download progress in the Machine Learning UI. If using the Python client, you can set the timeout parameter to a higher value. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
10511175
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elasticsearch | Elasticsearch API documentation}

0 commit comments

Comments
 (0)