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
213 changes: 11 additions & 202 deletions docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2495,101 +2495,6 @@ A partial reduction is performed every time the coordinating node has received a
** *`_source_includes` (Optional, string | string[])*: A list of fields to extract and return from the _source field
** *`q` (Optional, string)*: Query in the Lucene query string syntax

[discrete]
=== autoscaling
[discrete]
==== delete_autoscaling_policy
Delete an autoscaling policy.

NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.

{ref}/autoscaling-delete-autoscaling-policy.html[Endpoint documentation]
[source,ts]
----
client.autoscaling.deleteAutoscalingPolicy({ name })
----

[discrete]
==== Arguments

* *Request (object):*
** *`name` (string)*: the name of the autoscaling policy
** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error.
** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
==== get_autoscaling_capacity
Get the autoscaling capacity.

NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.

This API gets the current autoscaling capacity based on the configured autoscaling policy.
It will return information to size the cluster appropriately to the current workload.

The `required_capacity` is calculated as the maximum of the `required_capacity` result of all individual deciders that are enabled for the policy.

The operator should verify that the `current_nodes` match the operator’s knowledge of the cluster to avoid making autoscaling decisions based on stale or incomplete information.

The response contains decider-specific information you can use to diagnose how and why autoscaling determined a certain capacity was required.
This information is provided for diagnosis only.
Do not use this information to make autoscaling decisions.

{ref}/autoscaling-get-autoscaling-capacity.html[Endpoint documentation]
[source,ts]
----
client.autoscaling.getAutoscalingCapacity({ ... })
----

[discrete]
==== Arguments

* *Request (object):*
** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
==== get_autoscaling_policy
Get an autoscaling policy.

NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.

{ref}/autoscaling-get-autoscaling-capacity.html[Endpoint documentation]
[source,ts]
----
client.autoscaling.getAutoscalingPolicy({ name })
----

[discrete]
==== Arguments

* *Request (object):*
** *`name` (string)*: the name of the autoscaling policy
** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
==== put_autoscaling_policy
Create or update an autoscaling policy.

NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.

{ref}/autoscaling-put-autoscaling-policy.html[Endpoint documentation]
[source,ts]
----
client.autoscaling.putAutoscalingPolicy({ name })
----

[discrete]
==== Arguments

* *Request (object):*
** *`name` (string)*: the name of the autoscaling policy
** *`policy` (Optional, { roles, deciders })*
** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error.
** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
=== cat
[discrete]
Expand Down Expand Up @@ -7836,6 +7741,7 @@ client.indices.simulateIndexTemplate({ name })

* *Request (object):*
** *`name` (string)*: Name of the index to simulate
** *`index_template` (Optional, { index_patterns, composed_of, template, version, priority, _meta, allow_auto_create, data_stream, deprecated, ignore_missing_component_templates })*
** *`create` (Optional, boolean)*: Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
** *`cause` (Optional, string)*: User defined reason for dry-run creating the new template for simulation purposes
** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
Expand Down Expand Up @@ -8922,6 +8828,16 @@ client.inference.textEmbedding({ inference_id, input })
** *`inference_id` (string)*: The inference Id
** *`input` (string | string[])*: Inference input.
Either a string or an array of strings.
** *`input_type` (Optional, string)*: The input data type for the text embedding model. Possible values include:
* `SEARCH`
* `INGEST`
* `CLASSIFICATION`
* `CLUSTERING`
Not all services support all values. Unsupported values will trigger a validation exception.
Accepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.

> info
> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`.
** *`task_settings` (Optional, User-defined value)*: Optional task settings
** *`timeout` (Optional, string | -1 | 0)*: Specifies the amount of time to wait for the inference request to complete.

Expand Down Expand Up @@ -14329,113 +14245,6 @@ visible to search.
If 'wait_for', it waits for a refresh to make this operation visible to search.
If 'false', nothing is done with refreshes.

[discrete]
=== shutdown
[discrete]
==== delete_node
Cancel node shutdown preparations.
Remove a node from the shutdown list so it can resume normal operations.
You must explicitly clear the shutdown request when a node rejoins the cluster or when a node has permanently left the cluster.
Shutdown requests are never removed automatically by Elasticsearch.

NOTE: This feature is designed for indirect use by Elastic Cloud, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes.
Direct use is not supported.

If the operator privileges feature is enabled, you must be an operator to use this API.

{ref}/delete-shutdown.html[Endpoint documentation]
[source,ts]
----
client.shutdown.deleteNode({ node_id })
----

[discrete]
==== Arguments

* *Request (object):*
** *`node_id` (string)*: The node id of node to be removed from the shutdown state
** *`master_timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
** *`timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
==== get_node
Get the shutdown status.

Get information about nodes that are ready to be shut down, have shut down preparations still in progress, or have stalled.
The API returns status information for each part of the shut down process.

NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.

If the operator privileges feature is enabled, you must be an operator to use this API.

{ref}/get-shutdown.html[Endpoint documentation]
[source,ts]
----
client.shutdown.getNode({ ... })
----

[discrete]
==== Arguments

* *Request (object):*
** *`node_id` (Optional, string | string[])*: Which node for which to retrieve the shutdown status
** *`master_timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
==== put_node
Prepare a node to be shut down.

