Skip to content

Commit 41252a5

Browse files
Auto-generated API code
1 parent a1dc6f5 commit 41252a5

File tree

3 files changed

+184
-8
lines changed

3 files changed

+184
-8
lines changed

docs/reference/api-reference.md

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5848,6 +5848,7 @@ client.indices.deleteIndexTemplate({ name })
58485848

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

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

@@ -6422,7 +6423,7 @@ received before the timeout expires, the request fails and returns an
64226423
error.
64236424

64246425
## client.indices.getTemplate [_indices.get_template]
6425-
Get index templates.
6426+
Get legacy index templates.
64266427
Get information about one or more index templates.
64276428

64286429
IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
@@ -6858,7 +6859,7 @@ will be closed temporarily and then reopened in order to apply the changes.
68586859
timeout expires, the request fails and returns an error.
68596860

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

@@ -13853,6 +13854,68 @@ Note that the operations are performed concurrently so might not always happen i
1385313854
- **`timeout` (Optional, string \| -1 \| 0)**: The period of time to wait for the test to complete.
1385413855
If no response is received before the timeout expires, the test is cancelled and returns an error.
1385513856

13857+
## client.snapshot.repositoryVerifyIntegrity [_snapshot.repository_verify_integrity]
13858+
Verify the repository integrity.
13859+
Verify the integrity of the contents of a snapshot repository.
13860+
13861+
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.
13862+
13863+
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.
13864+
Until you do so:
13865+
13866+
* It may not be possible to restore some snapshots from this repository.
13867+
* Searchable snapshots may report errors when searched or may have unassigned shards.
13868+
* Taking snapshots into this repository may fail or may appear to succeed but have created a snapshot which cannot be restored.
13869+
* Deleting snapshots from this repository may fail or may appear to succeed but leave the underlying data on disk.
13870+
* Continuing to write to the repository while it is in an invalid state may causing additional damage to its contents.
13871+
13872+
If the API finds any problems with the integrity of the contents of your repository, Elasticsearch will not be able to repair the damage.
13873+
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.
13874+
You must also identify what caused the damage and take action to prevent it from happening again.
13875+
13876+
If you cannot restore a repository backup, register a new repository and use this for all future snapshot operations.
13877+
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.
13878+
13879+
Avoid all operations which write to the repository while the verify repository integrity API is running.
13880+
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.
13881+
It may also incorrectly fail to report some anomalies that the concurrent writes prevented it from detecting.
13882+
13883+
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.
13884+
13885+
NOTE: This API may not work correctly in a mixed-version cluster.
13886+
13887+
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.
13888+
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.
13889+
If you modify these parameters to speed up the verification process, you risk disrupting other snapshot-related operations in your cluster.
13890+
For large repositories, consider setting up a separate single-node Elasticsearch cluster just for running the integrity verification API.
13891+
13892+
The response exposes implementation details of the analysis which may change from version to version.
13893+
The response body format is therefore not considered stable and may be different in newer versions.
13894+
13895+
[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-repository-verify-integrity)
13896+
13897+
```ts
13898+
client.snapshot.repositoryVerifyIntegrity({ repository })
13899+
```
13900+
13901+
### Arguments [_arguments_snapshot.repository_verify_integrity]
13902+
13903+
#### Request (object) [_request_snapshot.repository_verify_integrity]
13904+
- **`repository` (string \| string[])**: The name of the snapshot repository.
13905+
- **`blob_thread_pool_concurrency` (Optional, number)**: If `verify_blob_contents` is `true`, this parameter specifies how many blobs to verify at once.
13906+
- **`index_snapshot_verification_concurrency` (Optional, number)**: The maximum number of index snapshots to verify concurrently within each index verification.
13907+
- **`index_verification_concurrency` (Optional, number)**: The number of indices to verify concurrently.
13908+
The default behavior is to use the entire `snapshot_meta` thread pool.
13909+
- **`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.
13910+
- **`max_failed_shard_snapshots` (Optional, number)**: The number of shard snapshot failures to track during integrity verification, in order to avoid excessive resource usage.
13911+
If your repository contains more than this number of shard snapshot failures, the verification will fail.
13912+
- **`meta_thread_pool_concurrency` (Optional, number)**: The maximum number of snapshot metadata operations to run concurrently.
13913+
The default behavior is to use at most half of the `snapshot_meta` thread pool at once.
13914+
- **`snapshot_verification_concurrency` (Optional, number)**: The number of snapshots to verify concurrently.
13915+
The default behavior is to use at most half of the `snapshot_meta` thread pool at once.
13916+
- **`verify_blob_contents` (Optional, boolean)**: Indicates whether to verify the checksum of every data blob in the repository.
13917+
If this feature is enabled, Elasticsearch will read the entire repository contents, which may be extremely slow and expensive.
13918+
1385613919
## client.snapshot.restore [_snapshot.restore]
1385713920
Restore a snapshot.
1385813921
Restore a snapshot of a cluster or data streams and indices.

src/api/api/indices.ts

Lines changed: 107 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,13 @@ export default class Indices {
422422
body: [],
423423
query: []
424424
},
425+
'indices.get_data_stream_settings': {
426+
path: [
427+
'name'
428+
],
429+
body: [],
430+
query: []
431+
},
425432
'indices.get_field_mapping': {
426433
path: [
427434
'fields',
@@ -580,6 +587,13 @@ export default class Indices {
580587
body: [],
581588
query: []
582589
},
590+
'indices.put_data_stream_settings': {
591+
path: [
592+
'name'
593+
],
594+
body: [],
595+
query: []
596+
},
583597
'indices.put_index_template': {
584598
path: [
585599
'name'
@@ -1676,7 +1690,7 @@ export default class Indices {
16761690
}
16771691

16781692
/**
1679-
* Delete a legacy index template.
1693+
* 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.
16801694
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-template | Elasticsearch API documentation}
16811695
*/
16821696
async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDeleteTemplateResponse>
@@ -2488,6 +2502,51 @@ export default class Indices {
24882502
return await this.transport.request({ path, method, querystring, body, meta }, options)
24892503
}
24902504

2505+
/**
2506+
* Gets a data stream's settings
2507+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation}
2508+
*/
2509+
async getDataStreamSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
2510+
async getDataStreamSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
2511+
async getDataStreamSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
2512+
async getDataStreamSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
2513+
const {
2514+
path: acceptedPath
2515+
} = this.acceptedParams['indices.get_data_stream_settings']
2516+
2517+
const userQuery = params?.querystring
2518+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
2519+
2520+
let body: Record<string, any> | string | undefined
2521+
const userBody = params?.body
2522+
if (userBody != null) {
2523+
if (typeof userBody === 'string') {
2524+
body = userBody
2525+
} else {
2526+
body = { ...userBody }
2527+
}
2528+
}
2529+
2530+
params = params ?? {}
2531+
for (const key in params) {
2532+
if (acceptedPath.includes(key)) {
2533+
continue
2534+
} else if (key !== 'body' && key !== 'querystring') {
2535+
querystring[key] = params[key]
2536+
}
2537+
}
2538+
2539+
const method = 'GET'
2540+
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_settings`
2541+
const meta: TransportRequestMetadata = {
2542+
name: 'indices.get_data_stream_settings',
2543+
pathParts: {
2544+
name: params.name
2545+
}
2546+
}
2547+
return await this.transport.request({ path, method, querystring, body, meta }, options)
2548+
}
2549+
24912550
/**
24922551
* 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.
24932552
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping | Elasticsearch API documentation}
@@ -2753,7 +2812,7 @@ export default class Indices {
27532812
}
27542813

27552814
/**
2756-
* 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.
2815+
* 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.
27572816
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-template | Elasticsearch API documentation}
27582817
*/
27592818
async getTemplate (this: That, params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetTemplateResponse>
@@ -3205,6 +3264,51 @@ export default class Indices {
32053264
return await this.transport.request({ path, method, querystring, body, meta }, options)
32063265
}
32073266

3267+
/**
3268+
* Updates a data stream's settings
3269+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation}
3270+
*/
3271+
async putDataStreamSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
3272+
async putDataStreamSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
3273+
async putDataStreamSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
3274+
async putDataStreamSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
3275+
const {
3276+
path: acceptedPath
3277+
} = this.acceptedParams['indices.put_data_stream_settings']
3278+
3279+
const userQuery = params?.querystring
3280+
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
3281+
3282+
let body: Record<string, any> | string | undefined
3283+
const userBody = params?.body
3284+
if (userBody != null) {
3285+
if (typeof userBody === 'string') {
3286+
body = userBody
3287+
} else {
3288+
body = { ...userBody }
3289+
}
3290+
}
3291+
3292+
params = params ?? {}
3293+
for (const key in params) {
3294+
if (acceptedPath.includes(key)) {
3295+
continue
3296+
} else if (key !== 'body' && key !== 'querystring') {
3297+
querystring[key] = params[key]
3298+
}
3299+
}
3300+
3301+
const method = 'PUT'
3302+
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_settings`
3303+
const meta: TransportRequestMetadata = {
3304+
name: 'indices.put_data_stream_settings',
3305+
pathParts: {
3306+
name: params.name
3307+
}
3308+
}
3309+
return await this.transport.request({ path, method, querystring, body, meta }, options)
3310+
}
3311+
32083312
/**
32093313
* 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.
32103314
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template | Elasticsearch API documentation}
@@ -3374,7 +3478,7 @@ export default class Indices {
33743478
}
33753479

33763480
/**
3377-
* 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.
3481+
* 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.
33783482
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-template | Elasticsearch API documentation}
33793483
*/
33803484
async putTemplate (this: That, params: T.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutTemplateResponse>

0 commit comments

Comments
 (0)