Skip to content

Commit d9d54b1

Browse files
Auto-generated API code (#2740)
1 parent 931a80c commit d9d54b1

File tree

9 files changed

+391
-200
lines changed

9 files changed

+391
-200
lines changed

docs/reference/api-reference.md

Lines changed: 69 additions & 52 deletions
Large diffs are not rendered by default.

src/api/api/connector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ export default class Connector {
16671667

16681668
/**
16691669
* Update the connector draft filtering validation. Update the draft filtering validation info for a connector.
1670-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-validation-api.html | Elasticsearch API documentation}
1670+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering-validation | Elasticsearch API documentation}
16711671
*/
16721672
async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ConnectorUpdateFilteringValidationResponse>
16731673
async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ConnectorUpdateFilteringValidationResponse, unknown>>
@@ -1838,7 +1838,7 @@ export default class Connector {
18381838

18391839
/**
18401840
* Update the connector is_native flag.
1841-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-native-api.html | Elasticsearch API documentation}
1841+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-native | Elasticsearch API documentation}
18421842
*/
18431843
async updateNative (this: That, params: T.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ConnectorUpdateNativeResponse>
18441844
async updateNative (this: That, params: T.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ConnectorUpdateNativeResponse, unknown>>

src/api/api/esql.ts

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ export default class Esql {
8585
'drop_null_columns'
8686
]
8787
},
88+
'esql.get_query': {
89+
path: [
90+
'id'
91+
],
92+
body: [],
93+
query: []
94+
},
95+
'esql.list_queries': {
96+
path: [],
97+
body: [],
98+
query: []
99+
},
88100
'esql.query': {
89101
path: [],
90102
body: [
@@ -253,7 +265,7 @@ export default class Esql {
253265

254266
/**
255267
* Stop async ES|QL query. This API interrupts the query execution and returns the results so far. If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can stop it.
256-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-stop-api.html | Elasticsearch API documentation}
268+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-stop | Elasticsearch API documentation}
257269
*/
258270
async asyncQueryStop (this: That, params: T.EsqlAsyncQueryStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlAsyncQueryStopResponse>
259271
async asyncQueryStop (this: That, params: T.EsqlAsyncQueryStopRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryStopResponse, unknown>>
@@ -296,9 +308,94 @@ export default class Esql {
296308
return await this.transport.request({ path, method, querystring, body, meta }, options)
297309
}
298310

311+
/**
312+
* Executes a get ESQL query request
313+
*/
314+
async getQuery (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
315+
async getQuery (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
316+
async getQuery (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
317+
async getQuery (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
318+
const {
319+
path: acceptedPath
320+
} = this.acceptedParams['esql.get_query']
321+
322+
const userQuery = params?.querystring
323+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
324+
325+
let body: Record<string, any> | string | undefined
326+
const userBody = params?.body
327+
if (userBody != null) {
328+
if (typeof userBody === 'string') {
329+
body = userBody
330+
} else {
331+
body = { ...userBody }
332+
}
333+
}
334+
335+
params = params ?? {}
336+
for (const key in params) {
337+
if (acceptedPath.includes(key)) {
338+
continue
339+
} else if (key !== 'body' && key !== 'querystring') {
340+
querystring[key] = params[key]
341+
}
342+
}
343+
344+
const method = 'GET'
345+
const path = `/_query/queries/${encodeURIComponent(params.id.toString())}`
346+
const meta: TransportRequestMetadata = {
347+
name: 'esql.get_query',
348+
pathParts: {
349+
id: params.id
350+
}
351+
}
352+
return await this.transport.request({ path, method, querystring, body, meta }, options)
353+
}
354+
355+
/**
356+
* Executes a list ESQL queries request
357+
*/
358+
async listQueries (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
359+
async listQueries (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
360+
async listQueries (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
361+
async listQueries (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
362+
const {
363+
path: acceptedPath
364+
} = this.acceptedParams['esql.list_queries']
365+
366+
const userQuery = params?.querystring
367+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
368+
369+
let body: Record<string, any> | string | undefined
370+
const userBody = params?.body
371+
if (userBody != null) {
372+
if (typeof userBody === 'string') {
373+
body = userBody
374+
} else {
375+
body = { ...userBody }
376+
}
377+
}
378+
379+
params = params ?? {}
380+
for (const key in params) {
381+
if (acceptedPath.includes(key)) {
382+
continue
383+
} else if (key !== 'body' && key !== 'querystring') {
384+
querystring[key] = params[key]
385+
}
386+
}
387+
388+
const method = 'GET'
389+
const path = '/_query/queries'
390+
const meta: TransportRequestMetadata = {
391+
name: 'esql.list_queries'
392+
}
393+
return await this.transport.request({ path, method, querystring, body, meta }, options)
394+
}
395+
299396
/**
300397
* Run an ES|QL query. Get search results for an ES|QL (Elasticsearch query language) query.
301-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-rest.html | Elasticsearch API documentation}
398+
* @see {@link https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql-rest | Elasticsearch API documentation}
302399
*/
303400
async query (this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlQueryResponse>
304401
async query (this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlQueryResponse, unknown>>

src/api/api/indices.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ export default class Indices {
995995

996996
/**
997997
* Cancel a migration reindex operation. Cancel a migration reindex attempt for a data stream or index.
998-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/migrate-data-stream.html | Elasticsearch API documentation}
998+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-cancel-migrate-reindex | Elasticsearch API documentation}
999999
*/
10001000
async cancelMigrateReindex (this: That, params: T.IndicesCancelMigrateReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesCancelMigrateReindexResponse>
10011001
async cancelMigrateReindex (this: That, params: T.IndicesCancelMigrateReindexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesCancelMigrateReindexResponse, unknown>>
@@ -1298,7 +1298,7 @@ export default class Indices {
12981298

12991299
/**
13001300
* Create an index from a source index. Copy the mappings and settings from the source index to a destination index while allowing request settings and mappings to override the source values.
1301-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/migrate-data-stream.html | Elasticsearch API documentation}
1301+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create-from | Elasticsearch API documentation}
13021302
*/
13031303
async createFrom (this: That, params: T.IndicesCreateFromRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesCreateFromResponse>
13041304
async createFrom (this: That, params: T.IndicesCreateFromRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesCreateFromResponse, unknown>>
@@ -2649,7 +2649,7 @@ export default class Indices {
26492649

26502650
/**
26512651
* Get the migration reindexing status. Get the status of a migration reindex attempt for a data stream or index.
2652-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/migrate-data-stream.html | Elasticsearch API documentation}
2652+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-migration | Elasticsearch API documentation}
26532653
*/
26542654
async getMigrateReindexStatus (this: That, params: T.IndicesGetMigrateReindexStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetMigrateReindexStatusResponse>
26552655
async getMigrateReindexStatus (this: That, params: T.IndicesGetMigrateReindexStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetMigrateReindexStatusResponse, unknown>>
@@ -2807,7 +2807,7 @@ export default class Indices {
28072807

28082808
/**
28092809
* Reindex legacy backing indices. Reindex all legacy backing indices for a data stream. This operation occurs in a persistent task. The persistent task ID is returned immediately and the reindexing work is completed in that task.
2810-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/migrate-data-stream.html | Elasticsearch API documentation}
2810+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-migrate-reindex | Elasticsearch API documentation}
28112811
*/
28122812
async migrateReindex (this: That, params: T.IndicesMigrateReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesMigrateReindexResponse>
28132813
async migrateReindex (this: That, params: T.IndicesMigrateReindexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesMigrateReindexResponse, unknown>>

src/api/api/inference.ts

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@ export default class Inference {
7777
body: [],
7878
query: []
7979
},
80+
'inference.inference': {
81+
path: [
82+
'task_type',
83+
'inference_id'
84+
],
85+
body: [
86+
'query',
87+
'input',
88+
'task_settings'
89+
],
90+
query: [
91+
'timeout'
92+
]
93+
},
8094
'inference.put': {
8195
path: [
8296
'task_type',
@@ -563,6 +577,71 @@ export default class Inference {
563577
return await this.transport.request({ path, method, querystring, body, meta }, options)
564578
}
565579

580+
/**
581+
* Perform inference on the service. This API enables you to use machine learning models to perform specific tasks on data that you provide as an input. It returns a response with the results of the tasks. The inference endpoint you use can perform one specific task that has been defined when the endpoint was created with the create inference API. For details about using this API with a service, such as Amazon Bedrock, Anthropic, or HuggingFace, refer to the service-specific documentation. > info > The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, 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.
582+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference | Elasticsearch API documentation}
583+
*/
584+
async inference (this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceInferenceResponse>
585+
async inference (this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceInferenceResponse, unknown>>
586+
async inference (this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptions): Promise<T.InferenceInferenceResponse>
587+
async inference (this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptions): Promise<any> {
588+
const {
589+
path: acceptedPath,
590+
body: acceptedBody,
591+
query: acceptedQuery
592+
} = this.acceptedParams['inference.inference']
593+
594+
const userQuery = params?.querystring
595+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
596+
597+
let body: Record<string, any> | string | undefined
598+
const userBody = params?.body
599+
if (userBody != null) {
600+
if (typeof userBody === 'string') {
601+
body = userBody
602+
} else {
603+
body = { ...userBody }
604+
}
605+
}
606+
607+
for (const key in params) {
608+
if (acceptedBody.includes(key)) {
609+
body = body ?? {}
610+
// @ts-expect-error
611+
body[key] = params[key]
612+
} else if (acceptedPath.includes(key)) {
613+
continue
614+
} else if (key !== 'body' && key !== 'querystring') {
615+
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
616+
// @ts-expect-error
617+
querystring[key] = params[key]
618+
} else {
619+
body = body ?? {}
620+
// @ts-expect-error
621+
body[key] = params[key]
622+
}
623+
}
624+
}
625+
626+
let method = ''
627+
let path = ''
628+
if (params.task_type != null && params.inference_id != null) {
629+
method = 'POST'
630+
path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}`
631+
} else {
632+
method = 'POST'
633+
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
634+
}
635+
const meta: TransportRequestMetadata = {
636+
name: 'inference.inference',
637+
pathParts: {
638+
task_type: params.task_type,
639+
inference_id: params.inference_id
640+
}
641+
}
642+
return await this.transport.request({ path, method, querystring, body, meta }, options)
643+
}
644+
566645
/**
567646
* Create an inference endpoint. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. 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. 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.
568647
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put | Elasticsearch API documentation}

src/api/api/ingest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export default class Ingest {
296296

297297
/**
298298
* Get GeoIP statistics. Get download statistics for GeoIP2 databases that are used with the GeoIP processor.
299-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-processor.html | Elasticsearch API documentation}
299+
* @see {@link https://www.elastic.co/docs/reference/enrich-processor/geoip-processor | Elasticsearch API documentation}
300300
*/
301301
async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestGeoIpStatsResponse>
302302
async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestGeoIpStatsResponse, unknown>>
@@ -498,7 +498,7 @@ export default class Ingest {
498498

499499
/**
500500
* Run a grok processor. Extract structured fields out of a single text field within a document. You must choose which field to extract matched fields from, as well as the grok pattern you expect will match. A grok pattern is like a regular expression that supports aliased expressions that can be reused.
501-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html | Elasticsearch API documentation}
501+
* @see {@link https://www.elastic.co/docs/reference/enrich-processor/grok-processor | Elasticsearch API documentation}
502502
*/
503503
async processorGrok (this: That, params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestProcessorGrokResponse>
504504
async processorGrok (this: That, params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestProcessorGrokResponse, unknown>>
@@ -645,7 +645,7 @@ export default class Ingest {
645645

646646
/**
647647
* Create or update a pipeline. Changes made using this API take effect immediately.
648-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html | Elasticsearch API documentation}
648+
* @see {@link https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines | Elasticsearch API documentation}
649649
*/
650650
async putPipeline (this: That, params: T.IngestPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestPutPipelineResponse>
651651
async putPipeline (this: That, params: T.IngestPutPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestPutPipelineResponse, unknown>>

0 commit comments

Comments
 (0)