Skip to content

Auto-generated code for main #2847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
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
67 changes: 65 additions & 2 deletions docs/reference/api-reference.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in docs/reference/api-reference.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/api-reference.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/api-reference.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/api-reference.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/api-reference.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/api-reference.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/api-reference.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/api-reference.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html
comment: |
Expand Down Expand Up @@ -5848,6 +5848,7 @@

## client.indices.deleteTemplate [_indices.delete_template]
Delete a legacy index template.
IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.

[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-template)

Expand Down Expand Up @@ -6422,7 +6423,7 @@
error.

## client.indices.getTemplate [_indices.get_template]
Get index templates.
Get legacy index templates.
Get information about one or more index templates.

IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
Expand Down Expand Up @@ -6858,7 +6859,7 @@
timeout expires, the request fails and returns an error.

## client.indices.putTemplate [_indices.put_template]
Create or update an index template.
Create or update a legacy index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
Elasticsearch applies templates to new indices based on an index pattern that matches the index name.

Expand Down Expand Up @@ -13853,6 +13854,68 @@
- **`timeout` (Optional, string \| -1 \| 0)**: The period of time to wait for the test to complete.
If no response is received before the timeout expires, the test is cancelled and returns an error.

## client.snapshot.repositoryVerifyIntegrity [_snapshot.repository_verify_integrity]
Verify the repository integrity.
Verify the integrity of the contents of a snapshot repository.

This API enables you to perform a comprehensive check of the contents of a repository, looking for any anomalies in its data or metadata which might prevent you from restoring snapshots from the repository or which might cause future snapshot create or delete operations to fail.

If you suspect the integrity of the contents of one of your snapshot repositories, cease all write activity to this repository immediately, set its `read_only` option to `true`, and use this API to verify its integrity.
Until you do so:

* It may not be possible to restore some snapshots from this repository.
* Searchable snapshots may report errors when searched or may have unassigned shards.
* Taking snapshots into this repository may fail or may appear to succeed but have created a snapshot which cannot be restored.
* Deleting snapshots from this repository may fail or may appear to succeed but leave the underlying data on disk.
* Continuing to write to the repository while it is in an invalid state may causing additional damage to its contents.

If the API finds any problems with the integrity of the contents of your repository, Elasticsearch will not be able to repair the damage.
The only way to bring the repository back into a fully working state after its contents have been damaged is by restoring its contents from a repository backup which was taken before the damage occurred.
You must also identify what caused the damage and take action to prevent it from happening again.

If you cannot restore a repository backup, register a new repository and use this for all future snapshot operations.
In some cases it may be possible to recover some of the contents of a damaged repository, either by restoring as many of its snapshots as needed and taking new snapshots of the restored data, or by using the reindex API to copy data from any searchable snapshots mounted from the damaged repository.

Avoid all operations which write to the repository while the verify repository integrity API is running.
If something changes the repository contents while an integrity verification is running then Elasticsearch may incorrectly report having detected some anomalies in its contents due to the concurrent writes.
It may also incorrectly fail to report some anomalies that the concurrent writes prevented it from detecting.

NOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.

NOTE: This API may not work correctly in a mixed-version cluster.

The default values for the parameters of this API are designed to limit the impact of the integrity verification on other activities in your cluster.
For instance, by default it will only use at most half of the `snapshot_meta` threads to verify the integrity of each snapshot, allowing other snapshot operations to use the other half of this thread pool.
If you modify these parameters to speed up the verification process, you risk disrupting other snapshot-related operations in your cluster.
For large repositories, consider setting up a separate single-node Elasticsearch cluster just for running the integrity verification API.

The response exposes implementation details of the analysis which may change from version to version.
The response body format is therefore not considered stable and may be different in newer versions.

[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-repository-verify-integrity)

```ts
client.snapshot.repositoryVerifyIntegrity({ repository })
```

### Arguments [_arguments_snapshot.repository_verify_integrity]

#### Request (object) [_request_snapshot.repository_verify_integrity]
- **`repository` (string \| string[])**: The name of the snapshot repository.
- **`blob_thread_pool_concurrency` (Optional, number)**: If `verify_blob_contents` is `true`, this parameter specifies how many blobs to verify at once.
- **`index_snapshot_verification_concurrency` (Optional, number)**: The maximum number of index snapshots to verify concurrently within each index verification.
- **`index_verification_concurrency` (Optional, number)**: The number of indices to verify concurrently.
The default behavior is to use the entire `snapshot_meta` thread pool.
- **`max_bytes_per_sec` (Optional, string)**: If `verify_blob_contents` is `true`, this parameter specifies the maximum amount of data that Elasticsearch will read from the repository every second.
- **`max_failed_shard_snapshots` (Optional, number)**: The number of shard snapshot failures to track during integrity verification, in order to avoid excessive resource usage.
If your repository contains more than this number of shard snapshot failures, the verification will fail.
- **`meta_thread_pool_concurrency` (Optional, number)**: The maximum number of snapshot metadata operations to run concurrently.
The default behavior is to use at most half of the `snapshot_meta` thread pool at once.
- **`snapshot_verification_concurrency` (Optional, number)**: The number of snapshots to verify concurrently.
The default behavior is to use at most half of the `snapshot_meta` thread pool at once.
- **`verify_blob_contents` (Optional, boolean)**: Indicates whether to verify the checksum of every data blob in the repository.
If this feature is enabled, Elasticsearch will read the entire repository contents, which may be extremely slow and expensive.

