Skip to content

Commit 4d3c7db

Browse files
Auto-generated API code (#3253)
1 parent 5f60a7a commit 4d3c7db

9 files changed

Lines changed: 85 additions & 31 deletions

File tree

docs/reference/api-reference.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ client.index({ index })
10301030
Get cluster info.
10311031

10321032
Get basic build, version, and cluster information.
1033-
::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.
1033+
::: In Serverless, `version.number` always reports the next target Elasticsearch release version at the time of the request. Serverless does not track to a traditional release versioning model; it is continuously updated. The version number is provided to maintain compatibility with existing clients, but it is not meaningful for assessing feature availability. Clients should detect a Serverless environment by checking for `build_flavor: serverless`.
10341034

10351035
[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-info)
10361036

@@ -1331,7 +1331,7 @@ If the Elasticsearch security features are enabled, you must have the following
13311331
* If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias.
13321332

13331333
If reindexing from a remote cluster into a cluster using Elastic Stack, you must explicitly allow the remote host using the `reindex.remote.whitelist` node setting on the destination cluster.
1334-
If reindexing from a remote cluster into an Elastic Cloud Serverless project, only remote hosts from Elastic Cloud Hosted are allowed.
1334+
If reindexing from a remote cluster into an Elastic Cloud Serverless project, only remote hosts from [Elastic Cloud Hosted](https://cloud.elastic.co/registration?page=docs&placement=docs-body) are allowed.
13351335
Automatic data stream creation requires a matching index template with data stream enabled.
13361336

13371337
The `dest` element can be configured like the index API to control optimistic concurrency control.
@@ -4783,6 +4783,22 @@ A query ID is also provided when the request was submitted with the `keep_on_com
47834783
- **`drop_null_columns` (Optional, boolean)**: Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.
47844784
If `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns.
47854785

4786+
## client.esql.deleteView [_esql.delete_view]
4787+
Delete an ES|QL view.
4788+
4789+
Deletes a stored ES|QL view.
4790+
4791+
[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch#TODO)
4792+
4793+
```ts
4794+
client.esql.deleteView({ name })
4795+
```
4796+
4797+
### Arguments [_arguments_esql.delete_view]
4798+
4799+
#### Request (object) [_request_esql.delete_view]
4800+
- **`name` (string)**: The view name to remove.
4801+
47864802
## client.esql.getQuery [_esql.get_query]
47874803
Get a specific running ES|QL query information.
47884804

@@ -4799,6 +4815,22 @@ client.esql.getQuery({ id })
47994815
#### Request (object) [_request_esql.get_query]
48004816
- **`id` (string)**: The query ID
48014817

4818+
## client.esql.getView [_esql.get_view]
4819+
Get an ES|QL view.
4820+
4821+
Returns a stored ES|QL view.
4822+
4823+
[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch#TODO)
4824+
4825+
```ts
4826+
client.esql.getView({ ... })
4827+
```
4828+
4829+
### Arguments [_arguments_esql.get_view]
4830+
4831+
#### Request (object) [_request_esql.get_view]
4832+
- **`name` (Optional, string)**: The comma-separated view names to retrieve.
4833+
48024834
## client.esql.listQueries [_esql.list_queries]
48034835
Get running ES|QL queries information.
48044836

@@ -4811,6 +4843,21 @@ client.esql.listQueries()
48114843
```
48124844

48134845

4846+
## client.esql.putView [_esql.put_view]
4847+
Create or update an ES|QL view.
4848+
4849+
[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch#TODO)
4850+
4851+
```ts
4852+
client.esql.putView({ name, query })
4853+
```
4854+
4855+
### Arguments [_arguments_esql.put_view]
4856+
4857+
#### Request (object) [_request_esql.put_view]
4858+
- **`name` (string)**: The view name to create or update.
4859+
- **`query` (string)**: The ES|QL query string from which to create a view.
4860+
48144861
## client.esql.query [_esql.query]
48154862
Run an ES|QL query.
48164863

@@ -8318,7 +8365,7 @@ client.inference.putContextualai({ task_type, contextualai_inference_id, service
83188365
- **`contextualai_inference_id` (string)**: The unique identifier of the inference endpoint.
83198366
- **`service` (Enum("contextualai"))**: The type of service supported for the specified task type. In this case, `contextualai`.
83208367
- **`service_settings` ({ api_key, model_id, rate_limit })**: Settings used to install the inference model. These settings are specific to the `contextualai` service.
8321-
- **`task_settings` (Optional, { instruction, return_documents, top_k })**: Settings to configure the inference task.
8368+
- **`task_settings` (Optional, { instruction, top_k })**: Settings to configure the inference task.
83228369
These settings are specific to the task type you specified.
83238370
- **`timeout` (Optional, string \| -1 \| 0)**: Specifies the amount of time to wait for the inference endpoint to be created.
83248371

src/api/api/clear_scroll.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
3030

3131
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
3232
clear_scroll: {
33-
path: [],
33+
path: [
34+
'scroll_id'
35+
],
3436
body: [
3537
'scroll_id'
3638
],

src/api/api/info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
3535
}
3636

3737
/**
38-
* Get cluster info. Get basic build, version, and cluster information. ::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.
38+
* Get cluster info. Get basic build, version, and cluster information. ::: In Serverless, `version.number` always reports the next target Elasticsearch release version at the time of the request. Serverless does not track to a traditional release versioning model; it is continuously updated. The version number is provided to maintain compatibility with existing clients, but it is not meaningful for assessing feature availability. Clients should detect a Serverless environment by checking for `build_flavor: serverless`.
3939
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-info | Elasticsearch API documentation}
4040
*/
4141
export default async function InfoApi (this: That, params?: T.InfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InfoResponse>

src/api/api/ml.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,9 @@ export default class Ml {
654654
query: []
655655
},
656656
'ml.put_job': {
657-
path: [],
657+
path: [
658+
'job_id'
659+
],
658660
body: [
659661
'allow_lazy_open',
660662
'analysis_config',
@@ -665,7 +667,6 @@ export default class Ml {
665667
'data_description',
666668
'datafeed_config',
667669
'description',
668-
'job_id',
669670
'groups',
670671
'model_plot_config',
671672
'model_snapshot_retention_days',
@@ -766,9 +767,10 @@ export default class Ml {
766767
]
767768
},
768769
'ml.start_data_frame_analytics': {
769-
path: [],
770+
path: [
771+
'id'
772+
],
770773
body: [
771-
'id',
772774
'timeout'
773775
],
774776
query: [
@@ -809,9 +811,10 @@ export default class Ml {
809811
]
810812
},
811813
'ml.stop_data_frame_analytics': {
812-
path: [],
814+
path: [
815+
'id'
816+
],
813817
body: [
814-
'id',
815818
'allow_no_match',
816819
'force',
817820
'timeout'
@@ -3969,7 +3972,7 @@ export default class Ml {
39693972
},
39703973
acceptedParams: {
39713974
path: ['job_id'],
3972-
body: ['allow_lazy_open', 'analysis_config', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'daily_model_snapshot_retention_after_days', 'data_description', 'datafeed_config', 'description', 'job_id', 'groups', 'model_plot_config', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_index_name', 'results_retention_days'],
3975+
body: ['allow_lazy_open', 'analysis_config', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'daily_model_snapshot_retention_after_days', 'data_description', 'datafeed_config', 'description', 'groups', 'model_plot_config', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_index_name', 'results_retention_days'],
39733976
query: ['allow_no_indices', 'expand_wildcards', 'ignore_throttled', 'ignore_unavailable']
39743977
}
39753978
}
@@ -4430,7 +4433,7 @@ export default class Ml {
44304433
},
44314434
acceptedParams: {
44324435
path: ['id'],
4433-
body: ['id', 'timeout'],
4436+
body: ['timeout'],
44344437
query: ['timeout']
44354438
}
44364439
}
@@ -4616,7 +4619,7 @@ export default class Ml {
46164619
},
46174620
acceptedParams: {
46184621
path: ['id'],
4619-
body: ['id', 'allow_no_match', 'force', 'timeout'],
4622+
body: ['allow_no_match', 'force', 'timeout'],
46204623
query: ['allow_no_match', 'force', 'timeout']
46214624
}
46224625
}

src/api/api/reindex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
5353
}
5454

5555
/**
56-
* Reindex documents. Copy documents from a source to a destination. You can copy all documents to the destination index or reindex a subset of the documents. The source can be any existing index, alias, or data stream. The destination must differ from the source. For example, you cannot reindex a data stream into itself. IMPORTANT: Reindex requires `_source` to be enabled for all documents in the source. The destination should be configured as wanted before calling the reindex API. Reindex does not copy the settings from the source or its associated template. Mappings, shard counts, and replicas, for example, must be configured ahead of time. If the Elasticsearch security features are enabled, you must have the following security privileges: * The `read` index privilege for the source data stream, index, or alias. * The `write` index privilege for the destination data stream, index, or index alias. * To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias. * If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias. If reindexing from a remote cluster into a cluster using Elastic Stack, you must explicitly allow the remote host using the `reindex.remote.whitelist` node setting on the destination cluster. If reindexing from a remote cluster into an Elastic Cloud Serverless project, only remote hosts from Elastic Cloud Hosted are allowed. Automatic data stream creation requires a matching index template with data stream enabled. The `dest` element can be configured like the index API to control optimistic concurrency control. Omitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID. Setting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source. Setting `op_type` to `create` causes the reindex API to create only missing documents in the destination. All existing documents will cause a version conflict. IMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`. A reindex can only add new documents to a destination data stream. It cannot update existing documents in a destination data stream. By default, version conflicts abort the reindex process. To continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`. In this case, the response includes a count of the version conflicts that were encountered. Note that the handling of other error types is unaffected by the `conflicts` property. Additionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query. It's recommended to reindex on indices with a green status. Reindexing can fail when a node shuts down or crashes. * When requested with `wait_for_completion=true` (default), the request fails if the node shuts down. * When requested with `wait_for_completion=false`, a task id is returned, for use with the task management APIs. The task may disappear or fail if the node shuts down. When retrying a failed reindex operation, it might be necessary to set `conflicts=proceed` or to first delete the partial destination index. Additionally, dry runs, checking disk space, and fetching index recovery information can help address the root cause. Refer to the linked documentation for examples of how to reindex documents.
56+
* Reindex documents. Copy documents from a source to a destination. You can copy all documents to the destination index or reindex a subset of the documents. The source can be any existing index, alias, or data stream. The destination must differ from the source. For example, you cannot reindex a data stream into itself. IMPORTANT: Reindex requires `_source` to be enabled for all documents in the source. The destination should be configured as wanted before calling the reindex API. Reindex does not copy the settings from the source or its associated template. Mappings, shard counts, and replicas, for example, must be configured ahead of time. If the Elasticsearch security features are enabled, you must have the following security privileges: * The `read` index privilege for the source data stream, index, or alias. * The `write` index privilege for the destination data stream, index, or index alias. * To automatically create a data stream or index with a reindex API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege for the destination data stream, index, or alias. * If reindexing from a remote cluster, the `source.remote.user` must have the `monitor` cluster privilege and the `read` index privilege for the source data stream, index, or alias. If reindexing from a remote cluster into a cluster using Elastic Stack, you must explicitly allow the remote host using the `reindex.remote.whitelist` node setting on the destination cluster. If reindexing from a remote cluster into an Elastic Cloud Serverless project, only remote hosts from [Elastic Cloud Hosted](https://cloud.elastic.co/registration?page=docs&placement=docs-body) are allowed. Automatic data stream creation requires a matching index template with data stream enabled. The `dest` element can be configured like the index API to control optimistic concurrency control. Omitting `version_type` or setting it to `internal` causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID. Setting `version_type` to `external` causes Elasticsearch to preserve the `version` from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source. Setting `op_type` to `create` causes the reindex API to create only missing documents in the destination. All existing documents will cause a version conflict. IMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an `op_type` of `create`. A reindex can only add new documents to a destination data stream. It cannot update existing documents in a destination data stream. By default, version conflicts abort the reindex process. To continue reindexing if there are conflicts, set the `conflicts` request body property to `proceed`. In this case, the response includes a count of the version conflicts that were encountered. Note that the handling of other error types is unaffected by the `conflicts` property. Additionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query. It's recommended to reindex on indices with a green status. Reindexing can fail when a node shuts down or crashes. * When requested with `wait_for_completion=true` (default), the request fails if the node shuts down. * When requested with `wait_for_completion=false`, a task id is returned, for use with the task management APIs. The task may disappear or fail if the node shuts down. When retrying a failed reindex operation, it might be necessary to set `conflicts=proceed` or to first delete the partial destination index. Additionally, dry runs, checking disk space, and fetching index recovery information can help address the root cause. Refer to the linked documentation for examples of how to reindex documents.
5757
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex | Elasticsearch API documentation}
5858
*/
5959
export default async function ReindexApi (this: That, params: T.ReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ReindexResponse>

src/api/api/render_search_template.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
3030

3131
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
3232
render_search_template: {
33-
path: [],
33+
path: [
34+
'id'
35+
],
3436
body: [
35-
'id',
3637
'file',
3738
'params',
3839
'source'
@@ -104,7 +105,7 @@ export default async function RenderSearchTemplateApi (this: That, params?: T.Re
104105
},
105106
acceptedParams: {
106107
path: ['id'],
107-
body: ['id', 'file', 'params', 'source'],
108+
body: ['file', 'params', 'source'],
108109
query: []
109110
}
110111
}

src/api/api/scroll.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
3030

3131
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
3232
scroll: {
33-
path: [],
33+
path: [
34+
'scroll_id'
35+
],
3436
body: [
3537
'scroll',
3638
'scroll_id'

src/api/api/security.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,10 @@ export default class Security {
499499
]
500500
},
501501
'security.put_user': {
502-
path: [],
502+
path: [
503+
'username'
504+
],
503505
body: [
504-
'username',
505506
'email',
506507
'full_name',
507508
'metadata',
@@ -3476,7 +3477,7 @@ export default class Security {
34763477
},
34773478
acceptedParams: {
34783479
path: ['username'],
3479-
body: ['username', 'email', 'full_name', 'metadata', 'password', 'password_hash', 'roles', 'enabled'],
3480+
body: ['email', 'full_name', 'metadata', 'password', 'password_hash', 'roles', 'enabled'],
34803481
query: ['refresh']
34813482
}
34823483
}

0 commit comments

Comments
 (0)