NOTE: This feature is designed for indirect use by Elastic Cloud, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.

If you specify a node that is offline, it will be prepared for shut down when it rejoins the cluster.

If the operator privileges feature is enabled, you must be an operator to use this API.

The API migrates ongoing tasks and index shards to other nodes as needed to prepare a node to be restarted or shut down and removed from the cluster.
This ensures that Elasticsearch can be stopped safely with minimal disruption to the cluster.

You must specify the type of shutdown: `restart`, `remove`, or `replace`.
If a node is already being prepared for shutdown, you can use this API to change the shutdown type.

IMPORTANT: This API does NOT terminate the Elasticsearch process.
Monitor the node shutdown status to determine when it is safe to stop Elasticsearch.

{ref}/put-shutdown.html[Endpoint documentation]
[source,ts]
----
client.shutdown.putNode({ node_id, type, reason })
----

[discrete]
==== Arguments

* *Request (object):*
** *`node_id` (string)*: The node identifier.
This parameter is not validated against the cluster's active nodes.
This enables you to register a node for shut down while it is offline.
No error is thrown if you specify an invalid node ID.
** *`type` (Enum("restart" | "remove" | "replace"))*: Valid values are restart, remove, or replace.
Use restart when you need to temporarily shut down a node to perform an upgrade, make configuration changes, or perform other maintenance.
Because the node is expected to rejoin the cluster, data is not migrated off of the node.
Use remove when you need to permanently remove a node from the cluster.
The node is not marked ready for shutdown until data is migrated off of the node Use replace to do a 1:1 replacement of a node with another node.
Certain allocation decisions will be ignored (such as disk watermarks) in the interest of true replacement of the source node with the target node.
During a replace-type shutdown, rollover and index creation may result in unassigned shards, and shrink may fail until the replacement is complete.
** *`reason` (string)*: A human-readable reason that the node is being shut down.
This field provides information for other cluster operators; it does not affect the shut down process.
** *`allocation_delay` (Optional, string)*: Only valid if type is restart.
Controls how long Elasticsearch will wait for the node to restart and join the cluster before reassigning its shards to other nodes.
This works the same as delaying allocation with the index.unassigned.node_left.delayed_timeout setting.
If you specify both a restart allocation delay and an index-level allocation delay, the longer of the two is used.
** *`target_node_name` (Optional, string)*: Only valid if type is replace.
Specifies the name of the node that is replacing the node being shut down.
Shards from the shut down node are only allowed to be allocated to the target node, and no other data will be allocated to the target node.
During relocation of data certain allocation rules are ignored, such as disk watermarks or user attribute filtering rules.
** *`master_timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error.
** *`timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
=== simulate
[discrete]
Expand Down
9 changes: 7 additions & 2 deletions src/api/api/indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2375,11 +2375,16 @@ export default class Indices {
async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): Promise<T.IndicesSimulateIndexTemplateResponse>
async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['index_template']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
let body: any = params.body ?? undefined

for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
// @ts-expect-error
body = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
Expand Down
2 changes: 1 addition & 1 deletion src/api/api/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ export default class Inference {
async textEmbedding (this: That, params: T.InferenceTextEmbeddingRequest | TB.InferenceTextEmbeddingRequest, options?: TransportRequestOptions): Promise<T.InferenceTextEmbeddingResponse>
async textEmbedding (this: That, params: T.InferenceTextEmbeddingRequest | TB.InferenceTextEmbeddingRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['inference_id']
const acceptedBody: string[] = ['input', 'task_settings']
const acceptedBody: string[] = ['input', 'input_type', 'task_settings']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
Expand Down
2 changes: 2 additions & 0 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13037,6 +13037,7 @@ export interface IndicesSimulateIndexTemplateRequest extends RequestBase {
cause?: string
master_timeout?: Duration
include_defaults?: boolean
index_template?: IndicesIndexTemplate
}

export interface IndicesSimulateIndexTemplateResponse {
Expand Down Expand Up @@ -14255,6 +14256,7 @@ export interface InferenceTextEmbeddingRequest extends RequestBase {
inference_id: Id
timeout?: Duration
input: string | string[]
input_type?: string
task_settings?: InferenceTaskSettings
}

Expand Down
3 changes: 3 additions & 0 deletions src/api/typesWithBodyKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13267,6 +13267,8 @@ export interface IndicesSimulateIndexTemplateRequest extends RequestBase {
cause?: string
master_timeout?: Duration
include_defaults?: boolean
/** @deprecated The use of the 'body' key has been deprecated, use 'index_template' instead. */
body?: IndicesIndexTemplate
}

export interface IndicesSimulateIndexTemplateResponse {
Expand Down Expand Up @@ -14573,6 +14575,7 @@ export interface InferenceTextEmbeddingRequest extends RequestBase {
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
body?: {
input: string | string[]
input_type?: string
task_settings?: InferenceTaskSettings
}
}
Expand Down
Loading