## client.snapshot.restore [_snapshot.restore]
Restore a snapshot.
Restore a snapshot of a cluster or data streams and indices.
Expand Down
110 changes: 107 additions & 3 deletions src/api/api/indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,13 @@ export default class Indices {
body: [],
query: []
},
'indices.get_data_stream_settings': {
path: [
'name'
],
body: [],
query: []
},
'indices.get_field_mapping': {
path: [
'fields',
Expand Down Expand Up @@ -580,6 +587,13 @@ export default class Indices {
body: [],
query: []
},
'indices.put_data_stream_settings': {
path: [
'name'
],
body: [],
query: []
},
'indices.put_index_template': {
path: [
'name'
Expand Down Expand Up @@ -1676,7 +1690,7 @@ export default class Indices {
}

/**
* Delete a legacy index template.
* Delete a legacy index template. IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-template | Elasticsearch API documentation}
*/
async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDeleteTemplateResponse>
Expand Down Expand Up @@ -2488,6 +2502,51 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

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

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())}/_settings`
const meta: TransportRequestMetadata = {
name: 'indices.get_data_stream_settings',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Get mapping definitions. Retrieves mapping definitions for one or more fields. For data streams, the API retrieves field mappings for the stream’s backing indices. This API is useful if you don't need a complete mapping or if an index mapping contains a large number of fields.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping | Elasticsearch API documentation}
Expand Down Expand Up @@ -2753,7 +2812,7 @@ export default class Indices {
}

/**
* Get index templates. Get information about one or more index templates. IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
* Get legacy index templates. Get information about one or more index templates. IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-template | Elasticsearch API documentation}
*/
async getTemplate (this: That, params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetTemplateResponse>
Expand Down Expand Up @@ -3205,6 +3264,51 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

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

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())}/_settings`
const meta: TransportRequestMetadata = {
name: 'indices.put_data_stream_settings',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. Elasticsearch applies templates to new indices based on an wildcard pattern that matches the index name. Index templates are applied during data stream or index creation. For data streams, these settings and mappings are applied when the stream's backing indices are created. Settings and mappings specified in a create index API request override any settings or mappings specified in an index template. Changes to index templates do not affect existing indices, including the existing backing indices of a data stream. You can use C-style `/* *\/` block comments in index templates. You can include comments anywhere in the request body, except before the opening curly bracket. **Multiple matching templates** If multiple index templates match the name of a new index or data stream, the template with the highest priority is used. Multiple templates with overlapping index patterns at the same priority are not allowed and an error will be thrown when attempting to create a template matching an existing index template at identical priorities. **Composing aliases, mappings, and settings** When multiple component templates are specified in the `composed_of` field for an index template, they are merged in the order specified, meaning that later component templates override earlier component templates. Any mappings, settings, or aliases from the parent index template are merged in next. Finally, any configuration on the index request itself is merged. Mapping definitions are merged recursively, which means that later mapping components can introduce new field mappings and update the mapping configuration. If a field mapping is already contained in an earlier component, its definition will be completely overwritten by the later one. This recursive merging strategy applies not only to field mappings, but also root options like `dynamic_templates` and `meta`. If an earlier component contains a `dynamic_templates` block, then by default new `dynamic_templates` entries are appended onto the end. If an entry already exists with the same key, then it is overwritten by the new definition.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template | Elasticsearch API documentation}
Expand Down Expand Up @@ -3374,7 +3478,7 @@ export default class Indices {
}

/**
* Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. Elasticsearch applies templates to new indices based on an index pattern that matches the index name. IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. Composable templates always take precedence over legacy templates. If no composable template matches a new index, matching legacy templates are applied according to their order. Index templates are only applied during index creation. Changes to index templates do not affect existing indices. Settings and mappings specified in create index API requests override any settings or mappings specified in an index template. You can use C-style `/* *\/` block comments in index templates. You can include comments anywhere in the request body, except before the opening curly bracket. **Indices matching multiple templates** Multiple index templates can potentially match an index, in this case, both the settings and mappings are merged into the final configuration of the index. The order of the merging can be controlled using the order parameter, with lower order being applied first, and higher orders overriding them. NOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order.
* Create or update a legacy index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. Elasticsearch applies templates to new indices based on an index pattern that matches the index name. IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. Composable templates always take precedence over legacy templates. If no composable template matches a new index, matching legacy templates are applied according to their order. Index templates are only applied during index creation. Changes to index templates do not affect existing indices. Settings and mappings specified in create index API requests override any settings or mappings specified in an index template. You can use C-style `/* *\/` block comments in index templates. You can include comments anywhere in the request body, except before the opening curly bracket. **Indices matching multiple templates** Multiple index templates can potentially match an index, in this case, both the settings and mappings are merged into the final configuration of the index. The order of the merging can be controlled using the order parameter, with lower order being applied first, and higher orders overriding them. NOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-template | Elasticsearch API documentation}
*/
async putTemplate (this: That, params: T.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutTemplateResponse>
Expand Down
Loading
Loading