From 02915edf90d4977d6bdbea4ae583deee66b31a61 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 10 Feb 2025 06:04:07 +0000 Subject: [PATCH] Auto-generated API code --- docs/reference.asciidoc | 27 ++++++-- src/api/api/async_search.ts | 2 +- src/api/types.ts | 123 ++++++++++++++++++++++-------------- 3 files changed, 98 insertions(+), 54 deletions(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 8aee6b840..505544757 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -149,6 +149,7 @@ client.bulk({ ... }) * *Request (object):* ** *`index` (Optional, string)*: The name of the data stream, index, or index alias to perform bulk actions on. ** *`operations` (Optional, { index, create, update, delete } | { detect_noop, doc, doc_as_upsert, script, scripted_upsert, _source, upsert } | object[])* +** *`include_source_on_error` (Optional, boolean)*: True or false if to include the document source in the error message in case of parsing errors. ** *`list_executed_pipelines` (Optional, boolean)*: If `true`, the response will include the ingest pipelines that were run for each index or create. ** *`pipeline` (Optional, string)*: The pipeline identifier to use to preprocess incoming documents. If the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request. If a final pipeline is configured, it will always run regardless of the value of this parameter. ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search. If `wait_for`, wait for a refresh to make this operation visible to search. If `false`, do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. @@ -323,6 +324,7 @@ client.create({ id, index }) ** *`id` (string)*: A unique identifier for the document. To automatically generate a document ID, use the `POST //_doc/` request format. ** *`index` (string)*: The name of the data stream or index to target. If the target doesn't exist and matches the name or wildcard (`*`) pattern of an index template with a `data_stream` definition, this request creates the data stream. If the target doesn't exist and doesn’t match a data stream template, this request creates the index. ** *`document` (Optional, object)*: A document. +** *`include_source_on_error` (Optional, boolean)*: True or false if to include the document source in the error message in case of parsing errors. ** *`pipeline` (Optional, string)*: The ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request. If a final pipeline is configured, it will always run regardless of the value of this parameter. ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search. If `wait_for`, it waits for a refresh to make this operation visible to search. If `false`, it does nothing with refreshes. ** *`routing` (Optional, string)*: A custom value that is used to route operations to a specific shard. @@ -1031,6 +1033,7 @@ client.index({ index }) ** *`document` (Optional, object)*: A document. ** *`if_primary_term` (Optional, number)*: Only perform the operation if the document has this primary term. ** *`if_seq_no` (Optional, number)*: Only perform the operation if the document has this sequence number. +** *`include_source_on_error` (Optional, boolean)*: True or false if to include the document source in the error message in case of parsing errors. ** *`op_type` (Optional, Enum("index" | "create"))*: Set to `create` to only index the document if it does not already exist (put if absent). If a document with the specified `_id` already exists, the indexing operation will fail. The behavior is the same as using the `/_create` endpoint. If a document ID is specified, this paramater defaults to `index`. Otherwise, it defaults to `create`. If the request targets a data stream, an `op_type` of `create` is required. ** *`pipeline` (Optional, string)*: The ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search. If `wait_for`, it waits for a refresh to make this operation visible to search. If `false`, it does nothing with refreshes. @@ -2140,6 +2143,7 @@ client.update({ id, index }) ** *`upsert` (Optional, object)*: If the document does not already exist, the contents of 'upsert' are inserted as a new document. If the document exists, the 'script' is run. ** *`if_primary_term` (Optional, number)*: Only perform the operation if the document has this primary term. ** *`if_seq_no` (Optional, number)*: Only perform the operation if the document has this sequence number. +** *`include_source_on_error` (Optional, boolean)*: True or false if to include the document source in the error message in case of parsing errors. ** *`lang` (Optional, string)*: The script language. ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search. If 'wait_for', it waits for a refresh to make this operation visible to search. If 'false', it does nothing with refreshes. ** *`require_alias` (Optional, boolean)*: If `true`, the destination must be an index alias. @@ -2341,7 +2345,7 @@ client.asyncSearch.get({ id }) * *Request (object):* ** *`id` (string)*: A unique identifier for the async search. -** *`keep_alive` (Optional, string | -1 | 0)*: Specifies how long the async search should be available in the cluster. +** *`keep_alive` (Optional, string | -1 | 0)*: The length of time that the async search should be available in the cluster. When not specified, the `keep_alive` set with the corresponding submit async request will be used. Otherwise, it is possible to override the value and extend the validity of the request. When this period expires, the search, if still running, is cancelled. @@ -2356,7 +2360,10 @@ By default no timeout is set meaning that the currently available results will b Get the async search status. Get the status of a previously submitted async search request given its identifier, without retrieving search results. -If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role. +If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to: + +* The user or API key that submitted the original async search request. +* Users that have the `monitor` cluster privilege or greater privileges. https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit[Endpoint documentation] [source,ts] @@ -2369,7 +2376,7 @@ client.asyncSearch.status({ id }) * *Request (object):* ** *`id` (string)*: A unique identifier for the async search. -** *`keep_alive` (Optional, string | -1 | 0)*: Specifies how long the async search needs to be available. +** *`keep_alive` (Optional, string | -1 | 0)*: The length of time that the async search needs to be available. Ongoing async searches and any saved search results are deleted after this period. [discrete] @@ -3282,6 +3289,7 @@ If `false`, the request returns a 404 status code when there are no matches or o [discrete] ==== delete_auto_follow_pattern Delete auto-follow patterns. + Delete a collection of cross-cluster replication auto-follow patterns. https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-delete-auto-follow-pattern[Endpoint documentation] @@ -3294,8 +3302,10 @@ client.ccr.deleteAutoFollowPattern({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the auto follow pattern. -** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. +** *`name` (string)*: The auto-follow pattern collection to delete. +** *`master_timeout` (Optional, string | -1 | 0)*: The period to wait for a connection to the master node. +If the master node is not available before the timeout expires, the request fails and returns an error. +It can also be set to `-1` to indicate that the request should never timeout. [discrete] ==== follow @@ -3342,6 +3352,7 @@ remote Lucene segment files to the follower index. [discrete] ==== follow_info Get follower information. + Get information about all cross-cluster replication follower indices. For example, the results include follower index names, leader index names, replication options, and whether the follower indices are active or paused. @@ -3355,8 +3366,10 @@ client.ccr.followInfo({ index }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index patterns; use `_all` to perform the operation on all indices -** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. +** *`index` (string | string[])*: A comma-delimited list of follower index patterns. +** *`master_timeout` (Optional, string | -1 | 0)*: The period to wait for a connection to the master node. +If the master node is not available before the timeout expires, the request fails and returns an error. +It can also be set to `-1` to indicate that the request should never timeout. [discrete] ==== follow_stats diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index 256420631..b3dd631c1 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -128,7 +128,7 @@ export default class AsyncSearch { } /** - * Get the async search status. Get the status of a previously submitted async search request given its identifier, without retrieving search results. If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role. + * Get the async search status. Get the status of a previously submitted async search request given its identifier, without retrieving search results. If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to: * The user or API key that submitted the original async search request. * Users that have the `monitor` cluster privilege or greater privileges. * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit | Elasticsearch API documentation} */ async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/types.ts b/src/api/types.ts index 03cc037eb..4f6b554dd 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -34,6 +34,8 @@ export interface BulkCreateOperation extends BulkWriteOperation { export interface BulkDeleteOperation extends BulkOperationBase { } +export type BulkFailureStoreStatus = 'not_applicable_or_unknown' | 'used' | 'not_enabled' | 'failed' + export interface BulkIndexOperation extends BulkWriteOperation { } @@ -59,6 +61,8 @@ export type BulkOperationType = 'index' | 'create' | 'update' | 'delete' export interface BulkRequest extends RequestBase { /** The name of the data stream, index, or index alias to perform bulk actions on. */ index?: IndexName + /** True or false if to include the document source in the error message in case of parsing errors. */ + include_source_on_error?: boolean /** If `true`, the response will include the ingest pipelines that were run for each index or create. */ list_executed_pipelines?: boolean /** The pipeline identifier to use to preprocess incoming documents. If the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request. If a final pipeline is configured, it will always run regardless of the value of this parameter. */ @@ -83,9 +87,9 @@ export interface BulkRequest ex require_data_stream?: boolean operations?: (BulkOperationContainer | BulkUpdateAction | TDocument)[] /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, list_executed_pipelines?: never, pipeline?: never, refresh?: never, routing?: never, _source?: never, _source_excludes?: never, _source_includes?: never, timeout?: never, wait_for_active_shards?: never, require_alias?: never, require_data_stream?: never, operations?: never } + body?: string | { [key: string]: any } & { index?: never, include_source_on_error?: never, list_executed_pipelines?: never, pipeline?: never, refresh?: never, routing?: never, _source?: never, _source_excludes?: never, _source_includes?: never, timeout?: never, wait_for_active_shards?: never, require_alias?: never, require_data_stream?: never, operations?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, list_executed_pipelines?: never, pipeline?: never, refresh?: never, routing?: never, _source?: never, _source_excludes?: never, _source_includes?: never, timeout?: never, wait_for_active_shards?: never, require_alias?: never, require_data_stream?: never, operations?: never } + querystring?: { [key: string]: any } & { index?: never, include_source_on_error?: never, list_executed_pipelines?: never, pipeline?: never, refresh?: never, routing?: never, _source?: never, _source_excludes?: never, _source_includes?: never, timeout?: never, wait_for_active_shards?: never, require_alias?: never, require_data_stream?: never, operations?: never } } export interface BulkResponse { @@ -99,6 +103,7 @@ export interface BulkResponseItem { _id?: string | null _index: string status: integer + failure_store?: BulkFailureStoreStatus error?: ErrorCause _primary_term?: long result?: string @@ -207,6 +212,8 @@ export interface CreateRequest extends RequestBase { id: Id /** The name of the data stream or index to target. If the target doesn't exist and matches the name or wildcard (`*`) pattern of an index template with a `data_stream` definition, this request creates the data stream. If the target doesn't exist and doesn’t match a data stream template, this request creates the index. */ index: IndexName + /** True or false if to include the document source in the error message in case of parsing errors. */ + include_source_on_error?: boolean /** The ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request. If a final pipeline is configured, it will always run regardless of the value of this parameter. */ pipeline?: string /** If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search. If `wait_for`, it waits for a refresh to make this operation visible to search. If `false`, it does nothing with refreshes. */ @@ -223,9 +230,9 @@ export interface CreateRequest extends RequestBase { wait_for_active_shards?: WaitForActiveShards document?: TDocument /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { id?: never, index?: never, pipeline?: never, refresh?: never, routing?: never, timeout?: never, version?: never, version_type?: never, wait_for_active_shards?: never, document?: never } + body?: string | { [key: string]: any } & { id?: never, index?: never, include_source_on_error?: never, pipeline?: never, refresh?: never, routing?: never, timeout?: never, version?: never, version_type?: never, wait_for_active_shards?: never, document?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { id?: never, index?: never, pipeline?: never, refresh?: never, routing?: never, timeout?: never, version?: never, version_type?: never, wait_for_active_shards?: never, document?: never } + querystring?: { [key: string]: any } & { id?: never, index?: never, include_source_on_error?: never, pipeline?: never, refresh?: never, routing?: never, timeout?: never, version?: never, version_type?: never, wait_for_active_shards?: never, document?: never } } export type CreateResponse = WriteResponseBase @@ -895,6 +902,8 @@ export interface IndexRequest extends RequestBase { if_primary_term?: long /** Only perform the operation if the document has this sequence number. */ if_seq_no?: SequenceNumber + /** True or false if to include the document source in the error message in case of parsing errors. */ + include_source_on_error?: boolean /** Set to `create` to only index the document if it does not already exist (put if absent). If a document with the specified `_id` already exists, the indexing operation will fail. The behavior is the same as using the `/_create` endpoint. If a document ID is specified, this paramater defaults to `index`. Otherwise, it defaults to `create`. If the request targets a data stream, an `op_type` of `create` is required. */ op_type?: OpType /** The ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. */ @@ -915,9 +924,9 @@ export interface IndexRequest extends RequestBase { require_alias?: boolean document?: TDocument /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { id?: never, index?: never, if_primary_term?: never, if_seq_no?: never, op_type?: never, pipeline?: never, refresh?: never, routing?: never, timeout?: never, version?: never, version_type?: never, wait_for_active_shards?: never, require_alias?: never, document?: never } + body?: string | { [key: string]: any } & { id?: never, index?: never, if_primary_term?: never, if_seq_no?: never, include_source_on_error?: never, op_type?: never, pipeline?: never, refresh?: never, routing?: never, timeout?: never, version?: never, version_type?: never, wait_for_active_shards?: never, require_alias?: never, document?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { id?: never, index?: never, if_primary_term?: never, if_seq_no?: never, op_type?: never, pipeline?: never, refresh?: never, routing?: never, timeout?: never, version?: never, version_type?: never, wait_for_active_shards?: never, require_alias?: never, document?: never } + querystring?: { [key: string]: any } & { id?: never, index?: never, if_primary_term?: never, if_seq_no?: never, include_source_on_error?: never, op_type?: never, pipeline?: never, refresh?: never, routing?: never, timeout?: never, version?: never, version_type?: never, wait_for_active_shards?: never, require_alias?: never, document?: never } } export type IndexResponse = WriteResponseBase @@ -2577,6 +2586,8 @@ export interface UpdateRequest if_primary_term?: long /** Only perform the operation if the document has this sequence number. */ if_seq_no?: SequenceNumber + /** True or false if to include the document source in the error message in case of parsing errors. */ + include_source_on_error?: boolean /** The script language. */ lang?: string /** If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search. If 'wait_for', it waits for a refresh to make this operation visible to search. If 'false', it does nothing with refreshes. */ @@ -2610,9 +2621,9 @@ export interface UpdateRequest /** If the document does not already exist, the contents of 'upsert' are inserted as a new document. If the document exists, the 'script' is run. */ upsert?: TDocument /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { id?: never, index?: never, if_primary_term?: never, if_seq_no?: never, lang?: never, refresh?: never, require_alias?: never, retry_on_conflict?: never, routing?: never, timeout?: never, wait_for_active_shards?: never, _source_excludes?: never, _source_includes?: never, detect_noop?: never, doc?: never, doc_as_upsert?: never, script?: never, scripted_upsert?: never, _source?: never, upsert?: never } + body?: string | { [key: string]: any } & { id?: never, index?: never, if_primary_term?: never, if_seq_no?: never, include_source_on_error?: never, lang?: never, refresh?: never, require_alias?: never, retry_on_conflict?: never, routing?: never, timeout?: never, wait_for_active_shards?: never, _source_excludes?: never, _source_includes?: never, detect_noop?: never, doc?: never, doc_as_upsert?: never, script?: never, scripted_upsert?: never, _source?: never, upsert?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { id?: never, index?: never, if_primary_term?: never, if_seq_no?: never, lang?: never, refresh?: never, require_alias?: never, retry_on_conflict?: never, routing?: never, timeout?: never, wait_for_active_shards?: never, _source_excludes?: never, _source_includes?: never, detect_noop?: never, doc?: never, doc_as_upsert?: never, script?: never, scripted_upsert?: never, _source?: never, upsert?: never } + querystring?: { [key: string]: any } & { id?: never, index?: never, if_primary_term?: never, if_seq_no?: never, include_source_on_error?: never, lang?: never, refresh?: never, require_alias?: never, retry_on_conflict?: never, routing?: never, timeout?: never, wait_for_active_shards?: never, _source_excludes?: never, _source_includes?: never, detect_noop?: never, doc?: never, doc_as_upsert?: never, script?: never, scripted_upsert?: never, _source?: never, upsert?: never } } export type UpdateResponse = UpdateUpdateWriteResponseBase @@ -5232,9 +5243,8 @@ export interface AnalysisEstonianAnalyzer { export interface AnalysisFingerprintAnalyzer { type: 'fingerprint' version?: VersionString - max_output_size: integer - preserve_original: boolean - separator: string + max_output_size?: integer + separator?: string stopwords?: AnalysisStopWords stopwords_path?: string } @@ -5598,8 +5608,9 @@ export interface AnalysisPatternAnalyzer { version?: VersionString flags?: string lowercase?: boolean - pattern: string + pattern?: string stopwords?: AnalysisStopWords + stopwords_path?: string } export interface AnalysisPatternCaptureTokenFilter extends AnalysisTokenFilterBase { @@ -5756,6 +5767,7 @@ export interface AnalysisStandardAnalyzer { type: 'standard' max_token_length?: integer stopwords?: AnalysisStopWords + stopwords_path?: string } export interface AnalysisStandardTokenizer extends AnalysisTokenizerBase { @@ -6927,7 +6939,7 @@ export interface QueryDslPercolateQuery extends QueryDslQueryBase { export interface QueryDslPinnedDoc { _id: Id - _index: IndexName + _index?: IndexName } export interface QueryDslPinnedQuery extends QueryDslQueryBase { @@ -6997,7 +7009,7 @@ export interface QueryDslQueryContainer { span_near?: QueryDslSpanNearQuery span_not?: QueryDslSpanNotQuery span_or?: QueryDslSpanOrQuery - span_term?: Partial> + span_term?: Partial> span_within?: QueryDslSpanWithinQuery sparse_vector?: QueryDslSparseVectorQuery term?: Partial> @@ -7197,12 +7209,13 @@ export interface QueryDslSpanQuery { span_near?: QueryDslSpanNearQuery span_not?: QueryDslSpanNotQuery span_or?: QueryDslSpanOrQuery - span_term?: Partial> + span_term?: Partial> span_within?: QueryDslSpanWithinQuery } export interface QueryDslSpanTermQuery extends QueryDslQueryBase { - value: string + value: FieldValue + term: FieldValue } export interface QueryDslSpanWithinQuery extends QueryDslQueryBase { @@ -7344,7 +7357,7 @@ export type AsyncSearchDeleteResponse = AcknowledgedResponseBase export interface AsyncSearchGetRequest extends RequestBase { /** A unique identifier for the async search. */ id: Id - /** Specifies how long the async search should be available in the cluster. When not specified, the `keep_alive` set with the corresponding submit async request will be used. Otherwise, it is possible to override the value and extend the validity of the request. When this period expires, the search, if still running, is cancelled. If the search is completed, its saved results are deleted. */ + /** The length of time that the async search should be available in the cluster. When not specified, the `keep_alive` set with the corresponding submit async request will be used. Otherwise, it is possible to override the value and extend the validity of the request. When this period expires, the search, if still running, is cancelled. If the search is completed, its saved results are deleted. */ keep_alive?: Duration /** Specify whether aggregation and suggester names should be prefixed by their respective types in the response */ typed_keys?: boolean @@ -7361,7 +7374,7 @@ export type AsyncSearchGetResponse + _version: SpecUtilsStringified + executed_pipelines: string[] + ignored_fields?: Record[] + error?: ErrorCause +} +export type SimulateIngestIngestDocumentSimulation = SimulateIngestIngestDocumentSimulationKeys +& { [property: string]: string | Id | IndexName | Record | SpecUtilsStringified | string[] | Record[] | ErrorCause } + export interface SimulateIngestRequest extends RequestBase { /** The index to simulate ingesting into. This value can be overridden by specifying an index on each document. If you specify this parameter in the request path, it is used for any documents that do not explicitly specify an index argument. */ index?: IndexName @@ -22905,7 +22932,11 @@ export interface SimulateIngestRequest extends RequestBase { } export interface SimulateIngestResponse { - docs: IngestSimulateDocumentResult[] + docs: SimulateIngestSimulateIngestDocumentResult[] +} + +export interface SimulateIngestSimulateIngestDocumentResult { + doc?: SimulateIngestIngestDocumentSimulation } export interface SlmConfiguration { @@ -23125,7 +23156,7 @@ export type SlmStopResponse = AcknowledgedResponseBase export interface SnapshotAzureRepository extends SnapshotRepositoryBase { type: 'azure' - settings: SnapshotAzureRepositorySettings + settings?: SnapshotAzureRepositorySettings } export interface SnapshotAzureRepositorySettings extends SnapshotRepositorySettingsBase {