Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 106 additions & 60 deletions docs/reference/api-reference.md

Large diffs are not rendered by default.

126 changes: 118 additions & 8 deletions src/api/api/indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@ export default class Indices {
'verbose'
]
},
'indices.get_data_stream_mappings': {
path: [
'name'
],
body: [],
query: []
},
'indices.get_data_stream_options': {
path: [
'name'
Expand Down Expand Up @@ -589,6 +596,13 @@ export default class Indices {
'timeout'
]
},
'indices.put_data_stream_mappings': {
path: [
'name'
],
body: [],
query: []
},
'indices.put_data_stream_options': {
path: [
'name'
Expand Down Expand Up @@ -739,7 +753,13 @@ export default class Indices {
'block'
],
body: [],
query: []
query: [
'allow_no_indices',
'expand_wildcards',
'ignore_unavailable',
'master_timeout',
'timeout'
]
},
'indices.resolve_cluster': {
path: [
Expand Down Expand Up @@ -2486,6 +2506,51 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Gets a data stream's mappings
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation}
*/
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath
} = this.acceptedParams['indices.get_data_stream_mappings']

const userQuery = params?.querystring
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}

let body: Record<string, any> | string | undefined
const userBody = params?.body
if (userBody != null) {
if (typeof userBody === 'string') {
body = userBody
} else {
body = { ...userBody }
}
}

params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
querystring[key] = params[key]
}
}

const method = 'GET'
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_mappings`
const meta: TransportRequestMetadata = {
name: 'indices.get_data_stream_mappings',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Get data stream options. Get the data stream options configuration of one or more data streams.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
Expand Down Expand Up @@ -3248,6 +3313,51 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Updates a data stream's mappings
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation}
*/
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath
} = this.acceptedParams['indices.put_data_stream_mappings']

const userQuery = params?.querystring
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}

let body: Record<string, any> | string | undefined
const userBody = params?.body
if (userBody != null) {
if (typeof userBody === 'string') {
body = userBody
} else {
body = { ...userBody }
}
}

params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
querystring[key] = params[key]
}
}

const method = 'PUT'
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_mappings`
const meta: TransportRequestMetadata = {
name: 'indices.put_data_stream_mappings',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Update data stream options. Update the data stream options of the specified data streams.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
Expand Down Expand Up @@ -3729,13 +3839,13 @@ export default class Indices {
}

/**
* Removes a block from an index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html | Elasticsearch API documentation}
* 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.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-remove-block | Elasticsearch API documentation}
*/
async removeBlock (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async removeBlock (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async removeBlock (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async removeBlock (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
async removeBlock (this: That, params: T.IndicesRemoveBlockRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesRemoveBlockResponse>
async removeBlock (this: That, params: T.IndicesRemoveBlockRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesRemoveBlockResponse, unknown>>
async removeBlock (this: That, params: T.IndicesRemoveBlockRequest, options?: TransportRequestOptions): Promise<T.IndicesRemoveBlockResponse>
async removeBlock (this: That, params: T.IndicesRemoveBlockRequest, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath
} = this.acceptedParams['indices.remove_block']
Expand All @@ -3753,11 +3863,11 @@ export default class Indices {
}
}

params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
// @ts-expect-error
querystring[key] = params[key]
}
}
Expand Down
126 changes: 125 additions & 1 deletion src/api/api/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ export default class Inference {
],
query: []
},
'inference.put_amazonsagemaker': {
path: [
'task_type',
'amazonsagemaker_inference_id'
],
body: [],
query: []
},
'inference.put_anthropic': {
path: [
'task_type',
Expand Down Expand Up @@ -179,6 +187,18 @@ export default class Inference {
],
query: []
},
'inference.put_deepseek': {
path: [
'task_type',
'deepseek_inference_id'
],
body: [
'chunking_settings',
'service',
'service_settings'
],
query: []
},
'inference.put_elasticsearch': {
path: [
'task_type',
Expand Down Expand Up @@ -644,7 +664,7 @@ export default class Inference {
}

/**
* 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`)
* 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`)
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put | Elasticsearch API documentation}
*/
async put (this: That, params: T.InferencePutRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutResponse>
Expand Down Expand Up @@ -814,6 +834,52 @@ export default class Inference {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Configure a Amazon SageMaker inference endpoint
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-service-amazon-sagemaker.html | Elasticsearch API documentation}
*/
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async putAmazonsagemaker (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath
} = this.acceptedParams['inference.put_amazonsagemaker']

const userQuery = params?.querystring
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}

let body: Record<string, any> | string | undefined
const userBody = params?.body
if (userBody != null) {
if (typeof userBody === 'string') {
body = userBody
} else {
body = { ...userBody }
}
}

params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
querystring[key] = params[key]
}
}

const method = 'PUT'
const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.amazonsagemaker_inference_id.toString())}`
const meta: TransportRequestMetadata = {
name: 'inference.put_amazonsagemaker',
pathParts: {
task_type: params.task_type,
amazonsagemaker_inference_id: params.amazonsagemaker_inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Create an Anthropic inference endpoint. Create an inference endpoint to perform an inference task with the `anthropic` service.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-anthropic | Elasticsearch API documentation}
Expand Down Expand Up @@ -1046,6 +1112,64 @@ export default class Inference {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Create a DeepSeek inference endpoint. Create an inference endpoint to perform an inference task with the `deepseek` service.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-deepseek | Elasticsearch API documentation}
*/
async putDeepseek (this: That, params: T.InferencePutDeepseekRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutDeepseekResponse>
async putDeepseek (this: That, params: T.InferencePutDeepseekRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutDeepseekResponse, unknown>>
async putDeepseek (this: That, params: T.InferencePutDeepseekRequest, options?: TransportRequestOptions): Promise<T.InferencePutDeepseekResponse>
async putDeepseek (this: That, params: T.InferencePutDeepseekRequest, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath,
body: acceptedBody,
query: acceptedQuery
} = this.acceptedParams['inference.put_deepseek']

const userQuery = params?.querystring
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}

let body: Record<string, any> | string | undefined
const userBody = params?.body
if (userBody != null) {
if (typeof userBody === 'string') {
body = userBody
} else {
body = { ...userBody }
}
}

for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
// @ts-expect-error
querystring[key] = params[key]
} else {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
}
}
}

const method = 'PUT'
const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.deepseek_inference_id.toString())}`
const meta: TransportRequestMetadata = {
name: 'inference.put_deepseek',
pathParts: {
task_type: params.task_type,
deepseek_inference_id: params.deepseek_inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* 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.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elasticsearch | Elasticsearch API documentation}
Expand Down
Loading
Loading