Skip to content

Commit 211fa2a

Browse files
Auto-generated API code (#3039)
Co-authored-by: Josh Mock <[email protected]>
1 parent 91a3653 commit 211fa2a

File tree

7 files changed

+443
-94
lines changed

7 files changed

+443
-94
lines changed

docs/reference/api-reference.md

Lines changed: 83 additions & 47 deletions
Large diffs are not rendered by default.

src/api/api/indices.ts

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,20 @@ export default class Indices {
493493
body: [],
494494
query: []
495495
},
496+
'indices.get_sample': {
497+
path: [
498+
'index'
499+
],
500+
body: [],
501+
query: []
502+
},
503+
'indices.get_sample_stats': {
504+
path: [
505+
'index'
506+
],
507+
body: [],
508+
query: []
509+
},
496510
'indices.get_settings': {
497511
path: [
498512
'index',
@@ -686,6 +700,13 @@ export default class Indices {
686700
'write_index_only'
687701
]
688702
},
703+
'indices.put_sample_configuration': {
704+
path: [
705+
'index'
706+
],
707+
body: [],
708+
query: []
709+
},
689710
'indices.put_settings': {
690711
path: [
691712
'index'
@@ -3124,6 +3145,102 @@ export default class Indices {
31243145
return await this.transport.request({ path, method, querystring, body, meta }, options)
31253146
}
31263147

3148+
/**
3149+
* Get random sample of ingested data
3150+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-sample | Elasticsearch API documentation}
3151+
*/
3152+
async getSample (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
3153+
async getSample (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
3154+
async getSample (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
3155+
async getSample (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
3156+
const {
3157+
path: acceptedPath
3158+
} = this[kAcceptedParams]['indices.get_sample']
3159+
3160+
const userQuery = params?.querystring
3161+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
3162+
3163+
let body: Record<string, any> | string | undefined
3164+
const userBody = params?.body
3165+
if (userBody != null) {
3166+
if (typeof userBody === 'string') {
3167+
body = userBody
3168+
} else {
3169+
body = { ...userBody }
3170+
}
3171+
}
3172+
3173+
params = params ?? {}
3174+
for (const key in params) {
3175+
if (acceptedPath.includes(key)) {
3176+
continue
3177+
} else if (key !== 'body' && key !== 'querystring') {
3178+
querystring[key] = params[key]
3179+
}
3180+
}
3181+
3182+
const method = 'GET'
3183+
const path = `/${encodeURIComponent(params.index.toString())}/_sample`
3184+
const meta: TransportRequestMetadata = {
3185+
name: 'indices.get_sample',
3186+
pathParts: {
3187+
index: params.index
3188+
},
3189+
acceptedParams: [
3190+
'index'
3191+
]
3192+
}
3193+
return await this.transport.request({ path, method, querystring, body, meta }, options)
3194+
}
3195+
3196+
/**
3197+
* Get stats about a random sample of ingested data
3198+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-sample | Elasticsearch API documentation}
3199+
*/
3200+
async getSampleStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
3201+
async getSampleStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
3202+
async getSampleStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
3203+
async getSampleStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
3204+
const {
3205+
path: acceptedPath
3206+
} = this[kAcceptedParams]['indices.get_sample_stats']
3207+
3208+
const userQuery = params?.querystring
3209+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
3210+
3211+
let body: Record<string, any> | string | undefined
3212+
const userBody = params?.body
3213+
if (userBody != null) {
3214+
if (typeof userBody === 'string') {
3215+
body = userBody
3216+
} else {
3217+
body = { ...userBody }
3218+
}
3219+
}
3220+
3221+
params = params ?? {}
3222+
for (const key in params) {
3223+
if (acceptedPath.includes(key)) {
3224+
continue
3225+
} else if (key !== 'body' && key !== 'querystring') {
3226+
querystring[key] = params[key]
3227+
}
3228+
}
3229+
3230+
const method = 'GET'
3231+
const path = `/${encodeURIComponent(params.index.toString())}/_sample/stats`
3232+
const meta: TransportRequestMetadata = {
3233+
name: 'indices.get_sample_stats',
3234+
pathParts: {
3235+
index: params.index
3236+
},
3237+
acceptedParams: [
3238+
'index'
3239+
]
3240+
}
3241+
return await this.transport.request({ path, method, querystring, body, meta }, options)
3242+
}
3243+
31273244
/**
31283245
* Get index settings. Get setting information for one or more indices. For data streams, it returns setting information for the stream's backing indices.
31293246
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-settings | Elasticsearch API documentation}
@@ -3975,6 +4092,54 @@ export default class Indices {
39754092
return await this.transport.request({ path, method, querystring, body, meta }, options)
39764093
}
39774094

4095+
/**
4096+
* Configure sampling for an index or data stream
4097+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-sample-configuration | Elasticsearch API documentation}
4098+
*/
4099+
async putSampleConfiguration (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
4100+
async putSampleConfiguration (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
4101+
async putSampleConfiguration (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
4102+
async putSampleConfiguration (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
4103+
const {
4104+
path: acceptedPath
4105+
} = this[kAcceptedParams]['indices.put_sample_configuration']
4106+
4107+
const userQuery = params?.querystring
4108+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
4109+
4110+
let body: Record<string, any> | string | undefined
4111+
const userBody = params?.body
4112+
if (userBody != null) {
4113+
if (typeof userBody === 'string') {
4114+
body = userBody
4115+
} else {
4116+
body = { ...userBody }
4117+
}
4118+
}
4119+
4120+
params = params ?? {}
4121+
for (const key in params) {
4122+
if (acceptedPath.includes(key)) {
4123+
continue
4124+
} else if (key !== 'body' && key !== 'querystring') {
4125+
querystring[key] = params[key]
4126+
}
4127+
}
4128+
4129+
const method = 'PUT'
4130+
const path = `/${encodeURIComponent(params.index.toString())}/_sample/config`
4131+
const meta: TransportRequestMetadata = {
4132+
name: 'indices.put_sample_configuration',
4133+
pathParts: {
4134+
index: params.index
4135+
},
4136+
acceptedParams: [
4137+
'index'
4138+
]
4139+
}
4140+
return await this.transport.request({ path, method, querystring, body, meta }, options)
4141+
}
4142+
39784143
/**
39794144
* Update index settings. Changes dynamic index settings in real time. For data streams, index setting changes are applied to all backing indices by default. To revert a setting to the default value, use a null value. The list of per-index settings that can be updated dynamically on live indices can be found in index settings documentation. To preserve existing settings from being updated, set the `preserve_existing` parameter to `true`. For performance optimization during bulk indexing, you can disable the refresh interval. Refer to [disable refresh interval](https://www.elastic.co/docs/deploy-manage/production-guidance/optimize-performance/indexing-speed#disable-refresh-interval) for an example. There are multiple valid ways to represent index settings in the request body. You can specify only the setting, for example: ``` { "number_of_replicas": 1 } ``` Or you can use an `index` setting object: ``` { "index": { "number_of_replicas": 1 } } ``` Or you can use dot annotation: ``` { "index.number_of_replicas": 1 } ``` Or you can embed any of the aforementioned options in a `settings` object. For example: ``` { "settings": { "index": { "number_of_replicas": 1 } } } ``` NOTE: You can only define new analyzers on closed indices. To add an analyzer, you must close the index, define the analyzer, and reopen the index. You cannot close the write index of a data stream. To update the analyzer for a data stream's write index and future backing indices, update the analyzer in the index template used by the stream. Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices. This affects searches and any new data added to the stream after the rollover. However, it does not affect the data stream's backing indices or their existing data. To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it. Refer to [updating analyzers on existing indices](https://www.elastic.co/docs/manage-data/data-store/text-analysis/specify-an-analyzer#update-analyzers-on-existing-indices) for step-by-step examples.
39804145
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings | Elasticsearch API documentation}

src/api/api/inference.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ export default class Inference {
431431
body: [
432432
'query',
433433
'input',
434+
'return_documents',
435+
'top_n',
434436
'task_settings'
435437
],
436438
query: [
@@ -488,7 +490,7 @@ export default class Inference {
488490
}
489491

490492
/**
491-
* Perform chat completion inference The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. It only works with the `chat_completion` task type for `openai` and `elastic` inference services. NOTE: The `chat_completion` task type is only available within the _stream API and only supports streaming. The Chat completion inference API and the Stream inference API differ in their response structure and capabilities. The Chat completion inference API provides more comprehensive customization options through more fields and function calling support. If you use the `openai`, `hugging_face` or the `elastic` service, use the Chat completion inference API.
493+
* Perform chat completion inference on the service The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. It only works with the `chat_completion` task type for `openai` and `elastic` inference services. NOTE: The `chat_completion` task type is only available within the _stream API and only supports streaming. The Chat completion inference API and the Stream inference API differ in their response structure and capabilities. The Chat completion inference API provides more comprehensive customization options through more fields and function calling support. If you use the `openai`, `hugging_face` or the `elastic` service, use the Chat completion inference API.
492494
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference | Elasticsearch API documentation}
493495
*/
494496
async chatCompletionUnified (this: That, params: T.InferenceChatCompletionUnifiedRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceChatCompletionUnifiedResponse>
@@ -540,7 +542,7 @@ export default class Inference {
540542
}
541543

542544
/**
543-
* Perform completion inference on the service
545+
* Perform completion inference on the service Get responses for completion tasks. This API works only with the completion task type. 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, 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. This API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege).
544546
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference | Elasticsearch API documentation}
545547
*/
546548
async completion (this: That, params: T.InferenceCompletionRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceCompletionResponse>
@@ -2378,6 +2380,8 @@ export default class Inference {
23782380
'inference_id',
23792381
'query',
23802382
'input',
2383+
'return_documents',
2384+
'top_n',
23812385
'task_settings',
23822386
'timeout'
23832387
]
@@ -2449,7 +2453,7 @@ export default class Inference {
24492453
}
24502454

24512455
/**
2452-
* Perform streaming inference. Get real-time responses for completion tasks by delivering answers incrementally, reducing response times during computation. This API works only with the completion task type. 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, 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. This API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege). You must use a client that supports streaming.
2456+
* Perform streaming completion inference on the service Get real-time responses for completion tasks by delivering answers incrementally, reducing response times during computation. This API works only with the completion task type. 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, 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. This API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege). You must use a client that supports streaming.
24532457
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-stream-inference | Elasticsearch API documentation}
24542458
*/
24552459
async streamCompletion (this: That, params: T.InferenceStreamCompletionRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceStreamCompletionResponse>

src/api/api/project.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export default class Project {
4343
}
4444

4545
/**
46-
* Return tags defined for the project
46+
* Get tags. Get the tags that are defined for the project.
47+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-project-tags | Elasticsearch API documentation}
4748
*/
4849
async tags (this: That, params?: T.ProjectTagsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ProjectTagsResponse>
4950
async tags (this: That, params?: T.ProjectTagsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ProjectTagsResponse, unknown>>

src/api/api/reindex.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
3636
'dest',
3737
'max_docs',
3838
'script',
39-
'size',
4039
'source'
4140
],
4241
query: [
@@ -108,7 +107,6 @@ export default async function ReindexApi (this: That, params: T.ReindexRequest,
108107
'dest',
109108
'max_docs',
110109
'script',
111-
'size',
112110
'source',
113111
'refresh',
114112
'requests_per_second',

src/api/api/security.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ export default class Security {
148148
'access',
149149
'expiration',
150150
'metadata',
151-
'name'
151+
'name',
152+
'certificate_identity'
152153
],
153154
query: []
154155
},
@@ -636,7 +637,8 @@ export default class Security {
636637
body: [
637638
'access',
638639
'expiration',
639-
'metadata'
640+
'metadata',
641+
'certificate_identity'
640642
],
641643
query: []
642644
},
@@ -1382,7 +1384,8 @@ export default class Security {
13821384
'access',
13831385
'expiration',
13841386
'metadata',
1385-
'name'
1387+
'name',
1388+
'certificate_identity'
13861389
]
13871390
}
13881391
return await this.transport.request({ path, method, querystring, body, meta }, options)
@@ -4198,7 +4201,8 @@ export default class Security {
41984201
'id',
41994202
'access',
42004203
'expiration',
4201-
'metadata'
4204+
'metadata',
4205+
'certificate_identity'
42024206
]
42034207
}
42044208
return await this.transport.request({ path, method, querystring, body, meta }, options)

0 commit comments

Comments
 (0)