diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index d916d9d..1f15c51 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -38,17 +38,21 @@ client.bulk({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string)*: Default index for items which don't provide one +** *`index` (Optional, string)*: 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[])* -** *`pipeline` (Optional, string)*: The pipeline id to preprocess incoming documents with -** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. -** *`routing` (Optional, string)*: Specific routing value -** *`_source` (Optional, boolean | string | string[])*: True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request -** *`_source_excludes` (Optional, string | string[])*: Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -** *`_source_includes` (Optional, string | string[])*: Default list of fields to extract and return from the _source field, can be overridden on each sub-request -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -** *`require_alias` (Optional, boolean)*: Sets require_alias for all incoming documents. Defaults to unset (false) +** *`pipeline` (Optional, string)*: 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` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. +Valid values: `true`, `false`, `wait_for`. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`_source` (Optional, boolean | string | string[])*: `true` or `false` to return the `_source` field or not, or a list of fields to return. +** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude from the response. +** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. +** *`timeout` (Optional, string | -1 | 0)*: Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). +** *`require_alias` (Optional, boolean)*: If `true`, the request’s actions must target an index alias. [discrete] === clear_scroll @@ -63,7 +67,8 @@ client.clearScroll({ ... }) ==== Arguments * *Request (object):* -** *`scroll_id` (Optional, string | string[])*: A list of scroll IDs to clear +** *`scroll_id` (Optional, string | string[])*: List of scroll IDs to clear. +To clear all scroll IDs, use `_all`. [discrete] === close_point_in_time @@ -78,7 +83,7 @@ client.closePointInTime({ id }) ==== Arguments * *Request (object):* -** *`id` (string)* +** *`id` (string)*: The ID of the point-in-time. [discrete] === count @@ -93,22 +98,34 @@ client.count({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: A list of indices to restrict the results -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })* -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`analyzer` (Optional, string)*: The analyzer to use for the query string -** *`analyze_wildcard` (Optional, boolean)*: Specify whether wildcard and prefix queries should be analyzed (default: false) -** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query (AND or OR) -** *`df` (Optional, string)*: The field to use as default where no field prefix is given in the query string -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`ignore_throttled` (Optional, boolean)*: Whether specified concrete, expanded or aliased indices should be ignored when throttled -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`lenient` (Optional, boolean)*: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -** *`min_score` (Optional, number)*: Include only documents with a specific `_score` value in the result -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`routing` (Optional, string)*: A list of specific routing values -** *`terminate_after` (Optional, number)*: The maximum count for each shard, upon reaching which the query execution will terminate early -** *`q` (Optional, string)*: Query in the Lucene query string syntax +** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. +Supports wildcards (`*`). +To search all data streams and indices, omit this parameter or use `*` or `_all`. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +** *`analyzer` (Optional, string)*: Analyzer to use for the query string. +This parameter can only be used when the `q` query string parameter is specified. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. +This parameter can only be used when the `q` query string parameter is specified. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. +This parameter can only be used when the `q` query string parameter is specified. +** *`df` (Optional, string)*: Field to use as default where no field prefix is given in the query string. +This parameter can only be used when the `q` query string parameter is specified. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +** *`ignore_throttled` (Optional, boolean)*: If `true`, concrete, expanded or aliased indices are ignored when frozen. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. +** *`min_score` (Optional, number)*: Sets the minimum `_score` value that documents must have to be included in the result. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`terminate_after` (Optional, number)*: Maximum number of documents to collect for each shard. +If a query reaches this limit, Elasticsearch terminates the query early. +Elasticsearch collects documents before sorting. +** *`q` (Optional, string)*: Query in the Lucene query string syntax. [discrete] === create @@ -125,16 +142,23 @@ client.create({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: Document ID -** *`index` (string)*: The name of the index +** *`id` (string)*: Unique identifier for the document. +** *`index` (string)*: 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. -** *`pipeline` (Optional, string)*: The pipeline id to preprocess incoming documents with -** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. -** *`routing` (Optional, string)*: Specific routing value -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) +** *`pipeline` (Optional, string)*: 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` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. +Valid values: `true`, `false`, `wait_for`. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`timeout` (Optional, string | -1 | 0)*: Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). [discrete] === delete @@ -149,16 +173,19 @@ client.delete({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: The document ID -** *`index` (string)*: The name of the index -** *`if_primary_term` (Optional, number)*: only perform the delete operation if the last operation that has changed the document has the specified primary term -** *`if_seq_no` (Optional, number)*: only perform the delete operation if the last operation that has changed the document has the specified sequence number -** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. -** *`routing` (Optional, string)*: Specific routing value -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) +** *`id` (string)*: Unique identifier for the document. +** *`index` (string)*: Name of the target index. +** *`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. +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. +Valid values: `true`, `false`, `wait_for`. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`timeout` (Optional, string | -1 | 0)*: Period to wait for active shards. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). [discrete] === delete_by_query @@ -173,38 +200,55 @@ client.deleteByQuery({ index }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index names to search; use `_all` or empty string to perform the operation on all indices -** *`max_docs` (Optional, number)* -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })* -** *`slice` (Optional, { field, id, max })* -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`analyzer` (Optional, string)*: The analyzer to use for the query string -** *`analyze_wildcard` (Optional, boolean)*: Specify whether wildcard and prefix queries should be analyzed (default: false) -** *`conflicts` (Optional, Enum("abort" | "proceed"))*: What to do when the delete by query hits version conflicts? -** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query (AND or OR) -** *`df` (Optional, string)*: The field to use as default where no field prefix is given in the query string -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. +** *`index` (string | string[])*: List of data streams, indices, and aliases to search. +Supports wildcards (`*`). +To search all data streams or indices, omit this parameter or use `*` or `_all`. +** *`max_docs` (Optional, number)*: The maximum number of documents to delete. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Specifies the documents to delete using the Query DSL. +** *`slice` (Optional, { field, id, max })*: Slice the request manually using the provided slice ID and total number of slices. +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. +** *`analyzer` (Optional, string)*: Analyzer to use for the query string. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. +** *`conflicts` (Optional, Enum("abort" | "proceed"))*: What to do if delete by query hits version conflicts: `abort` or `proceed`. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. +** *`df` (Optional, string)*: Field to use as default where no field prefix is given in the query string. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. ** *`from` (Optional, number)*: Starting offset (default: 0) -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`lenient` (Optional, boolean)*: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`refresh` (Optional, boolean)*: Should the affected indexes be refreshed? -** *`request_cache` (Optional, boolean)*: Specify if request cache should be used for this request or not, defaults to index level setting -** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. -1 means no throttle. -** *`routing` (Optional, string)*: A list of specific routing values -** *`q` (Optional, string)*: Query in the Lucene query string syntax -** *`scroll` (Optional, string | -1 | 0)*: Specify how long a consistent view of the index should be maintained for scrolled search -** *`scroll_size` (Optional, number)*: Size on the scroll request powering the delete by query -** *`search_timeout` (Optional, string | -1 | 0)*: Explicit timeout for each search request. Defaults to no timeout. -** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: Search operation type -** *`slices` (Optional, number | Enum("auto"))*: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. -** *`sort` (Optional, string[])*: A list of : pairs -** *`stats` (Optional, string[])*: Specific 'tag' of the request for logging and statistical purposes -** *`terminate_after` (Optional, number)*: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -** *`timeout` (Optional, string | -1 | 0)*: Time each individual bulk request should wait for shards that are unavailable. -** *`version` (Optional, boolean)*: Specify whether to return document version as part of a hit -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -** *`wait_for_completion` (Optional, boolean)*: Should the request should block until the delete by query is complete. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`refresh` (Optional, boolean)*: If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes. +** *`request_cache` (Optional, boolean)*: If `true`, the request cache is used for this request. +Defaults to the index-level setting. +** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`q` (Optional, string)*: Query in the Lucene query string syntax. +** *`scroll` (Optional, string | -1 | 0)*: Period to retain the search context for scrolling. +** *`scroll_size` (Optional, number)*: Size of the scroll request that powers the operation. +** *`search_timeout` (Optional, string | -1 | 0)*: Explicit timeout for each search request. +Defaults to no timeout. +** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. +Available options: `query_then_fetch`, `dfs_query_then_fetch`. +** *`slices` (Optional, number | Enum("auto"))*: The number of slices this task should be divided into. +** *`sort` (Optional, string[])*: A list of : pairs. +** *`stats` (Optional, string[])*: Specific `tag` of the request for logging and statistical purposes. +** *`terminate_after` (Optional, number)*: Maximum number of documents to collect for each shard. +If a query reaches this limit, Elasticsearch terminates the query early. +Elasticsearch collects documents before sorting. +Use with caution. +Elasticsearch applies this parameter to each shard handling the request. +When possible, let Elasticsearch perform early termination automatically. +Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. +** *`timeout` (Optional, string | -1 | 0)*: Period each deletion request waits for active shards. +** *`version` (Optional, boolean)*: If `true`, returns the document version as part of a hit. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). +** *`wait_for_completion` (Optional, boolean)*: If `true`, the request blocks until the operation is complete. [discrete] === delete_script @@ -219,9 +263,11 @@ client.deleteScript({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: Script ID -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout +** *`id` (string)*: Identifier for the stored script or search template. +** *`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] === exists @@ -236,18 +282,23 @@ client.exists({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: The document ID -** *`index` (string)*: The name of the index -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`realtime` (Optional, boolean)*: Specify whether to perform the operation in realtime or search mode -** *`refresh` (Optional, boolean)*: Refresh the shard containing the document before performing the operation -** *`routing` (Optional, string)*: Specific routing value -** *`_source` (Optional, boolean | string | string[])*: True or false to return the _source field or not, or a list of fields to return -** *`_source_excludes` (Optional, string | string[])*: A list of fields to exclude from the returned _source field -** *`_source_includes` (Optional, string | string[])*: A list of fields to extract and return from the _source field -** *`stored_fields` (Optional, string | string[])*: A list of stored fields to return in the response -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type +** *`id` (string)*: Identifier of the document. +** *`index` (string)*: List of data streams, indices, and aliases. +Supports wildcards (`*`). +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`realtime` (Optional, boolean)*: If `true`, the request is real-time as opposed to near-real-time. +** *`refresh` (Optional, boolean)*: If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes. +** *`routing` (Optional, string)*: Target the specified primary shard. +** *`_source` (Optional, boolean | string | string[])*: `true` or `false` to return the `_source` field or not, or a list of fields to return. +** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude in the response. +** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. +** *`stored_fields` (Optional, string | string[])*: List of stored fields to return as part of a hit. +If no fields are specified, no stored fields are included in the response. +If this field is specified, the `_source` parameter defaults to false. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. [discrete] === exists_source @@ -262,17 +313,52 @@ client.existsSource({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: The document ID -** *`index` (string)*: The name of the index -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`realtime` (Optional, boolean)*: Specify whether to perform the operation in realtime or search mode -** *`refresh` (Optional, boolean)*: Refresh the shard containing the document before performing the operation -** *`routing` (Optional, string)*: Specific routing value -** *`_source` (Optional, boolean | string | string[])*: True or false to return the _source field or not, or a list of fields to return -** *`_source_excludes` (Optional, string | string[])*: A list of fields to exclude from the returned _source field -** *`_source_includes` (Optional, string | string[])*: A list of fields to extract and return from the _source field -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type +** *`id` (string)*: Identifier of the document. +** *`index` (string)*: List of data streams, indices, and aliases. +Supports wildcards (`*`). +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`realtime` (Optional, boolean)*: If true, the request is real-time as opposed to near-real-time. +** *`refresh` (Optional, boolean)*: If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes. +** *`routing` (Optional, string)*: Target the specified primary shard. +** *`_source` (Optional, boolean | string | string[])*: `true` or `false` to return the `_source` field or not, or a list of fields to return. +** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude in the response. +** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. + +[discrete] +=== explain +Returns information about why a specific matches (or doesn't match) a query. + +{ref}/search-explain.html[Endpoint documentation] +[source,ts] +---- +client.explain({ id, index }) +---- +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: Defines the document ID. +** *`index` (string)*: Index names used to limit the request. +Only a single index name can be provided to this parameter. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`analyzer` (Optional, string)*: Analyzer to use for the query string. +This parameter can only be used when the `q` query string parameter is specified. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. +** *`df` (Optional, string)*: Field to use as default where no field prefix is given in the query string. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`_source` (Optional, boolean | string | string[])*: True or false to return the `_source` field or not, or a list of fields to return. +** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude from the response. +** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. +** *`stored_fields` (Optional, string | string[])*: A list of stored fields to return in the response. +** *`q` (Optional, string)*: Query in the Lucene query string syntax. [discrete] === field_caps @@ -288,7 +374,7 @@ client.fieldCaps({ ... }) * *Request (object):* ** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all. -** *`index_filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Allows to filter indices if the provided query rewrites to match_none on every shard. +** *`index_filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Allows to filter indices if the provided query rewrites to match_none on every shard. ** *`allow_no_indices` (Optional, boolean)*: If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar. @@ -313,13 +399,15 @@ client.get({ id, index }) ** *`id` (string)*: Unique identifier of the document. ** *`index` (string)*: Name of the index that contains the document. ** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. Random by default. -** *`realtime` (Optional, boolean)*: Boolean) If true, the request is real-time as opposed to near-real-time. +** *`realtime` (Optional, boolean)*: If `true`, the request is real-time as opposed to near-real-time. ** *`refresh` (Optional, boolean)*: If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. ** *`routing` (Optional, string)*: Target the specified primary shard. ** *`_source` (Optional, boolean | string | string[])*: True or false to return the _source field or not, or a list of fields to return. ** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude in the response. ** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. -** *`stored_fields` (Optional, string | string[])*: A list of stored fields to return in the response +** *`stored_fields` (Optional, string | string[])*: List of stored fields to return as part of a hit. +If no fields are specified, no stored fields are included in the response. +If this field is specified, the `_source` parameter defaults to false. ** *`version` (Optional, number)*: Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. ** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: internal, external, external_gte. @@ -336,7 +424,7 @@ client.getScript({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: Script ID +** *`id` (string)*: Identifier for the stored script or search template. ** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master [discrete] @@ -378,20 +466,30 @@ client.index({ index }) ==== Arguments * *Request (object):* -** *`index` (string)*: The name of the index -** *`id` (Optional, string)*: Document ID +** *`index` (string)*: Name of the data stream or index to target. +** *`id` (Optional, string)*: Unique identifier for the document. ** *`document` (Optional, object)*: A document. -** *`if_primary_term` (Optional, number)*: only perform the index operation if the last operation that has changed the document has the specified primary term -** *`if_seq_no` (Optional, number)*: only perform the index operation if the last operation that has changed the document has the specified sequence number -** *`op_type` (Optional, Enum("index" | "create"))*: Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID -** *`pipeline` (Optional, string)*: The pipeline id to preprocess incoming documents with -** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. -** *`routing` (Optional, string)*: Specific routing value -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -** *`require_alias` (Optional, boolean)*: When true, requires destination to be an alias. Default is false +** *`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. +** *`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. +Same as using the `/_create` endpoint. +Valid values: `index`, `create`. +If document id is specified, it defaults to `index`. +Otherwise, it defaults to `create`. +** *`pipeline` (Optional, string)*: 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` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. +Valid values: `true`, `false`, `wait_for`. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`timeout` (Optional, string | -1 | 0)*: Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). +** *`require_alias` (Optional, boolean)*: If `true`, the destination must be an index alias. [discrete] === info @@ -472,13 +570,17 @@ client.msearchTemplate({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: A list of index names to use as default +** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. +Supports wildcards (`*`). +To search all data streams and indices, omit this parameter or use `*`. ** *`search_templates` (Optional, { allow_no_indices, expand_wildcards, ignore_unavailable, index, preference, request_cache, routing, search_type, ccs_minimize_roundtrips, allow_partial_search_results, ignore_throttled } | { aggregations, collapse, query, explain, ext, stored_fields, docvalue_fields, from, highlight, indices_boost, min_score, post_filter, profile, rescore, script_fields, search_after, size, sort, _source, fields, terminate_after, stats, timeout, track_scores, track_total_hits, version, runtime_mappings, seq_no_primary_term, pit, suggest }[])* -** *`ccs_minimize_roundtrips` (Optional, boolean)*: Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution -** *`max_concurrent_searches` (Optional, number)*: Controls the maximum number of concurrent searches the multi search api will execute -** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: Search operation type -** *`rest_total_hits_as_int` (Optional, boolean)*: Indicates whether hits.total should be rendered as an integer or an object in the rest search response -** *`typed_keys` (Optional, boolean)*: Specify whether aggregation and suggester names should be prefixed by their respective types in the response +** *`ccs_minimize_roundtrips` (Optional, boolean)*: If `true`, network round-trips are minimized for cross-cluster search requests. +** *`max_concurrent_searches` (Optional, number)*: Maximum number of concurrent searches the API can run. +** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. +Available options: `query_then_fetch`, `dfs_query_then_fetch`. +** *`rest_total_hits_as_int` (Optional, boolean)*: If `true`, the response returns `hits.total` as an integer. +If `false`, it returns `hits.total` as an object. +** *`typed_keys` (Optional, boolean)*: If `true`, the response prefixes aggregation and suggester names with their respective types. [discrete] === mtermvectors @@ -493,20 +595,22 @@ client.mtermvectors({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string)*: The index in which the document resides. -** *`docs` (Optional, { _id, _index, routing, _source, stored_fields, version, version_type }[])* -** *`ids` (Optional, string[])* -** *`fields` (Optional, string | string[])*: A list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`field_statistics` (Optional, boolean)*: Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`offsets` (Optional, boolean)*: Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`payloads` (Optional, boolean)*: Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`positions` (Optional, boolean)*: Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`realtime` (Optional, boolean)*: Specifies if requests are real-time as opposed to near-real-time (default: true). -** *`routing` (Optional, string)*: Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`term_statistics` (Optional, boolean)*: Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type +** *`index` (Optional, string)*: Name of the index that contains the documents. +** *`docs` (Optional, { _id, _index, routing, _source, stored_fields, version, version_type }[])*: Array of existing or artificial documents. +** *`ids` (Optional, string[])*: Simplified syntax to specify documents by their ID if they're in the same index. +** *`fields` (Optional, string | string[])*: List or wildcard expressions of fields to include in the statistics. +Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. +** *`field_statistics` (Optional, boolean)*: If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. +** *`offsets` (Optional, boolean)*: If `true`, the response includes term offsets. +** *`payloads` (Optional, boolean)*: If `true`, the response includes term payloads. +** *`positions` (Optional, boolean)*: If `true`, the response includes term positions. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`realtime` (Optional, boolean)*: If true, the request is real-time as opposed to near-real-time. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`term_statistics` (Optional, boolean)*: If true, the response includes term frequency and document frequency. +** *`version` (Optional, number)*: If `true`, returns the document version as part of a hit. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type. [discrete] === open_point_in_time @@ -522,11 +626,14 @@ client.openPointInTime({ index, keep_alive }) * *Request (object):* ** *`index` (string | string[])*: A list of index names to open point in time; use `_all` or empty string to perform the operation on all indices -** *`keep_alive` (string | -1 | 0)*: Specific the time to live for the point in time -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`routing` (Optional, string)*: Specific routing value -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. +** *`keep_alive` (string | -1 | 0)*: Extends the time to live of the corresponding point in time. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] === ping @@ -551,11 +658,15 @@ client.putScript({ id, script }) ==== Arguments * *Request (object):* -** *`id` (string)*: Script ID -** *`script` ({ lang, options, source })* -** *`context` (Optional, string)*: Script context -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout +** *`id` (string)*: Identifier for the stored script or search template. +Must be unique within the cluster. +** *`script` ({ lang, options, source })*: Contains the script or search template, its parameters, and its language. +** *`context` (Optional, string)*: Context in which the script or search template should run. +To prevent errors, the API immediately compiles the script or template in this context. +** *`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] === rank_eval @@ -579,6 +690,39 @@ To target all data streams and indices in a cluster, omit this parameter or use ** *`ignore_unavailable` (Optional, boolean)*: If `true`, missing or closed indices are not included in the response. ** *`search_type` (Optional, string)*: Search operation type +[discrete] +=== reindex +Allows to copy documents from one index to another, optionally filtering the source +documents by a query, changing the destination index settings, or fetching the +documents from a remote cluster. + +{ref}/docs-reindex.html[Endpoint documentation] +[source,ts] +---- +client.reindex({ dest, source }) +---- +[discrete] +==== Arguments + +* *Request (object):* +** *`dest` ({ index, op_type, pipeline, routing, version_type })*: The destination you are copying to. +** *`source` ({ index, query, remote, size, slice, sort, _source, runtime_mappings })*: The source you are copying from. +** *`conflicts` (Optional, Enum("abort" | "proceed"))*: Set to proceed to continue reindexing even if there are conflicts. +** *`max_docs` (Optional, number)*: The maximum number of documents to reindex. +** *`script` (Optional, { lang, options, source } | { id })*: The script to run to update the document source or metadata when reindexing. +** *`size` (Optional, number)* +** *`refresh` (Optional, boolean)*: If `true`, the request refreshes affected shards to make this operation visible to search. +** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. +Defaults to no throttle. +** *`scroll` (Optional, string | -1 | 0)*: Specifies how long a consistent view of the index should be maintained for scrolled search. +** *`slices` (Optional, number | Enum("auto"))*: The number of slices this task should be divided into. +Defaults to 1 slice, meaning the task isn’t sliced into subtasks. +** *`timeout` (Optional, string | -1 | 0)*: Period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). +** *`wait_for_completion` (Optional, boolean)*: If `true`, the request blocks until the operation is complete. +** *`require_alias` (Optional, boolean)*: If `true`, the destination must be an index alias. + [discrete] === render_search_template Allows to use the Mustache language to pre-render a search definition. @@ -592,10 +736,16 @@ client.renderSearchTemplate({ ... }) ==== Arguments * *Request (object):* -** *`id` (Optional, string)*: The id of the stored search template +** *`id` (Optional, string)*: ID of the search template to render. +If no `source` is specified, this or the `id` request body parameter is required. ** *`file` (Optional, string)* -** *`params` (Optional, Record)* -** *`source` (Optional, string)* +** *`params` (Optional, Record)*: Key-value pairs used to replace Mustache variables in the template. +The key is the variable name. +The value is the variable value. +** *`source` (Optional, string)*: An inline search template. +Supports the same parameters as the search API's request body. +These parameters also support Mustache variables. +If no `id` or `` is specified, this parameter is required. [discrete] === scripts_painless_execute @@ -610,9 +760,9 @@ client.scriptsPainlessExecute({ ... }) ==== Arguments * *Request (object):* -** *`context` (Optional, string)* -** *`context_setup` (Optional, { document, index, query })* -** *`script` (Optional, { lang, options, source })* +** *`context` (Optional, string)*: The context that the script should run in. +** *`context_setup` (Optional, { document, index, query })*: Additional parameters for the `context`. +** *`script` (Optional, { lang, options, source })*: The Painless script to execute. [discrete] === scroll @@ -664,12 +814,12 @@ If `false`, the response does not include the total number of hits matching the The request returns doc values for field names matching these patterns in the `hits.fields` property of the response. ** *`min_score` (Optional, number)*: Minimum `_score` for matching documents. Documents with a lower `_score` are not included in the search results. -** *`post_filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Use the `post_filter` parameter to filter search results. +** *`post_filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Use the `post_filter` parameter to filter search results. The search hits are filtered after the aggregations are calculated. A post filter has no impact on the aggregation results. ** *`profile` (Optional, boolean)*: Set to `true` to return detailed timing information about the execution of individual components in a search request. NOTE: This is a debugging tool and adds significant overhead to search execution. -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. ** *`rescore` (Optional, { query, window_size } | { query, window_size }[])*: Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. ** *`script_fields` (Optional, Record)*: Retrieve a script evaluation (based on different fields) for each hit. ** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])*: Used to retrieve the next page of hits using a set of sort values from the previous page. @@ -774,6 +924,65 @@ If the `_source` parameter is `false`, this parameter is ignored. ** *`q` (Optional, string)*: Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing. +[discrete] +=== search_mvt +Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + +{ref}/search-vector-tile-api.html[Endpoint documentation] +[source,ts] +---- +client.searchMvt({ index, field, zoom, x, y }) +---- +[discrete] +==== Arguments + +* *Request (object):* +** *`index` (string | string[])*: List of data streams, indices, or aliases to search +** *`field` (string)*: Field containing geospatial data to return +** *`zoom` (number)*: Zoom level for the vector tile to search +** *`x` (number)*: X coordinate for the vector tile to search +** *`y` (number)*: Y coordinate for the vector tile to search +** *`aggs` (Optional, Record)*: Sub-aggregations for the geotile_grid. + +Supports the following aggregation types: +- avg +- cardinality +- max +- min +- sum +** *`buffer` (Optional, number)*: Size, in pixels, of a clipping buffer outside the tile. This allows renderers +to avoid outline artifacts from geometries that extend past the extent of the tile. +** *`exact_bounds` (Optional, boolean)*: If false, the meta layer’s feature is the bounding box of the tile. +If true, the meta layer’s feature is a bounding box resulting from a +geo_bounds aggregation. The aggregation runs on values that intersect +the // tile with wrap_longitude set to false. The resulting +bounding box may be larger than the vector tile. +** *`extent` (Optional, number)*: Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. +** *`fields` (Optional, string | string[])*: Fields to return in the `hits` layer. Supports wildcards (`*`). +This parameter does not support fields with array values. Fields with array +values may return inconsistent results. +** *`grid_agg` (Optional, Enum("geotile" | "geohex"))*: Aggregation used to create a grid for the `field`. +** *`grid_precision` (Optional, number)*: Additional zoom levels available through the aggs layer. For example, if is 7 +and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results +don’t include the aggs layer. +** *`grid_type` (Optional, Enum("grid" | "point" | "centroid"))*: Determines the geometry type for features in the aggs layer. In the aggs layer, +each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon +of the cells bounding box. If 'point' each feature is a Point that is the centroid +of the cell. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Query DSL used to filter documents for the search. +** *`runtime_mappings` (Optional, Record)*: Defines one or more runtime fields in the search request. These fields take +precedence over mapped fields with the same name. +** *`size` (Optional, number)*: Maximum number of features to return in the hits layer. Accepts 0-10000. +If 0, results don’t include the hits layer. +** *`sort` (Optional, string | { _score, _doc, _geo_distance, _script } | string | { _score, _doc, _geo_distance, _script }[])*: Sorts features in the hits layer. By default, the API calculates a bounding +box for each feature. It sorts features based on this box’s diagonal length, +from longest to shortest. +** *`track_total_hits` (Optional, boolean | number)*: Number of hits matching the query to count accurately. If `true`, the exact number +of hits is returned at the cost of some performance. If `false`, the response does +not include the total number of hits matching the query. +** *`with_labels` (Optional, boolean)*: If `true`, the hits and aggs layers will contain additional point features representing +suggested label positions for the original features. + [discrete] === search_template Allows to use the Mustache language to pre-render a search definition. @@ -789,25 +998,33 @@ client.searchTemplate({ ... }) * *Request (object):* ** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. Supports wildcards (*). -** *`explain` (Optional, boolean)* +** *`explain` (Optional, boolean)*: If `true`, returns detailed information about score calculation as part of each hit. ** *`id` (Optional, string)*: ID of the search template to use. If no source is specified, this parameter is required. -** *`params` (Optional, Record)* -** *`profile` (Optional, boolean)* +** *`params` (Optional, Record)*: Key-value pairs used to replace Mustache variables in the template. +The key is the variable name. +The value is the variable value. +** *`profile` (Optional, boolean)*: If `true`, the query execution is profiled. ** *`source` (Optional, string)*: An inline search template. Supports the same parameters as the search API's request body. Also supports Mustache variables. If no id is specified, this parameter is required. -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`ccs_minimize_roundtrips` (Optional, boolean)*: Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`ignore_throttled` (Optional, boolean)*: Whether specified concrete, expanded or aliased indices should be ignored when throttled -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. +** *`ccs_minimize_roundtrips` (Optional, boolean)*: If `true`, network round-trips are minimized for cross-cluster search requests. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`ignore_throttled` (Optional, boolean)*: If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. ** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. ** *`scroll` (Optional, string | -1 | 0)*: Specifies how long a consistent view of the index should be maintained for scrolled search. ** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. -** *`typed_keys` (Optional, boolean)*: Specify whether aggregation and suggester names should be prefixed by their respective types in the response +** *`typed_keys` (Optional, boolean)*: If `true`, the response prefixes aggregation and suggester names with their respective types. [discrete] === terms_enum @@ -827,7 +1044,7 @@ client.termsEnum({ index, field }) ** *`size` (Optional, number)*: How many matching terms to return. ** *`timeout` (Optional, string | -1 | 0)*: The maximum length of time to spend collecting results. Defaults to "1s" (one second). If the timeout is exceeded the complete flag set to false in the response and the results may be partial or empty. ** *`case_insensitive` (Optional, boolean)*: When true the provided search string is matched against index terms without case sensitivity. -** *`index_filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Allows to filter an index shard if the provided query rewrites to match_none. +** *`index_filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Allows to filter an index shard if the provided query rewrites to match_none. ** *`string` (Optional, string)*: The string after which terms in the index should be returned. Allows for a form of pagination if the last result from one request is passed as the search_after parameter for a subsequent request. ** *`search_after` (Optional, string)* @@ -844,22 +1061,24 @@ client.termvectors({ index }) ==== Arguments * *Request (object):* -** *`index` (string)*: The index in which the document resides. -** *`id` (Optional, string)*: The id of the document, when not specified a doc param should be supplied. -** *`doc` (Optional, object)*: A document. -** *`filter` (Optional, { max_doc_freq, max_num_terms, max_term_freq, max_word_length, min_doc_freq, min_term_freq, min_word_length })* -** *`per_field_analyzer` (Optional, Record)* -** *`fields` (Optional, string | string[])*: A list of fields to return. -** *`field_statistics` (Optional, boolean)*: Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. -** *`offsets` (Optional, boolean)*: Specifies if term offsets should be returned. -** *`payloads` (Optional, boolean)*: Specifies if term payloads should be returned. -** *`positions` (Optional, boolean)*: Specifies if term positions should be returned. -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random). -** *`realtime` (Optional, boolean)*: Specifies if request is real-time as opposed to near-real-time (default: true). -** *`routing` (Optional, string)*: Specific routing value. -** *`term_statistics` (Optional, boolean)*: Specifies if total term frequency and document frequency should be returned. -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type +** *`index` (string)*: Name of the index that contains the document. +** *`id` (Optional, string)*: Unique identifier of the document. +** *`doc` (Optional, object)*: An artificial document (a document not present in the index) for which you want to retrieve term vectors. +** *`filter` (Optional, { max_doc_freq, max_num_terms, max_term_freq, max_word_length, min_doc_freq, min_term_freq, min_word_length })*: Filter terms based on their tf-idf scores. +** *`per_field_analyzer` (Optional, Record)*: Overrides the default per-field analyzer. +** *`fields` (Optional, string | string[])*: List or wildcard expressions of fields to include in the statistics. +Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. +** *`field_statistics` (Optional, boolean)*: If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. +** *`offsets` (Optional, boolean)*: If `true`, the response includes term offsets. +** *`payloads` (Optional, boolean)*: If `true`, the response includes term payloads. +** *`positions` (Optional, boolean)*: If `true`, the response includes term positions. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`realtime` (Optional, boolean)*: If true, the request is real-time as opposed to near-real-time. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`term_statistics` (Optional, boolean)*: If `true`, the response includes term frequency and document frequency. +** *`version` (Optional, number)*: If `true`, returns the document version as part of a hit. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type. [discrete] === update @@ -918,40 +1137,57 @@ client.updateByQuery({ index }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index names to search; use `_all` or empty string to perform the operation on all indices -** *`max_docs` (Optional, number)* -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })* -** *`script` (Optional, { lang, options, source } | { id })* -** *`slice` (Optional, { field, id, max })* -** *`conflicts` (Optional, Enum("abort" | "proceed"))* -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`analyzer` (Optional, string)*: The analyzer to use for the query string -** *`analyze_wildcard` (Optional, boolean)*: Specify whether wildcard and prefix queries should be analyzed (default: false) -** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query (AND or OR) -** *`df` (Optional, string)*: The field to use as default where no field prefix is given in the query string -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. +** *`index` (string | string[])*: List of data streams, indices, and aliases to search. +Supports wildcards (`*`). +To search all data streams or indices, omit this parameter or use `*` or `_all`. +** *`max_docs` (Optional, number)*: The maximum number of documents to update. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Specifies the documents to update using the Query DSL. +** *`script` (Optional, { lang, options, source } | { id })*: The script to run to update the document source or metadata when updating. +** *`slice` (Optional, { field, id, max })*: Slice the request manually using the provided slice ID and total number of slices. +** *`conflicts` (Optional, Enum("abort" | "proceed"))*: What to do if update by query hits version conflicts: `abort` or `proceed`. +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. +** *`analyzer` (Optional, string)*: Analyzer to use for the query string. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. +** *`df` (Optional, string)*: Field to use as default where no field prefix is given in the query string. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. ** *`from` (Optional, number)*: Starting offset (default: 0) -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`lenient` (Optional, boolean)*: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -** *`pipeline` (Optional, string)*: Ingest pipeline to set on index requests made by this action. (default: none) -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`refresh` (Optional, boolean)*: Should the affected indexes be refreshed? -** *`request_cache` (Optional, boolean)*: Specify if request cache should be used for this request or not, defaults to index level setting -** *`requests_per_second` (Optional, float)*: The throttle to set on this request in sub-requests per second. -1 means no throttle. -** *`routing` (Optional, string)*: A list of specific routing values -** *`scroll` (Optional, string | -1 | 0)*: Specify how long a consistent view of the index should be maintained for scrolled search -** *`scroll_size` (Optional, number)*: Size on the scroll request powering the update by query -** *`search_timeout` (Optional, string | -1 | 0)*: Explicit timeout for each search request. Defaults to no timeout. -** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: Search operation type -** *`slices` (Optional, number | Enum("auto"))*: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. -** *`sort` (Optional, string[])*: A list of : pairs -** *`stats` (Optional, string[])*: Specific 'tag' of the request for logging and statistical purposes -** *`terminate_after` (Optional, number)*: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -** *`timeout` (Optional, string | -1 | 0)*: Time each individual bulk request should wait for shards that are unavailable. -** *`version` (Optional, boolean)*: Specify whether to return document version as part of a hit +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. +** *`pipeline` (Optional, string)*: 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. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`refresh` (Optional, boolean)*: If `true`, Elasticsearch refreshes affected shards to make the operation visible to search. +** *`request_cache` (Optional, boolean)*: If `true`, the request cache is used for this request. +** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`scroll` (Optional, string | -1 | 0)*: Period to retain the search context for scrolling. +** *`scroll_size` (Optional, number)*: Size of the scroll request that powers the operation. +** *`search_timeout` (Optional, string | -1 | 0)*: Explicit timeout for each search request. +** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. +** *`slices` (Optional, number | Enum("auto"))*: The number of slices this task should be divided into. +** *`sort` (Optional, string[])*: A list of : pairs. +** *`stats` (Optional, string[])*: Specific `tag` of the request for logging and statistical purposes. +** *`terminate_after` (Optional, number)*: Maximum number of documents to collect for each shard. +If a query reaches this limit, Elasticsearch terminates the query early. +Elasticsearch collects documents before sorting. +Use with caution. +Elasticsearch applies this parameter to each shard handling the request. +When possible, let Elasticsearch perform early termination automatically. +Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. +** *`timeout` (Optional, string | -1 | 0)*: Period each update request waits for the following operations: dynamic mapping updates, waiting for active shards. +** *`version` (Optional, boolean)*: If `true`, returns the document version as part of a hit. ** *`version_type` (Optional, boolean)*: Should the document increment the version number (internal) on hit or not (reindex) -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -** *`wait_for_completion` (Optional, boolean)*: Should the request should block until the update by query operation is complete. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). +** *`wait_for_completion` (Optional, boolean)*: If `true`, the request blocks until the operation is complete. [discrete] === async_search @@ -1044,9 +1280,9 @@ Defaults to 10,000 hits. names matching these patterns in the hits.fields property of the response. ** *`min_score` (Optional, number)*: Minimum _score for matching documents. Documents with a lower _score are not included in the search results. -** *`post_filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })* +** *`post_filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })* ** *`profile` (Optional, boolean)* -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. ** *`rescore` (Optional, { query, window_size } | { query, window_size }[])* ** *`script_fields` (Optional, Record)*: Retrieve a script evaluation (based on different fields) for each hit. ** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])* @@ -1397,27 +1633,6 @@ If `false`, information is retrieved from the master node. ** *`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_settings -Returns cluster settings. - -{ref}/cluster-get-settings.html[Endpoint documentation] -[source,ts] ----- -client.cluster.getSettings({ ... }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`flat_settings` (Optional, boolean)*: If `true`, returns settings in flat format. -** *`include_defaults` (Optional, boolean)*: If `true`, returns default cluster settings from the local node. -** *`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] ==== info Returns different information about the cluster. @@ -1434,26 +1649,6 @@ client.cluster.info({ target }) * *Request (object):* ** *`target` (Enum("_all" | "http" | "ingest" | "thread_pool" | "script") | Enum("_all" | "http" | "ingest" | "thread_pool" | "script")[])*: Limits the information returned to the specific target. Supports a list, such as http,ingest. -[discrete] -==== pending_tasks -Returns a list of any cluster-level changes (e.g. create index, update mapping, -allocate or fail shard) which have not yet been executed. - -{ref}/cluster-pending.html[Endpoint documentation] -[source,ts] ----- -client.cluster.pendingTasks({ ... }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`local` (Optional, boolean)*: If `true`, the request retrieves information from the local node only. -If `false`, information is retrieved from the master node. -** *`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_component_template Creates or updates a component template @@ -1489,46 +1684,6 @@ To unset `_meta`, replace the template without specifying this information. ** *`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_settings -Updates the cluster settings. - -{ref}/cluster-update-settings.html[Endpoint documentation] -[source,ts] ----- -client.cluster.putSettings({ ... }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`persistent` (Optional, Record)* -** *`transient` (Optional, Record)* -** *`flat_settings` (Optional, boolean)*: Return settings in flat format (default: false) -** *`master_timeout` (Optional, string | -1 | 0)*: Explicit operation timeout for connection to master node -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout - -[discrete] -==== stats -Returns high-level overview of cluster statistics. - -{ref}/cluster-stats.html[Endpoint documentation] -[source,ts] ----- -client.cluster.stats({ ... }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`node_id` (Optional, string | string[])*: List of node filters used to limit returned information. Defaults to all nodes in the cluster. -** *`flat_settings` (Optional, boolean)*: If `true`, returns settings in flat format. -** *`timeout` (Optional, string | -1 | 0)*: Period to wait for each node to respond. -If a node does not respond before its timeout expires, the response does not include its stats. -However, timed out nodes are included in the response’s `_nodes.failed` property. Defaults to no timeout. - [discrete] === enrich [discrete] @@ -1545,7 +1700,7 @@ client.enrich.deletePolicy({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the enrich policy +** *`name` (string)*: Enrich policy to delete. [discrete] ==== execute_policy @@ -1561,8 +1716,8 @@ client.enrich.executePolicy({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the enrich policy -** *`wait_for_completion` (Optional, boolean)*: Should the request should block until the execution is complete. +** *`name` (string)*: Enrich policy to execute. +** *`wait_for_completion` (Optional, boolean)*: If `true`, the request blocks other enrich policy execution requests until complete. [discrete] ==== get_policy @@ -1578,7 +1733,8 @@ client.enrich.getPolicy({ ... }) ==== Arguments * *Request (object):* -** *`name` (Optional, string | string[])*: A list of enrich policy names +** *`name` (Optional, string | string[])*: List of enrich policy names used to limit the request. +To return information for all enrich policies, omit this parameter. [discrete] ==== put_policy @@ -1594,10 +1750,10 @@ client.enrich.putPolicy({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the enrich policy -** *`geo_match` (Optional, { enrich_fields, indices, match_field, query, name, elasticsearch_version })* -** *`match` (Optional, { enrich_fields, indices, match_field, query, name, elasticsearch_version })* -** *`range` (Optional, { enrich_fields, indices, match_field, query, name, elasticsearch_version })* +** *`name` (string)*: Name of the enrich policy to create or update. +** *`geo_match` (Optional, { enrich_fields, indices, match_field, query, name, elasticsearch_version })*: Matches enrich data to incoming documents based on a `geo_shape` query. +** *`match` (Optional, { enrich_fields, indices, match_field, query, name, elasticsearch_version })*: Matches enrich data to incoming documents based on a `term` query. +** *`range` (Optional, { enrich_fields, indices, match_field, query, name, elasticsearch_version })*: Matches a number, date, or IP address in incoming documents to a range in the enrich index based on a `term` query. [discrete] ==== stats @@ -1610,6 +1766,94 @@ client.enrich.stats() ---- +[discrete] +=== eql +[discrete] +==== delete +Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + +{ref}/eql-search-api.html[Endpoint documentation] +[source,ts] +---- +client.eql.delete({ id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: Identifier for the search to delete. +A search ID is provided in the EQL search API's response for an async search. +A search ID is also provided if the request’s `keep_on_completion` parameter is `true`. + +[discrete] +==== get +Returns async results from previously executed Event Query Language (EQL) search + +{ref}/get-async-eql-search-api.html[Endpoint documentation] +[source,ts] +---- +client.eql.get({ id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: Identifier for the search. +** *`keep_alive` (Optional, string | -1 | 0)*: Period for which the search and its results are stored on the cluster. +Defaults to the keep_alive value set by the search’s EQL search API request. +** *`wait_for_completion_timeout` (Optional, string | -1 | 0)*: Timeout duration to wait for the request to finish. +Defaults to no timeout, meaning the request waits for complete search results. + +[discrete] +==== get_status +Returns the status of a previously submitted async or stored Event Query Language (EQL) search + +{ref}/get-async-eql-status-api.html[Endpoint documentation] +[source,ts] +---- +client.eql.getStatus({ id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: Identifier for the search. + +[discrete] +==== search +Returns results matching a query expressed in Event Query Language (EQL) + +{ref}/eql-search-api.html[Endpoint documentation] +[source,ts] +---- +client.eql.search({ index, query }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`index` (string | string[])*: The name of the index to scope the operation +** *`query` (string)*: EQL query you wish to run. +** *`case_sensitive` (Optional, boolean)* +** *`event_category_field` (Optional, string)*: Field containing the event classification, such as process, file, or network. +** *`tiebreaker_field` (Optional, string)*: Field used to sort hits with the same timestamp in ascending order +** *`timestamp_field` (Optional, string)*: Field containing event timestamp. Default "@timestamp" +** *`fetch_size` (Optional, number)*: Maximum number of events to search at a time for sequence queries. +** *`filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type } | { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type }[])*: Query, written in Query DSL, used to filter the events on which the EQL query runs. +** *`keep_alive` (Optional, string | -1 | 0)* +** *`keep_on_completion` (Optional, boolean)* +** *`wait_for_completion_timeout` (Optional, string | -1 | 0)* +** *`size` (Optional, number)*: For basic queries, the maximum number of matching events to return. Defaults to 10 +** *`fields` (Optional, { field, format, include_unmapped } | { field, format, include_unmapped }[])*: Array of wildcard (*) patterns. The response returns values for field names matching these patterns in the fields property of each hit. +** *`result_position` (Optional, Enum("tail" | "head"))* +** *`allow_no_indices` (Optional, boolean)* +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])* +** *`ignore_unavailable` (Optional, boolean)*: If true, missing or closed indices are not included in the response. + [discrete] === graph [discrete] @@ -1626,16 +1870,40 @@ client.graph.explore({ index }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index names to search; use `_all` or empty string to perform the operation on all indices -** *`connections` (Optional, { connections, query, vertices })* -** *`controls` (Optional, { sample_diversity, sample_size, timeout, use_significance })* -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })* -** *`vertices` (Optional, { exclude, field, include, min_doc_count, shard_min_doc_count, size }[])* -** *`routing` (Optional, string)*: Specific routing value -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout +** *`index` (string | string[])*: Name of the index. +** *`connections` (Optional, { connections, query, vertices })*: Specifies or more fields from which you want to extract terms that are associated with the specified vertices. +** *`controls` (Optional, { sample_diversity, sample_size, timeout, use_significance })*: Direct the Graph API how to build the graph. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: A seed query that identifies the documents of interest. Can be any valid Elasticsearch query. +** *`vertices` (Optional, { exclude, field, include, min_doc_count, shard_min_doc_count, size }[])*: Specifies one or more fields that contain the terms you want to include in the graph as vertices. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`timeout` (Optional, string | -1 | 0)*: Specifies the period of time to wait for a response from each shard. +If no response is received before the timeout expires, the request fails and returns an error. +Defaults to no timeout. [discrete] === indices +[discrete] +==== add_block +Adds a block to an index. + +{ref}/index-modules-blocks.html[Endpoint documentation] +[source,ts] +---- +client.indices.addBlock({ index, block }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`index` (string)*: A comma separated list of indices to add a block to +** *`block` (Enum("metadata" | "read" | "read_only" | "write"))*: The block to add (one of read, write, read_only or metadata) +** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. +** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) +** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master +** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout + [discrete] ==== analyze Performs the analysis process on a text and return the tokens breakdown of the text. @@ -1650,16 +1918,22 @@ client.indices.analyze({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string)*: The name of the index to scope the operation -** *`analyzer` (Optional, string)* -** *`attributes` (Optional, string[])* -** *`char_filter` (Optional, string | { type } | { type, mappings, mappings_path } | { type, flags, pattern, replacement } | { type, mode, name } | { type, normalize_kana, normalize_kanji }[])* -** *`explain` (Optional, boolean)* -** *`field` (Optional, string)* -** *`filter` (Optional, string | { type, preserve_original } | { type, common_words, common_words_path, ignore_case, query_mode } | { type, filter, script } | { type, delimiter, encoding } | { type, max_gram, min_gram, side, preserve_original } | { type, articles, articles_path, articles_case } | { type, max_output_size, separator } | { type, dedup, dictionary, locale, longest_only } | { type } | { type, mode, types } | { type, keep_words, keep_words_case, keep_words_path } | { type, ignore_case, keywords, keywords_path, keywords_pattern } | { type } | { type, max, min } | { type, consume_all_tokens, max_token_count } | { type, language } | { type, filters, preserve_original } | { type, max_gram, min_gram, preserve_original } | { type, stoptags } | { type, patterns, preserve_original } | { type, all, flags, pattern, replacement } | { type } | { type, script } | { type } | { type } | { type, filler_token, max_shingle_size, min_shingle_size, output_unigrams, output_unigrams_if_no_shingles, token_separator } | { type, language } | { type, rules, rules_path } | { type, language } | { type, ignore_case, remove_trailing, stopwords, stopwords_path } | { type, expand, format, lenient, synonyms, synonyms_path, tokenizer, updateable } | { type, expand, format, lenient, synonyms, synonyms_path, tokenizer, updateable } | { type } | { type, length } | { type, only_on_same_position } | { type } | { type, adjust_offsets, catenate_all, catenate_numbers, catenate_words, generate_number_parts, generate_word_parts, ignore_keywords, preserve_original, protected_words, protected_words_path, split_on_case_change, split_on_numerics, stem_english_possessive, type_table, type_table_path } | { type, catenate_all, catenate_numbers, catenate_words, generate_number_parts, generate_word_parts, preserve_original, protected_words, protected_words_path, split_on_case_change, split_on_numerics, stem_english_possessive, type_table, type_table_path } | { type, minimum_length } | { type, use_romaji } | { type, stoptags } | { type, rule_files } | { type, alternate, caseFirst, caseLevel, country, decomposition, hiraganaQuaternaryMode, language, numeric, rules, strength, variableTop, variant } | { type, unicode_set_filter } | { type, name } | { type, dir, id } | { type, encoder, languageset, max_code_len, name_type, replace, rule_type } | { type }[])* -** *`normalizer` (Optional, string)* -** *`text` (Optional, string | string[])* -** *`tokenizer` (Optional, string | { type, tokenize_on_chars, max_token_length } | { type, custom_token_chars, max_gram, min_gram, token_chars } | { type, buffer_size } | { type } | { type } | { type, custom_token_chars, max_gram, min_gram, token_chars } | { type, decompound_mode, discard_punctuation, user_dictionary, user_dictionary_rules } | { type, buffer_size, delimiter, replacement, reverse, skip } | { type, max_token_length } | { type, max_token_length } | { type, max_token_length } | { type, discard_punctuation, mode, nbest_cost, nbest_examples, user_dictionary, user_dictionary_rules, discard_compound_token } | { type, flags, group, pattern } | { type, rule_files })* +** *`index` (Optional, string)*: Index used to derive the analyzer. +If specified, the `analyzer` or field parameter overrides this value. +If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer. +** *`analyzer` (Optional, string)*: The name of the analyzer that should be applied to the provided `text`. +This could be a built-in analyzer, or an analyzer that’s been configured in the index. +** *`attributes` (Optional, string[])*: Array of token attributes used to filter the output of the `explain` parameter. +** *`char_filter` (Optional, string | { type } | { type, mappings, mappings_path } | { type, flags, pattern, replacement } | { type, mode, name } | { type, normalize_kana, normalize_kanji }[])*: Array of character filters used to preprocess characters before the tokenizer. +** *`explain` (Optional, boolean)*: If `true`, the response includes token attributes and additional details. +** *`field` (Optional, string)*: Field used to derive the analyzer. +To use this parameter, you must specify an index. +If specified, the `analyzer` parameter overrides this value. +** *`filter` (Optional, string | { type, preserve_original } | { type, common_words, common_words_path, ignore_case, query_mode } | { type, filter, script } | { type, delimiter, encoding } | { type, max_gram, min_gram, side, preserve_original } | { type, articles, articles_path, articles_case } | { type, max_output_size, separator } | { type, dedup, dictionary, locale, longest_only } | { type } | { type, mode, types } | { type, keep_words, keep_words_case, keep_words_path } | { type, ignore_case, keywords, keywords_path, keywords_pattern } | { type } | { type, max, min } | { type, consume_all_tokens, max_token_count } | { type, language } | { type, filters, preserve_original } | { type, max_gram, min_gram, preserve_original } | { type, stoptags } | { type, patterns, preserve_original } | { type, all, flags, pattern, replacement } | { type } | { type, script } | { type } | { type } | { type, filler_token, max_shingle_size, min_shingle_size, output_unigrams, output_unigrams_if_no_shingles, token_separator } | { type, language } | { type, rules, rules_path } | { type, language } | { type, ignore_case, remove_trailing, stopwords, stopwords_path } | { type, expand, format, lenient, synonyms, synonyms_path, tokenizer, updateable } | { type, expand, format, lenient, synonyms, synonyms_path, tokenizer, updateable } | { type } | { type, length } | { type, only_on_same_position } | { type } | { type, adjust_offsets, catenate_all, catenate_numbers, catenate_words, generate_number_parts, generate_word_parts, ignore_keywords, preserve_original, protected_words, protected_words_path, split_on_case_change, split_on_numerics, stem_english_possessive, type_table, type_table_path } | { type, catenate_all, catenate_numbers, catenate_words, generate_number_parts, generate_word_parts, preserve_original, protected_words, protected_words_path, split_on_case_change, split_on_numerics, stem_english_possessive, type_table, type_table_path } | { type, minimum_length } | { type, use_romaji } | { type, stoptags } | { type, rule_files } | { type, alternate, caseFirst, caseLevel, country, decomposition, hiraganaQuaternaryMode, language, numeric, rules, strength, variableTop, variant } | { type, unicode_set_filter } | { type, name } | { type, dir, id } | { type, encoder, languageset, max_code_len, name_type, replace, rule_type } | { type }[])*: Array of token filters used to apply after the tokenizer. +** *`normalizer` (Optional, string)*: Normalizer to use to convert text into a single token. +** *`text` (Optional, string | string[])*: Text to analyze. +If an array of strings is provided, it is analyzed as a multi-value field. +** *`tokenizer` (Optional, string | { type, tokenize_on_chars, max_token_length } | { type, custom_token_chars, max_gram, min_gram, token_chars } | { type, buffer_size } | { type } | { type } | { type, custom_token_chars, max_gram, min_gram, token_chars } | { type, decompound_mode, discard_punctuation, user_dictionary, user_dictionary_rules } | { type, buffer_size, delimiter, replacement, reverse, skip } | { type, max_token_length } | { type, max_token_length } | { type, max_token_length } | { type, discard_punctuation, mode, nbest_cost, nbest_examples, user_dictionary, user_dictionary_rules, discard_compound_token } | { type, flags, group, pattern } | { type, rule_files })*: Tokenizer to use to convert text into tokens. [discrete] ==== create @@ -1675,16 +1949,19 @@ client.indices.create({ index }) ==== Arguments * *Request (object):* -** *`index` (string)*: The name of the index -** *`aliases` (Optional, Record)* +** *`index` (string)*: Name of the index you wish to create. +** *`aliases` (Optional, Record)*: Aliases for the index. ** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled })*: Mapping for fields in the index. If specified, this mapping can include: - Field names - Field data types - Mapping parameters -** *`settings` (Optional, { index, mode, routing_path, soft_deletes, sort, number_of_shards, number_of_replicas, number_of_routing_shards, check_on_startup, codec, routing_partition_size, load_fixed_bitset_filters_eagerly, hidden, auto_expand_replicas, merge, search, refresh_interval, max_result_window, max_inner_result_window, max_rescore_window, max_docvalue_fields_search, max_script_fields, max_ngram_diff, max_shingle_diff, blocks, max_refresh_listeners, analyze, highlight, max_terms_count, max_regex_length, routing, gc_deletes, default_pipeline, final_pipeline, lifecycle, provided_name, creation_date, creation_date_string, uuid, version, verified_before_close, format, max_slices_per_scroll, translog, query_string, priority, top_metrics_max_size, analysis, settings, time_series, shards, queries, similarity, mapping, indexing.slowlog, indexing_pressure, store })* -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Set the number of active shards to wait for before the operation returns. +** *`settings` (Optional, { index, mode, routing_path, soft_deletes, sort, number_of_shards, number_of_replicas, number_of_routing_shards, check_on_startup, codec, routing_partition_size, load_fixed_bitset_filters_eagerly, hidden, auto_expand_replicas, merge, search, refresh_interval, max_result_window, max_inner_result_window, max_rescore_window, max_docvalue_fields_search, max_script_fields, max_ngram_diff, max_shingle_diff, blocks, max_refresh_listeners, analyze, highlight, max_terms_count, max_regex_length, routing, gc_deletes, default_pipeline, final_pipeline, lifecycle, provided_name, creation_date, creation_date_string, uuid, version, verified_before_close, format, max_slices_per_scroll, translog, query_string, priority, top_metrics_max_size, analysis, settings, time_series, shards, queries, similarity, mapping, indexing.slowlog, indexing_pressure, store })*: Configuration options for the index. +** *`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. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). [discrete] ==== create_data_stream @@ -1741,12 +2018,21 @@ client.indices.delete({ index }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of indices to delete; use `_all` or `*` string to delete all indices -** *`allow_no_indices` (Optional, boolean)*: Ignore if a wildcard expression resolves to no concrete indices (default: false) -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether wildcard expressions should get expanded to open, closed, or hidden indices -** *`ignore_unavailable` (Optional, boolean)*: Ignore unavailable indexes (default: false) -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout +** *`index` (string | string[])*: List of indices to delete. +You cannot specify index aliases. +By default, this parameter does not support wildcards (`*`) or `_all`. +To use wildcards or `_all`, set the `action.destructive_requires_name` cluster setting to `false`. +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`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] ==== delete_alias @@ -1762,16 +2048,20 @@ client.indices.deleteAlias({ index, name }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index names (supports wildcards); use `_all` for all indices -** *`name` (string | string[])*: A list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit timestamp for the document +** *`index` (string | string[])*: List of data streams or indices used to limit the request. +Supports wildcards (`*`). +** *`name` (string | string[])*: List of aliases to remove. +Supports wildcards (`*`). To remove all aliases, use `*` or `_all`. +** *`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] ==== delete_data_lifecycle -Deletes the data lifecycle of the selected data streams. +Deletes the data stream lifecycle of the selected data streams. -{ref}/dlm-delete-lifecycle.html[Endpoint documentation] +{ref}/data-streams-delete-lifecycle.html[Endpoint documentation] [source,ts] ---- client.indices.deleteDataLifecycle({ name }) @@ -1781,7 +2071,7 @@ client.indices.deleteDataLifecycle({ name }) ==== Arguments * *Request (object):* -** *`name` (string | string[])*: A list of data streams of which the data lifecycle will be deleted; use `*` to get all data streams +** *`name` (string | string[])*: A list of data streams of which the data stream lifecycle will be deleted; use `*` to get all data streams ** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether wildcard expressions should get expanded to open or closed indices (default: open) ** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master ** *`timeout` (Optional, string | -1 | 0)*: Explicit timestamp for the document @@ -1821,45 +2111,6 @@ client.indices.deleteIndexTemplate({ name }) ** *`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] -==== delete_template -Deletes an index template. - -{ref}/indices-templates.html[Endpoint documentation] -[source,ts] ----- -client.indices.deleteTemplate({ name }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`name` (string)*: The name of the template -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout - -[discrete] -==== disk_usage -Analyzes the disk usage of each field of an index or data stream - -{ref}/indices-disk-usage.html[Endpoint documentation] -[source,ts] ----- -client.indices.diskUsage({ index }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`index` (string | string[])*: List of data streams, indices, and aliases used to limit the request. It’s recommended to execute this API with a single index (or the latest backing index of a data stream) as the API consumes resources significantly. -** *`allow_no_indices` (Optional, boolean)*: If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports a list of values, such as open,hidden. -** *`flush` (Optional, boolean)*: If true, the API performs a flush before analysis. If false, the response may not include uncommitted data. -** *`ignore_unavailable` (Optional, boolean)*: If true, missing or closed indices are not included in the response. -** *`run_expensive_tasks` (Optional, boolean)*: Analyzing field disk usage is resource-intensive. To use the API, this parameter must be set to true. - [discrete] ==== exists Returns information about whether a particular index exists. @@ -1874,13 +2125,17 @@ client.indices.exists({ index }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index names -** *`allow_no_indices` (Optional, boolean)*: Ignore if a wildcard expression resolves to no concrete indices (default: false) -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether wildcard expressions should get expanded to open or closed indices (default: open) -** *`flat_settings` (Optional, boolean)*: Return settings in flat format (default: false) -** *`ignore_unavailable` (Optional, boolean)*: Ignore unavailable indexes (default: false) -** *`include_defaults` (Optional, boolean)*: Whether to return all default setting for each of the indices. -** *`local` (Optional, boolean)*: Return local information, do not retrieve the state from master node (default: false) +** *`index` (string | string[])*: List of data streams, indices, and aliases. Supports wildcards (`*`). +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`flat_settings` (Optional, boolean)*: If `true`, returns settings in flat format. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`include_defaults` (Optional, boolean)*: If `true`, return all default settings in the response. +** *`local` (Optional, boolean)*: If `true`, the request retrieves information from the local node only. [discrete] ==== exists_alias @@ -1896,12 +2151,17 @@ client.indices.existsAlias({ name }) ==== Arguments * *Request (object):* -** *`name` (string | string[])*: A list of alias names to return -** *`index` (Optional, string | string[])*: A list of index names to filter aliases -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`local` (Optional, boolean)*: Return local information, do not retrieve the state from master node (default: false) +** *`name` (string | string[])*: List of aliases to check. Supports wildcards (`*`). +** *`index` (Optional, string | string[])*: List of data streams or indices used to limit the request. Supports wildcards (`*`). +To target all data streams and indices, omit this parameter or use `*` or `_all`. +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, requests that include a missing data stream or index in the target indices or data streams return an error. +** *`local` (Optional, boolean)*: If `true`, the request retrieves information from the local node only. [discrete] ==== exists_index_template @@ -1920,30 +2180,11 @@ client.indices.existsIndexTemplate({ name }) ** *`name` (string)*: List of index template names used to limit the request. Wildcard (*) expressions are supported. ** *`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] -==== exists_template -Returns information about whether a particular index template exists. - -{ref}/indices-templates.html[Endpoint documentation] -[source,ts] ----- -client.indices.existsTemplate({ name }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`name` (string | string[])*: The comma separated names of the index templates -** *`flat_settings` (Optional, boolean)*: Return settings in flat format (default: false) -** *`local` (Optional, boolean)*: Return local information, do not retrieve the state from master node (default: false) -** *`master_timeout` (Optional, string | -1 | 0)*: Explicit operation timeout for connection to master node - [discrete] ==== explain_data_lifecycle -Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. +Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. -{ref}/dlm-explain-lifecycle.html[Endpoint documentation] +{ref}/data-streams-explain-lifecycle.html[Endpoint documentation] [source,ts] ---- client.indices.explainDataLifecycle({ index }) @@ -1999,18 +2240,26 @@ client.indices.getAlias({ ... }) ==== Arguments * *Request (object):* -** *`name` (Optional, string | string[])*: A list of alias names to return -** *`index` (Optional, string | string[])*: A list of index names to filter aliases -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`local` (Optional, boolean)*: Return local information, do not retrieve the state from master node (default: false) +** *`name` (Optional, string | string[])*: List of aliases to retrieve. +Supports wildcards (`*`). +To retrieve all aliases, omit this parameter or use `*` or `_all`. +** *`index` (Optional, string | string[])*: List of data streams or indices used to limit the request. +Supports wildcards (`*`). +To target all data streams and indices, omit this parameter or use `*` or `_all`. +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`local` (Optional, boolean)*: If `true`, the request retrieves information from the local node only. [discrete] ==== get_data_lifecycle -Returns the data lifecycle of the selected data streams. +Returns the data stream lifecycle of the selected data streams. -{ref}/dlm-get-lifecycle.html[Endpoint documentation] +{ref}/data-streams-get-lifecycle.html[Endpoint documentation] [source,ts] ---- client.indices.getDataLifecycle({ name }) @@ -2020,9 +2269,13 @@ client.indices.getDataLifecycle({ name }) ==== Arguments * *Request (object):* -** *`name` (string | string[])*: A list of data streams to get; use `*` to get all data streams -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether wildcard expressions should get expanded to open or closed indices (default: open) -** *`include_defaults` (Optional, boolean)*: Return all relevant default configurations for the data stream (default: false) +** *`name` (string | string[])*: List of data streams to limit the request. +Supports wildcards (`*`). +To target all data streams, omit this parameter or use `*` or `_all`. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of data stream that wildcard patterns can match. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`include_defaults` (Optional, boolean)*: If `true`, return all default settings in the response. [discrete] ==== get_data_stream @@ -2076,12 +2329,19 @@ client.indices.getMapping({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: A list of index names -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`local` (Optional, boolean)*: Return local information, do not retrieve the state from master node (default: false) -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master +** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases used to limit the request. +Supports wildcards (`*`). +To target all data streams and indices, omit this parameter or use `*` or `_all`. +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`local` (Optional, boolean)*: If `true`, the request retrieves information from the local node only. +** *`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_settings @@ -2118,25 +2378,6 @@ Supports a list of values, such as `open,hidden`. received before the timeout expires, the request fails and returns an error. -[discrete] -==== get_template -Returns an index template. - -{ref}/indices-templates.html[Endpoint documentation] -[source,ts] ----- -client.indices.getTemplate({ ... }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`name` (Optional, string | string[])*: The comma separated names of the index templates -** *`flat_settings` (Optional, boolean)*: Return settings in flat format (default: false) -** *`local` (Optional, boolean)*: Return local information, do not retrieve the state from master node (default: false) -** *`master_timeout` (Optional, string | -1 | 0)*: Explicit operation timeout for connection to master node - [discrete] ==== migrate_to_data_stream Migrates an alias to a data stream @@ -2183,21 +2424,35 @@ client.indices.putAlias({ index, name }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. -** *`name` (string)*: The name of the alias to be created or updated -** *`filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })* -** *`index_routing` (Optional, string)* -** *`is_write_index` (Optional, boolean)* -** *`routing` (Optional, string)* -** *`search_routing` (Optional, string)* -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit timestamp for the document +** *`index` (string | string[])*: List of data streams or indices to add. +Supports wildcards (`*`). +Wildcard patterns that match both data streams and indices return an error. +** *`name` (string)*: Alias to update. +If the alias doesn’t exist, the request creates it. +Index alias names support date math. +** *`filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Query used to limit documents the alias can access. +** *`index_routing` (Optional, string)*: Value used to route indexing operations to a specific shard. +If specified, this overwrites the `routing` value for indexing operations. +Data stream aliases don’t support this parameter. +** *`is_write_index` (Optional, boolean)*: If `true`, sets the write index or data stream for the alias. +If an alias points to multiple indices or data streams and `is_write_index` isn’t set, the alias rejects write requests. +If an index alias points to one index and `is_write_index` isn’t set, the index automatically acts as the write index. +Data stream aliases don’t automatically set a write data stream, even if the alias points to one data stream. +** *`routing` (Optional, string)*: Value used to route indexing and search operations to a specific shard. +Data stream aliases don’t support this parameter. +** *`search_routing` (Optional, string)*: Value used to route search operations to a specific shard. +If specified, this overwrites the `routing` value for search operations. +Data stream aliases don’t support this parameter. +** *`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] ==== put_data_lifecycle -Updates the data lifecycle of the selected data streams. +Updates the data stream lifecycle of the selected data streams. -{ref}/dlm-put-lifecycle.html[Endpoint documentation] +{ref}/data-streams-put-lifecycle.html[Endpoint documentation] [source,ts] ---- client.indices.putDataLifecycle({ name }) @@ -2207,11 +2462,22 @@ client.indices.putDataLifecycle({ name }) ==== Arguments * *Request (object):* -** *`name` (string | string[])*: A list of data streams whose lifecycle will be updated; use `*` to set the lifecycle to all data streams -** *`data_retention` (Optional, string | -1 | 0)* -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether wildcard expressions should get expanded to open or closed indices (default: open) -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit timestamp for the document +** *`name` (string | string[])*: List of data streams used to limit the request. +Supports wildcards (`*`). +To target all data streams use `*` or `_all`. +** *`data_retention` (Optional, string | -1 | 0)*: If defined, every document added to this data stream will be stored at least for this time frame. +Any time after this duration the document could be deleted. +When empty, every document in this data stream will be stored indefinitely. +** *`downsampling` (Optional, { rounds })*: If defined, every backing index will execute the configured downsampling configuration after the backing +index is not the data stream write index anymore. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of data stream that wildcard patterns can match. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `hidden`, `open`, `closed`, `none`. +** *`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] ==== put_index_template @@ -2228,14 +2494,24 @@ client.indices.putIndexTemplate({ name }) * *Request (object):* ** *`name` (string)*: Index or template name -** *`index_patterns` (Optional, string | string[])* -** *`composed_of` (Optional, string[])* -** *`template` (Optional, { aliases, mappings, settings })* -** *`data_stream` (Optional, { hidden })* -** *`priority` (Optional, number)* -** *`version` (Optional, number)* -** *`_meta` (Optional, Record)* -** *`create` (Optional, boolean)*: Whether the index template should only be added if new or can also replace an existing one +** *`index_patterns` (Optional, string | string[])*: Name of the index template to create. +** *`composed_of` (Optional, string[])*: An ordered list of component template names. +Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. +** *`template` (Optional, { aliases, mappings, settings })*: Template to be applied. +It may optionally include an `aliases`, `mappings`, or `settings` configuration. +** *`data_stream` (Optional, { hidden })*: If this object is included, the template is used to create data streams and their backing indices. +Supports an empty object. +Data streams require a matching index template with a `data_stream` object. +** *`priority` (Optional, number)*: Priority to determine index template precedence when a new data stream or index is created. +The index template with the highest priority is chosen. +If no priority is specified the template is treated as though it is of priority 0 (lowest priority). +This number is not automatically generated by Elasticsearch. +** *`version` (Optional, number)*: Version number used to manage index templates externally. +This number is not automatically generated by Elasticsearch. +** *`_meta` (Optional, Record)*: Optional user metadata about the index template. +May have any contents. +This map is not automatically generated by Elasticsearch. +** *`create` (Optional, boolean)*: If `true`, this request cannot replace or update existing index templates. [discrete] ==== put_mapping @@ -2271,12 +2547,18 @@ application-specific metadata. ** *`_routing` (Optional, { required })*: Enable making a routing value required on indexed documents. ** *`_source` (Optional, { compress, compress_threshold, enabled, excludes, includes, mode })*: Control whether the _source field is enabled on the index. ** *`runtime` (Optional, Record)*: Mapping of runtime fields for the index. -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`write_index_only` (Optional, boolean)*: When true, applies mappings only to the write index of an alias or data stream +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`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. +** *`write_index_only` (Optional, boolean)*: If `true`, the mappings are applied only to the current write index for the target. [discrete] ==== put_settings @@ -2342,10 +2624,36 @@ Templates with lower 'order' values are merged first. Templates with higher ** *`version` (Optional, number)*: Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch. ** *`create` (Optional, boolean)*: If true, this request cannot replace or update existing index templates. -** *`flat_settings` (Optional, boolean)* +** *`flat_settings` (Optional, boolean)*: If `true`, returns settings in flat format. ** *`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)* +** *`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] +==== refresh +Performs the refresh operation in one or more indices. + +{ref}/indices-refresh.html[Endpoint documentation] +[source,ts] +---- +client.indices.refresh({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases used to limit the request. +Supports wildcards (`*`). +To target all data streams and indices, omit this parameter or use `*` or `_all`. +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. [discrete] ==== resolve_index @@ -2361,8 +2669,12 @@ client.indices.resolveIndex({ name }) ==== Arguments * *Request (object):* -** *`name` (string | string[])*: A list of names or wildcard expressions -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether wildcard expressions should get expanded to open or closed indices (default: open) +** *`name` (string | string[])*: Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve. +Resources on remote clusters can be specified using the ``:`` syntax. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== rollover @@ -2379,16 +2691,28 @@ client.indices.rollover({ alias }) ==== Arguments * *Request (object):* -** *`alias` (string)*: The name of the alias to rollover -** *`new_index` (Optional, string)*: The name of the rollover index -** *`aliases` (Optional, Record)* -** *`conditions` (Optional, { min_age, max_age, max_age_millis, min_docs, max_docs, max_size, max_size_bytes, min_size, min_size_bytes, max_primary_shard_size, max_primary_shard_size_bytes, min_primary_shard_size, min_primary_shard_size_bytes, max_primary_shard_docs, min_primary_shard_docs })* -** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled })* -** *`settings` (Optional, Record)* -** *`dry_run` (Optional, boolean)*: If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Set the number of active shards to wait for on the newly created rollover index before the operation returns. +** *`alias` (string)*: Name of the data stream or index alias to roll over. +** *`new_index` (Optional, string)*: Name of the index to create. +Supports date math. +Data streams do not support this parameter. +** *`aliases` (Optional, Record)*: Aliases for the target index. +Data streams do not support this parameter. +** *`conditions` (Optional, { min_age, max_age, max_age_millis, min_docs, max_docs, max_size, max_size_bytes, min_size, min_size_bytes, max_primary_shard_size, max_primary_shard_size_bytes, min_primary_shard_size, min_primary_shard_size_bytes, max_primary_shard_docs, min_primary_shard_docs })*: Conditions for the rollover. +If specified, Elasticsearch only performs the rollover if the current index satisfies these conditions. +If this parameter is not specified, Elasticsearch performs the rollover unconditionally. +If conditions are specified, at least one of them must be a `max_*` condition. +The index will rollover if any `max_*` condition is satisfied and all `min_*` conditions are satisfied. +** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled })*: Mapping for fields in the index. +If specified, this mapping can include field names, field data types, and mapping paramaters. +** *`settings` (Optional, Record)*: Configuration options for the index. +Data streams do not support this parameter. +** *`dry_run` (Optional, boolean)*: If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover. +** *`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. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). [discrete] ==== simulate_index_template @@ -2405,14 +2729,26 @@ client.indices.simulateIndexTemplate({ name }) * *Request (object):* ** *`name` (string)*: Index or template name to simulate -** *`allow_auto_create` (Optional, boolean)* -** *`index_patterns` (Optional, string | string[])* -** *`composed_of` (Optional, string[])* -** *`template` (Optional, { aliases, mappings, settings })* -** *`data_stream` (Optional, { hidden })* -** *`priority` (Optional, number)* -** *`version` (Optional, number)* -** *`_meta` (Optional, Record)* +** *`allow_auto_create` (Optional, boolean)*: This setting overrides the value of the `action.auto_create_index` cluster setting. +If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. +If set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. +** *`index_patterns` (Optional, string | string[])*: Array of wildcard (`*`) expressions used to match the names of data streams and indices during creation. +** *`composed_of` (Optional, string[])*: An ordered list of component template names. +Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. +** *`template` (Optional, { aliases, mappings, settings })*: Template to be applied. +It may optionally include an `aliases`, `mappings`, or `settings` configuration. +** *`data_stream` (Optional, { hidden })*: If this object is included, the template is used to create data streams and their backing indices. +Supports an empty object. +Data streams require a matching index template with a `data_stream` object. +** *`priority` (Optional, number)*: Priority to determine index template precedence when a new data stream or index is created. +The index template with the highest priority is chosen. +If no priority is specified the template is treated as though it is of priority 0 (lowest priority). +This number is not automatically generated by Elasticsearch. +** *`version` (Optional, number)*: Version number used to manage index templates externally. +This number is not automatically generated by Elasticsearch. +** *`_meta` (Optional, Record)*: Optional user metadata about the index template. +May have any contents. +This map is not automatically generated by Elasticsearch. ** *`create` (Optional, boolean)*: If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not @@ -2455,9 +2791,11 @@ client.indices.updateAliases({ ... }) ==== Arguments * *Request (object):* -** *`actions` (Optional, { add_backing_index, remove_backing_index }[])* -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Request timeout +** *`actions` (Optional, { add_backing_index, remove_backing_index }[])*: Actions to perform. +** *`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] ==== validate_query @@ -2473,20 +2811,28 @@ client.indices.validateQuery({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: A list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })* -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`all_shards` (Optional, boolean)*: Execute validation on all shards instead of one random shard per index -** *`analyzer` (Optional, string)*: The analyzer to use for the query string -** *`analyze_wildcard` (Optional, boolean)*: Specify whether wildcard and prefix queries should be analyzed (default: false) -** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query (AND or OR) -** *`df` (Optional, string)*: The field to use as default where no field prefix is given in the query string -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`explain` (Optional, boolean)*: Return detailed information about the error -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`lenient` (Optional, boolean)*: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -** *`rewrite` (Optional, boolean)*: Provide a more detailed explanation showing the actual Lucene query that will be executed. -** *`q` (Optional, string)*: Query in the Lucene query string syntax +** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. +Supports wildcards (`*`). +To search all data streams or indices, omit this parameter or use `*` or `_all`. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Query in the Lucene query string syntax. +** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. +This behavior applies even if the request targets other open indices. +** *`all_shards` (Optional, boolean)*: If `true`, the validation is executed on all shards instead of one random shard per index. +** *`analyzer` (Optional, string)*: Analyzer to use for the query string. +This parameter can only be used when the `q` query string parameter is specified. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. +** *`df` (Optional, string)*: Field to use as default where no field prefix is given in the query string. +This parameter can only be used when the `q` query string parameter is specified. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. +If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. +Supports a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`explain` (Optional, boolean)*: If `true`, the response returns detailed information if an error has occurred. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. +** *`rewrite` (Optional, boolean)*: If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed. +** *`q` (Optional, string)*: Query in the Lucene query string syntax. [discrete] === ingest @@ -2504,9 +2850,12 @@ client.ingest.deletePipeline({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: Pipeline ID -** *`master_timeout` (Optional, string | -1 | 0)*: Explicit operation timeout for connection to master node -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout +** *`id` (string)*: Pipeline ID or wildcard expression of pipeline IDs used to limit the request. +To delete all ingest pipelines in a cluster, use a value of `*`. +** *`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_pipeline @@ -2522,8 +2871,11 @@ client.ingest.getPipeline({ ... }) ==== Arguments * *Request (object):* -** *`id` (Optional, string)*: Comma separated list of pipeline ids. Wildcards supported -** *`master_timeout` (Optional, string | -1 | 0)*: Explicit operation timeout for connection to master node +** *`id` (Optional, string)*: List of pipeline IDs to retrieve. +Wildcard (`*`) expressions are supported. +To get all ingest pipelines, omit this parameter or use `*`. +** *`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. ** *`summary` (Optional, boolean)*: Return pipelines without their definitions (default: false) [discrete] @@ -2541,7 +2893,7 @@ client.ingest.processorGrok() ==== put_pipeline Creates or updates a pipeline. -{ref}/put-pipeline-api.html[Endpoint documentation] +{ref}/ingest.html[Endpoint documentation] [source,ts] ---- client.ingest.putPipeline({ id }) @@ -2565,20 +2917,43 @@ client.ingest.putPipeline({ id }) ==== simulate Allows to simulate a pipeline with example documents. -{ref}/simulate-pipeline-api.html[Endpoint documentation] +{ref}/simulate-pipeline-api.html[Endpoint documentation] +[source,ts] +---- +client.ingest.simulate({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (Optional, string)*: Pipeline to test. +If you don’t specify a `pipeline` in the request body, this parameter is required. +** *`docs` (Optional, { _id, _index, _source }[])*: Sample documents to test in the pipeline. +** *`pipeline` (Optional, { description, on_failure, processors, version })*: Pipeline to test. +If you don’t specify the `pipeline` request path parameter, this parameter is required. +If you specify both this and the request path parameter, the API only uses the request path parameter. +** *`verbose` (Optional, boolean)*: If `true`, the response includes output data for each processor in the executed pipeline. + +[discrete] +=== license +[discrete] +==== get +Retrieves licensing information for the cluster + +{ref}/get-license.html[Endpoint documentation] [source,ts] ---- -client.ingest.simulate({ ... }) +client.license.get({ ... }) ---- [discrete] ==== Arguments * *Request (object):* -** *`id` (Optional, string)*: Pipeline ID -** *`docs` (Optional, { _id, _index, _source }[])* -** *`pipeline` (Optional, { description, on_failure, processors, version })* -** *`verbose` (Optional, boolean)*: Verbose mode. Display data output for each processor in executed pipeline +** *`accept_enterprise` (Optional, boolean)*: If `true`, this parameter returns enterprise for Enterprise license types. If `false`, this parameter returns platinum for both platinum and enterprise license types. This behavior is maintained for backwards compatibility. +This parameter is deprecated and will always be set to true in 8.x. +** *`local` (Optional, boolean)*: Specifies whether to retrieve local information. The default value is `false`, which means the information is retrieved from the master node. [discrete] === logstash @@ -2596,7 +2971,7 @@ client.logstash.deletePipeline({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: The ID of the Pipeline +** *`id` (string)*: Identifier for the pipeline. [discrete] ==== get_pipeline @@ -2612,7 +2987,7 @@ client.logstash.getPipeline({ id }) ==== Arguments * *Request (object):* -** *`id` (string | string[])*: A list of Pipeline IDs +** *`id` (string | string[])*: List of pipeline identifiers. [discrete] ==== put_pipeline @@ -2628,7 +3003,7 @@ client.logstash.putPipeline({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: The ID of the Pipeline +** *`id` (string)*: Identifier for the pipeline. ** *`pipeline` (Optional, { description, on_failure, processors, version })* [discrete] @@ -2682,8 +3057,9 @@ client.ml.deleteCalendarEvent({ calendar_id, event_id }) ==== Arguments * *Request (object):* -** *`calendar_id` (string)*: The ID of the calendar to modify -** *`event_id` (string)*: The ID of the event to remove from the calendar +** *`calendar_id` (string)*: A string that uniquely identifies a calendar. +** *`event_id` (string)*: Identifier for the scheduled event. +You can obtain this identifier by using the get calendar events API. [discrete] ==== delete_calendar_job @@ -2860,7 +3236,7 @@ client.ml.evaluateDataFrame({ evaluation, index }) * *Request (object):* ** *`evaluation` ({ classification, outlier_detection, regression })*: Defines the type of evaluation you want to perform. ** *`index` (string)*: Defines the `index` in which the evaluation will be performed. -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: A query clause that retrieves a subset of data from the source index. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: A query clause that retrieves a subset of data from the source index. [discrete] ==== flush_job @@ -3217,6 +3593,27 @@ subset of results when there are partial matches. ** *`from` (Optional, number)*: Skips the specified number of models. ** *`size` (Optional, number)*: Specifies the maximum number of models to obtain. +[discrete] +==== infer_trained_model +Evaluate a trained model. + +{ref}/infer-trained-model.html[Endpoint documentation] +[source,ts] +---- +client.ml.inferTrainedModel({ model_id, docs }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`model_id` (string)*: The unique identifier of the trained model. +** *`docs` (Record[])*: An array of objects to pass to the model for inference. The objects should contain a fields matching your +configured trained model input. Typically, for NLP models, the field name is `text_field`. +Currently, for NLP models, only a single value is allowed. +** *`inference_config` (Optional, { regression, classification, text_classification, zero_shot_classification, fill_mask, ner, pass_through, text_embedding, text_expansion, question_answering })*: The inference configuration updates to apply on the API call +** *`timeout` (Optional, string | -1 | 0)*: Controls the amount of time to wait for inference results. + [discrete] ==== open_job Opens one or more anomaly detection jobs. @@ -3441,7 +3838,7 @@ learning nodes must have the `remote_cluster_client` role. stops and closes the associated job after this many real-time searches return no documents. In other words, it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no end time that sees no data remains started until it is explicitly stopped. By default, it is not set. -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. ** *`query_delay` (Optional, string | -1 | 0)*: The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might @@ -3541,6 +3938,13 @@ ELSER the config is not required. ** *`model_size_bytes` (Optional, number)*: The estimated memory usage in bytes to keep the trained model in memory. This property is supported only if defer_definition_decompression is true or the model definition is not supplied. +** *`platform_architecture` (Optional, string)*: The platform architecture (if applicable) of the trained mode. If the model +only works on one platform, because it is heavily optimized for a particular +processor architecture and OS combination, then this field specifies which. +The format of the string must match the platform identifiers used by Elasticsearch, +so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`, +or `windows-x86_64`. For portable models (those that work independent of processor +architecture or OS features), leave this field unset. ** *`tags` (Optional, string[])*: An array of tags to organize the model. [discrete] @@ -3843,7 +4247,7 @@ learning nodes must have the `remote_cluster_client` role. stops and closes the associated job after this many real-time searches return no documents. In other words, it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no end time that sees no data remains started until it is explicitly stopped. By default, it is not set. -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also changed. Therefore, the time required to learn might be long and the understandability of the results is @@ -3956,6 +4360,74 @@ value is null, which means all results are retained. ** *`detectors` (Optional, { by_field_name, custom_rules, detector_description, detector_index, exclude_frequent, field_name, function, over_field_name, partition_field_name, use_null }[])*: An array of detector update objects. ** *`per_partition_categorization` (Optional, { enabled, stop_on_warn })*: Settings related to how categorization interacts with partition fields. +[discrete] +=== query_ruleset +[discrete] +==== delete +Deletes a query ruleset. + +{ref}/delete-query-ruleset.html[Endpoint documentation] +[source,ts] +---- +client.queryRuleset.delete({ ruleset_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`ruleset_id` (string)*: The unique identifier of the query ruleset to delete + +[discrete] +==== get +Returns the details about a query ruleset. + +{ref}/get-query-ruleset.html[Endpoint documentation] +[source,ts] +---- +client.queryRuleset.get({ ruleset_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`ruleset_id` (string)*: The unique identifier of the query ruleset + +[discrete] +==== list +Lists query rulesets. + +{ref}/list-query-rulesets.html[Endpoint documentation] +[source,ts] +---- +client.queryRuleset.list({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`from` (Optional, number)*: Starting offset (default: 0) +** *`size` (Optional, number)*: specifies a max number of results to get + +[discrete] +==== put +Creates or updates a query ruleset. + +{ref}/put-query-ruleset.html[Endpoint documentation] +[source,ts] +---- +client.queryRuleset.put({ ruleset_id, rules }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`ruleset_id` (string)*: The unique identifier of the query ruleset to be created or updated +** *`rules` ({ rule_id, type, criteria, actions }[])* + [discrete] === search_application [discrete] @@ -4036,9 +4508,9 @@ client.searchApplication.list({ ... }) ==== Arguments * *Request (object):* -** *`q` (Optional, string)*: Query in the Lucene query string syntax" -** *`from` (Optional, number)*: Starting offset (default: 0) -** *`size` (Optional, number)*: specifies a max number of results to get +** *`q` (Optional, string)*: Query in the Lucene query string syntax. +** *`from` (Optional, number)*: Starting offset. +** *`size` (Optional, number)*: Specifies a max number of results to get. [discrete] ==== put @@ -4054,9 +4526,9 @@ client.searchApplication.put({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the search application to be created or updated +** *`name` (string)*: The name of the search application to be created or updated. ** *`search_application` (Optional, { name, indices, updated_at_millis, analytics_collection_name, template })* -** *`create` (Optional, boolean)*: If true, requires that a search application with the specified resource_id does not already exist. (default: false) +** *`create` (Optional, boolean)*: If `true`, this request cannot replace or update existing Search Applications. [discrete] ==== put_behavioral_analytics @@ -4072,7 +4544,7 @@ client.searchApplication.putBehavioralAnalytics({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the analytics collection to be created or updated +** *`name` (string)*: The name of the analytics collection to be created or updated. [discrete] ==== search @@ -4088,8 +4560,8 @@ client.searchApplication.search({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the search application to be searched -** *`params` (Optional, Record)* +** *`name` (string)*: The name of the search application to be searched. +** *`params` (Optional, Record)*: Query parameters specific to this request, which will override any defaults specified in the template. [discrete] === security @@ -4104,24 +4576,6 @@ client.security.authenticate() ---- -[discrete] -==== clear_api_key_cache -Clear a subset or all entries from the API key cache. - -{ref}/security-api-clear-api-key-cache.html[Endpoint documentation] -[source,ts] ----- -client.security.clearApiKeyCache({ ids }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`ids` (string | string[])*: List of API key IDs to evict from the API key cache. -To evict all API keys, use `*`. -Does not support other wildcard patterns. - [discrete] ==== create_api_key Creates an API key for access without requiring basic authentication. @@ -4167,6 +4621,25 @@ This parameter cannot be used with either `id` or `name` or when `owner` flag is ** *`username` (Optional, string)*: The username of a user. This parameter cannot be used with either `id` or `name` or when `owner` flag is set to `true`. +[discrete] +==== has_privileges +Determines whether the specified user has a specified list of privileges. + +{ref}/security-api-has-privileges.html[Endpoint documentation] +[source,ts] +---- +client.security.hasPrivileges({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`user` (Optional, string)*: Username +** *`application` (Optional, { application, privileges, resources }[])* +** *`cluster` (Optional, Enum("all" | "cancel_task" | "create_snapshot" | "grant_api_key" | "manage" | "manage_api_key" | "manage_ccr" | "manage_enrich" | "manage_ilm" | "manage_index_templates" | "manage_ingest_pipelines" | "manage_logstash_pipelines" | "manage_ml" | "manage_oidc" | "manage_own_api_key" | "manage_pipeline" | "manage_rollup" | "manage_saml" | "manage_security" | "manage_service_account" | "manage_slm" | "manage_token" | "manage_transform" | "manage_user_profile" | "manage_watcher" | "monitor" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "read_ccr" | "read_ilm" | "read_pipeline" | "read_slm" | "transport_client")[])*: A list of the cluster privileges that you want to check. +** *`index` (Optional, { names, privileges, allow_restricted_indices }[])* + [discrete] ==== invalidate_api_key Invalidates one or more API keys. @@ -4207,7 +4680,7 @@ client.security.queryApiKeys({ ... }) ==== Arguments * *Request (object):* -** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: A query to filter which API keys to return. +** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: A query to filter which API keys to return. The query supports a subset of query types, including `match_all`, `bool`, `term`, `terms`, `ids`, `prefix`, `wildcard`, and `range`. You can query all public information associated with an API key. ** *`from` (Optional, number)*: Starting document offset. @@ -4238,6 +4711,276 @@ client.security.updateApiKey({ id }) ** *`role_descriptors` (Optional, Record)*: An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API. ** *`metadata` (Optional, Record)*: Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with _ are reserved for system usage. +[discrete] +=== sql +[discrete] +==== clear_cursor +Clears the SQL cursor + +{ref}/clear-sql-cursor-api.html[Endpoint documentation] +[source,ts] +---- +client.sql.clearCursor({ cursor }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`cursor` (string)*: Cursor to clear. + +[discrete] +==== delete_async +Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. + +{ref}/delete-async-sql-search-api.html[Endpoint documentation] +[source,ts] +---- +client.sql.deleteAsync({ id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: Identifier for the search. + +[discrete] +==== get_async +Returns the current status and available results for an async SQL search or stored synchronous SQL search + +{ref}/get-async-sql-search-api.html[Endpoint documentation] +[source,ts] +---- +client.sql.getAsync({ id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: Identifier for the search. +** *`delimiter` (Optional, string)*: Separator for CSV results. The API only supports this parameter for CSV responses. +** *`format` (Optional, string)*: Format for the response. You must specify a format using this parameter or the +Accept HTTP header. If you specify both, the API uses this parameter. +** *`keep_alive` (Optional, string | -1 | 0)*: Retention period for the search and its results. Defaults +to the `keep_alive` period for the original SQL search. +** *`wait_for_completion_timeout` (Optional, string | -1 | 0)*: Period to wait for complete results. Defaults to no timeout, +meaning the request waits for complete search results. + +[discrete] +==== get_async_status +Returns the current status of an async SQL search or a stored synchronous SQL search + +{ref}/get-async-sql-search-status-api.html[Endpoint documentation] +[source,ts] +---- +client.sql.getAsyncStatus({ id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: Identifier for the search. + +[discrete] +==== query +Executes a SQL request + +{ref}/sql-search-api.html[Endpoint documentation] +[source,ts] +---- +client.sql.query({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`catalog` (Optional, string)*: Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only. +** *`columnar` (Optional, boolean)*: If true, the results in a columnar fashion: one row represents all the values of a certain column from the current page of results. +** *`cursor` (Optional, string)*: Cursor used to retrieve a set of paginated results. +If you specify a cursor, the API only uses the `columnar` and `time_zone` request body parameters. +It ignores other request body parameters. +** *`fetch_size` (Optional, number)*: The maximum number of rows (or entries) to return in one response +** *`filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Elasticsearch query DSL for additional filtering. +** *`query` (Optional, string)*: SQL query to run. +** *`request_timeout` (Optional, string | -1 | 0)*: The timeout before the request fails. +** *`page_timeout` (Optional, string | -1 | 0)*: The timeout before a pagination request fails. +** *`time_zone` (Optional, string)*: ISO-8601 time zone ID for the search. +** *`field_multi_value_leniency` (Optional, boolean)*: Throw an exception when encountering multiple values for a field (default) or be lenient and return the first value from the list (without any guarantees of what that will be - typically the first in natural ascending order). +** *`runtime_mappings` (Optional, Record)*: Defines one or more runtime fields in the search request. These fields take +precedence over mapped fields with the same name. +** *`wait_for_completion_timeout` (Optional, string | -1 | 0)*: Period to wait for complete results. Defaults to no timeout, meaning the request waits for complete search results. If the search doesn’t finish within this period, the search becomes async. +** *`params` (Optional, Record)*: Values for parameters in the query. +** *`keep_alive` (Optional, string | -1 | 0)*: Retention period for an async or saved synchronous search. +** *`keep_on_completion` (Optional, boolean)*: If true, Elasticsearch stores synchronous searches if you also specify the wait_for_completion_timeout parameter. If false, Elasticsearch only stores async searches that don’t finish before the wait_for_completion_timeout. +** *`index_using_frozen` (Optional, boolean)*: If true, the search can run on frozen indices. Defaults to false. +** *`format` (Optional, string)*: Format for the response. + +[discrete] +==== translate +Translates SQL into Elasticsearch queries + +{ref}/sql-translate-api.html[Endpoint documentation] +[source,ts] +---- +client.sql.translate({ query }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`query` (string)*: SQL query to run. +** *`fetch_size` (Optional, number)*: The maximum number of rows (or entries) to return in one response. +** *`filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Elasticsearch query DSL for additional filtering. +** *`time_zone` (Optional, string)*: ISO-8601 time zone ID for the search. + +[discrete] +=== synonyms +[discrete] +==== delete_synonym +Deletes a synonym set + +{ref}/delete-synonyms-set.html[Endpoint documentation] +[source,ts] +---- +client.synonyms.deleteSynonym({ id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: The id of the synonyms set to be deleted + +[discrete] +==== delete_synonym_rule +Deletes a synonym rule in a synonym set + +{ref}/delete-synonym-rule.html[Endpoint documentation] +[source,ts] +---- +client.synonyms.deleteSynonymRule({ set_id, rule_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`set_id` (string)*: The id of the synonym set to be updated +** *`rule_id` (string)*: The id of the synonym rule to be deleted + +[discrete] +==== get_synonym +Retrieves a synonym set + +{ref}/get-synonyms-set.html[Endpoint documentation] +[source,ts] +---- +client.synonyms.getSynonym({ id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: "The id of the synonyms set to be retrieved +** *`from` (Optional, number)*: Starting offset for query rules to be retrieved +** *`size` (Optional, number)*: specifies a max number of query rules to retrieve + +[discrete] +==== get_synonym_rule +Retrieves a synonym rule from a synonym set + +{ref}/get-synonym-rule.html[Endpoint documentation] +[source,ts] +---- +client.synonyms.getSynonymRule({ set_id, rule_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`set_id` (string)*: The id of the synonym set to retrieve the synonym rule from +** *`rule_id` (string)*: The id of the synonym rule to retrieve + +[discrete] +==== get_synonyms_sets +Retrieves a summary of all defined synonym sets + +{ref}/list-synonyms-sets.html[Endpoint documentation] +[source,ts] +---- +client.synonyms.getSynonymsSets({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`from` (Optional, number)*: Starting offset +** *`size` (Optional, number)*: specifies a max number of results to get + +[discrete] +==== put_synonym +Creates or updates a synonyms set + +{ref}/put-synonyms-set.html[Endpoint documentation] +[source,ts] +---- +client.synonyms.putSynonym({ id, synonyms_set }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: The id of the synonyms set to be created or updated +** *`synonyms_set` ({ id, synonyms }[])*: The synonym set information to update + +[discrete] +==== put_synonym_rule +Creates or updates a synonym rule in a synonym set + +{ref}/put-synonym-rule.html[Endpoint documentation] +[source,ts] +---- +client.synonyms.putSynonymRule({ set_id, rule_id, synonyms }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`set_id` (string)*: The id of the synonym set to be updated with the synonym rule +** *`rule_id` (string)*: The id of the synonym rule to be updated or created +** *`synonyms` (string[])* + +[discrete] +=== tasks +[discrete] +==== get +Returns information about a task. + +{ref}/tasks.html[Endpoint documentation] +[source,ts] +---- +client.tasks.get({ task_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`task_id` (string)*: ID of the task. +** *`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. +** *`wait_for_completion` (Optional, boolean)*: If `true`, the request blocks until the task has completed. + [discrete] === transform [discrete] diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index 84c66a3..9a51b2d 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -45,7 +45,7 @@ export default class AsyncSearch { /** * Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/async-search.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation} */ async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -71,7 +71,7 @@ export default class AsyncSearch { /** * Retrieves the results of a previously submitted async search request given its ID. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/async-search.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation} */ async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> @@ -97,7 +97,7 @@ export default class AsyncSearch { /** * Retrieves the status of a previously submitted async search request given its ID. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/async-search.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation} */ async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -123,7 +123,7 @@ export default class AsyncSearch { /** * Executes a search request asynchronously. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/async-search.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation} */ async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise> async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/bulk.ts b/src/api/api/bulk.ts index ed16fe3..f84ea17 100644 --- a/src/api/api/bulk.ts +++ b/src/api/api/bulk.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Allows to perform multiple index/update/delete operations in a single request. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-bulk.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html | Elasticsearch API documentation} */ export default async function BulkApi (this: That, params: T.BulkRequest | TB.BulkRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function BulkApi (this: That, params: T.BulkRequest | TB.BulkRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/cat.ts b/src/api/api/cat.ts index 7683ddd..23b57db 100644 --- a/src/api/api/cat.ts +++ b/src/api/api/cat.ts @@ -45,7 +45,7 @@ export default class Cat { /** * Shows information about currently configured aliases to indices including filter and routing infos. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat-alias.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html | Elasticsearch API documentation} */ async aliases (this: That, params?: T.CatAliasesRequest | TB.CatAliasesRequest, options?: TransportRequestOptionsWithOutMeta): Promise async aliases (this: That, params?: T.CatAliasesRequest | TB.CatAliasesRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -79,7 +79,7 @@ export default class Cat { /** * Returns information about existing component_templates templates. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat-component-templates.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html | Elasticsearch API documentation} */ async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -113,7 +113,7 @@ export default class Cat { /** * Provides quick access to the document count of the entire cluster, or individual indices. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat-count.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html | Elasticsearch API documentation} */ async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithOutMeta): Promise async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -147,7 +147,7 @@ export default class Cat { /** * Returns help for the Cat APIs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html | Elasticsearch API documentation} */ async help (this: That, params?: T.CatHelpRequest | TB.CatHelpRequest, options?: TransportRequestOptionsWithOutMeta): Promise async help (this: That, params?: T.CatHelpRequest | TB.CatHelpRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -174,7 +174,7 @@ export default class Cat { /** * Returns information about indices: number of primaries and replicas, document counts, disk size, ... - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat-indices.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html | Elasticsearch API documentation} */ async indices (this: That, params?: T.CatIndicesRequest | TB.CatIndicesRequest, options?: TransportRequestOptionsWithOutMeta): Promise async indices (this: That, params?: T.CatIndicesRequest | TB.CatIndicesRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -208,7 +208,7 @@ export default class Cat { /** * Gets configuration and usage information about data frame analytics jobs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat-dfanalytics.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-dfanalytics.html | Elasticsearch API documentation} */ async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest | TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest | TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -242,7 +242,7 @@ export default class Cat { /** * Gets configuration and usage information about datafeeds. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat-datafeeds.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-datafeeds.html | Elasticsearch API documentation} */ async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest | TB.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest | TB.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -276,7 +276,7 @@ export default class Cat { /** * Gets configuration and usage information about anomaly detection jobs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat-anomaly-detectors.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-anomaly-detectors.html | Elasticsearch API documentation} */ async mlJobs (this: That, params?: T.CatMlJobsRequest | TB.CatMlJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async mlJobs (this: That, params?: T.CatMlJobsRequest | TB.CatMlJobsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -310,7 +310,7 @@ export default class Cat { /** * Gets configuration and usage information about inference trained models. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat-trained-model.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-trained-model.html | Elasticsearch API documentation} */ async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest | TB.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest | TB.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -344,7 +344,7 @@ export default class Cat { /** * Gets configuration and usage information about transforms. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cat-transforms.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-transforms.html | Elasticsearch API documentation} */ async transforms (this: That, params?: T.CatTransformsRequest | TB.CatTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async transforms (this: That, params?: T.CatTransformsRequest | TB.CatTransformsRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/clear_scroll.ts b/src/api/api/clear_scroll.ts index 6ebf550..99eae72 100644 --- a/src/api/api/clear_scroll.ts +++ b/src/api/api/clear_scroll.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Explicitly clears the search context for a scroll. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/clear-scroll-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html | Elasticsearch API documentation} */ export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/close_point_in_time.ts b/src/api/api/close_point_in_time.ts index 2f6e327..3806890 100644 --- a/src/api/api/close_point_in_time.ts +++ b/src/api/api/close_point_in_time.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Close a point in time - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/point-in-time-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html | Elasticsearch API documentation} */ export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest | TB.ClosePointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest | TB.ClosePointInTimeRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/cluster.ts b/src/api/api/cluster.ts index c5a274f..86c03fa 100644 --- a/src/api/api/cluster.ts +++ b/src/api/api/cluster.ts @@ -45,7 +45,7 @@ export default class Cluster { /** * Deletes a component template - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-component-template.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation} */ async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest | TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest | TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -71,7 +71,7 @@ export default class Cluster { /** * Returns information about whether a particular component template exist - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-component-template.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation} */ async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest | TB.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest | TB.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -97,7 +97,7 @@ export default class Cluster { /** * Returns one or more component templates - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-component-template.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation} */ async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest | TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest | TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -129,36 +129,9 @@ export default class Cluster { return await this.transport.request({ path, method, querystring, body }, options) } - /** - * Returns cluster settings. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cluster-get-settings.html | Elasticsearch API documentation} - */ - async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise - async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = [] - const querystring: Record = {} - const body = undefined - - params = params ?? {} - for (const key in params) { - if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - const method = 'GET' - const path = '/_cluster/settings' - return await this.transport.request({ path, method, querystring, body }, options) - } - /** * Returns different information about the cluster. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cluster-info.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html | Elasticsearch API documentation} */ async info (this: That, params: T.ClusterInfoRequest | TB.ClusterInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise async info (this: That, params: T.ClusterInfoRequest | TB.ClusterInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -182,36 +155,9 @@ export default class Cluster { return await this.transport.request({ path, method, querystring, body }, options) } - /** - * Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cluster-pending.html | Elasticsearch API documentation} - */ - async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithMeta): Promise> - async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise - async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = [] - const querystring: Record = {} - const body = undefined - - params = params ?? {} - for (const key in params) { - if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - const method = 'GET' - const path = '/_cluster/pending_tasks' - return await this.transport.request({ path, method, querystring, body }, options) - } - /** * Creates or updates a component template - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-component-template.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation} */ async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -246,77 +192,4 @@ export default class Cluster { const path = `/_component_template/${encodeURIComponent(params.name.toString())}` return await this.transport.request({ path, method, querystring, body }, options) } - - /** - * Updates the cluster settings. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cluster-update-settings.html | Elasticsearch API documentation} - */ - async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptions): Promise - async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = [] - const acceptedBody: string[] = ['persistent', 'transient'] - const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } - - params = params ?? {} - for (const key in params) { - if (acceptedBody.includes(key)) { - body = body ?? {} - // @ts-expect-error - body[key] = params[key] - } else if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - const method = 'PUT' - const path = '/_cluster/settings' - return await this.transport.request({ path, method, querystring, body }, options) - } - - /** - * Returns high-level overview of cluster statistics. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/cluster-stats.html | Elasticsearch API documentation} - */ - async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptions): Promise - async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['node_id'] - const querystring: Record = {} - const body = undefined - - params = params ?? {} - for (const key in params) { - if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - let method = '' - let path = '' - if (params.node_id != null) { - method = 'GET' - path = `/_cluster/stats/nodes/${encodeURIComponent(params.node_id.toString())}` - } else { - method = 'GET' - path = '/_cluster/stats' - } - return await this.transport.request({ path, method, querystring, body }, options) - } } diff --git a/src/api/api/count.ts b/src/api/api/count.ts index 2196e73..0d01dbb 100644 --- a/src/api/api/count.ts +++ b/src/api/api/count.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns number of documents matching a query. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-count.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html | Elasticsearch API documentation} */ export default async function CountApi (this: That, params?: T.CountRequest | TB.CountRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function CountApi (this: That, params?: T.CountRequest | TB.CountRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/create.ts b/src/api/api/create.ts index 769d03e..622f8eb 100644 --- a/src/api/api/create.ts +++ b/src/api/api/create.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-index_.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html | Elasticsearch API documentation} */ export default async function CreateApi (this: That, params: T.CreateRequest | TB.CreateRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function CreateApi (this: That, params: T.CreateRequest | TB.CreateRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/delete.ts b/src/api/api/delete.ts index 17ce1e2..f834f72 100644 --- a/src/api/api/delete.ts +++ b/src/api/api/delete.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Removes a document from the index. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-delete.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html | Elasticsearch API documentation} */ export default async function DeleteApi (this: That, params: T.DeleteRequest | TB.DeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function DeleteApi (this: That, params: T.DeleteRequest | TB.DeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/delete_by_query.ts b/src/api/api/delete_by_query.ts index 6c47ae3..fc62679 100644 --- a/src/api/api/delete_by_query.ts +++ b/src/api/api/delete_by_query.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Deletes documents matching the provided query. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-delete-by-query.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html | Elasticsearch API documentation} */ export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest | TB.DeleteByQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest | TB.DeleteByQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/delete_script.ts b/src/api/api/delete_script.ts index bed1940..5c84921 100644 --- a/src/api/api/delete_script.ts +++ b/src/api/api/delete_script.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Deletes a script. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/modules-scripting.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation} */ export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/enrich.ts b/src/api/api/enrich.ts index 4013ffe..f2f0f68 100644 --- a/src/api/api/enrich.ts +++ b/src/api/api/enrich.ts @@ -45,7 +45,7 @@ export default class Enrich { /** * Deletes an existing enrich policy and its enrich index. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/delete-enrich-policy-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-enrich-policy-api.html | Elasticsearch API documentation} */ async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest | TB.EnrichDeletePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest | TB.EnrichDeletePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -71,7 +71,7 @@ export default class Enrich { /** * Creates the enrich index for an existing enrich policy. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/execute-enrich-policy-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/execute-enrich-policy-api.html | Elasticsearch API documentation} */ async executePolicy (this: That, params: T.EnrichExecutePolicyRequest | TB.EnrichExecutePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise async executePolicy (this: That, params: T.EnrichExecutePolicyRequest | TB.EnrichExecutePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -97,7 +97,7 @@ export default class Enrich { /** * Gets information about an enrich policy. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/get-enrich-policy-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-enrich-policy-api.html | Elasticsearch API documentation} */ async getPolicy (this: That, params?: T.EnrichGetPolicyRequest | TB.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getPolicy (this: That, params?: T.EnrichGetPolicyRequest | TB.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -131,7 +131,7 @@ export default class Enrich { /** * Creates a new enrich policy. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-enrich-policy-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-enrich-policy-api.html | Elasticsearch API documentation} */ async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -169,7 +169,7 @@ export default class Enrich { /** * Gets enrich coordinator statistics and information about enrich policies that are currently executing. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/enrich-stats-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/enrich-stats-api.html | Elasticsearch API documentation} */ async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/eql.ts b/src/api/api/eql.ts new file mode 100644 index 0000000..fdcb9c8 --- /dev/null +++ b/src/api/api/eql.ts @@ -0,0 +1,161 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class Eql { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html | Elasticsearch API documentation} + */ + async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_eql/search/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Returns async results from previously executed Event Query Language (EQL) search + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html | Elasticsearch API documentation} + */ + async get (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async get (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async get (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptions): Promise> + async get (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_eql/search/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Returns the status of a previously submitted async or stored Event Query Language (EQL) search + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html | Elasticsearch API documentation} + */ + async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptions): Promise + async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_eql/search/status/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Returns results matching a query expressed in Event Query Language (EQL) + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html | Elasticsearch API documentation} + */ + async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptions): Promise> + async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['index'] + const acceptedBody: string[] = ['query', 'case_sensitive', 'event_category_field', 'tiebreaker_field', 'timestamp_field', 'fetch_size', 'filter', 'keep_alive', 'keep_on_completion', 'wait_for_completion_timeout', 'size', 'fields', 'result_position'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = body != null ? 'POST' : 'GET' + const path = `/${encodeURIComponent(params.index.toString())}/_eql/search` + return await this.transport.request({ path, method, querystring, body }, options) + } +} diff --git a/src/api/api/exists.ts b/src/api/api/exists.ts index f5e06cb..a0448c0 100644 --- a/src/api/api/exists.ts +++ b/src/api/api/exists.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns information about whether a document exists in an index. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-get.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation} */ export default async function ExistsApi (this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function ExistsApi (this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/exists_source.ts b/src/api/api/exists_source.ts index e1f33d9..ba264a3 100644 --- a/src/api/api/exists_source.ts +++ b/src/api/api/exists_source.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns information about whether a document source exists in an index. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-get.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation} */ export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/explain.ts b/src/api/api/explain.ts new file mode 100644 index 0000000..6e910ff --- /dev/null +++ b/src/api/api/explain.ts @@ -0,0 +1,76 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +/** + * Returns information about why a specific matches (or doesn't match) a query. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html | Elasticsearch API documentation} + */ +export default async function ExplainApi (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function ExplainApi (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function ExplainApi (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptions): Promise> +export default async function ExplainApi (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id', 'index'] + const acceptedBody: string[] = ['query'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = body != null ? 'POST' : 'GET' + const path = `/${encodeURIComponent(params.index.toString())}/_explain/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) +} diff --git a/src/api/api/field_caps.ts b/src/api/api/field_caps.ts index f375284..94ff25d 100644 --- a/src/api/api/field_caps.ts +++ b/src/api/api/field_caps.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns the information about the capabilities of fields among multiple indices. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-field-caps.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html | Elasticsearch API documentation} */ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/get.ts b/src/api/api/get.ts index c85c1ab..96f3125 100644 --- a/src/api/api/get.ts +++ b/src/api/api/get.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns a document. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-get.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation} */ export default async function GetApi (this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function GetApi (this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/get_script.ts b/src/api/api/get_script.ts index cb1bcbd..b2c4a03 100644 --- a/src/api/api/get_script.ts +++ b/src/api/api/get_script.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns a script. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/modules-scripting.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation} */ export default async function GetScriptApi (this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function GetScriptApi (this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/get_source.ts b/src/api/api/get_source.ts index 588ca98..7f92d9b 100644 --- a/src/api/api/get_source.ts +++ b/src/api/api/get_source.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns the source of a document. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-get.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation} */ export default async function GetSourceApi (this: That, params: T.GetSourceRequest | TB.GetSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function GetSourceApi (this: That, params: T.GetSourceRequest | TB.GetSourceRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/graph.ts b/src/api/api/graph.ts index cb18050..666a409 100644 --- a/src/api/api/graph.ts +++ b/src/api/api/graph.ts @@ -45,7 +45,7 @@ export default class Graph { /** * Explore extracted and summarized information about the documents and terms in an index. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/graph-explore-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/graph-explore-api.html | Elasticsearch API documentation} */ async explore (this: That, params: T.GraphExploreRequest | TB.GraphExploreRequest, options?: TransportRequestOptionsWithOutMeta): Promise async explore (this: That, params: T.GraphExploreRequest | TB.GraphExploreRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/index.ts b/src/api/api/index.ts index ef31592..b156d47 100644 --- a/src/api/api/index.ts +++ b/src/api/api/index.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Creates or updates a document in an index. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-index_.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html | Elasticsearch API documentation} */ export default async function IndexApi (this: That, params: T.IndexRequest | TB.IndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function IndexApi (this: That, params: T.IndexRequest | TB.IndexRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index 6dceda6..6c42437 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -43,9 +43,35 @@ export default class Indices { this.transport = transport } + /** + * Adds a block to an index. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html | Elasticsearch API documentation} + */ + async addBlock (this: That, params: T.IndicesAddBlockRequest | TB.IndicesAddBlockRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async addBlock (this: That, params: T.IndicesAddBlockRequest | TB.IndicesAddBlockRequest, options?: TransportRequestOptionsWithMeta): Promise> + async addBlock (this: That, params: T.IndicesAddBlockRequest | TB.IndicesAddBlockRequest, options?: TransportRequestOptions): Promise + async addBlock (this: That, params: T.IndicesAddBlockRequest | TB.IndicesAddBlockRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['index', 'block'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/${encodeURIComponent(params.index.toString())}/_block/${encodeURIComponent(params.block.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + /** * Performs the analysis process on a text and return the tokens breakdown of the text. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-analyze.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html | Elasticsearch API documentation} */ async analyze (this: That, params?: T.IndicesAnalyzeRequest | TB.IndicesAnalyzeRequest, options?: TransportRequestOptionsWithOutMeta): Promise async analyze (this: That, params?: T.IndicesAnalyzeRequest | TB.IndicesAnalyzeRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -91,7 +117,7 @@ export default class Indices { /** * Creates an index with optional settings and mappings. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-create-index.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html | Elasticsearch API documentation} */ async create (this: That, params: T.IndicesCreateRequest | TB.IndicesCreateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async create (this: That, params: T.IndicesCreateRequest | TB.IndicesCreateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -129,7 +155,7 @@ export default class Indices { /** * Creates a data stream - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/data-streams.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation} */ async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest | TB.IndicesCreateDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest | TB.IndicesCreateDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -155,7 +181,7 @@ export default class Indices { /** * Provides statistics on operations happening in a data stream. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/data-streams.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation} */ async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest | TB.IndicesDataStreamsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest | TB.IndicesDataStreamsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -189,7 +215,7 @@ export default class Indices { /** * Deletes an index. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-delete-index.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html | Elasticsearch API documentation} */ async delete (this: That, params: T.IndicesDeleteRequest | TB.IndicesDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise async delete (this: That, params: T.IndicesDeleteRequest | TB.IndicesDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -215,7 +241,7 @@ export default class Indices { /** * Deletes an alias. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-aliases.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html | Elasticsearch API documentation} */ async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest | TB.IndicesDeleteAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest | TB.IndicesDeleteAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -247,8 +273,8 @@ export default class Indices { } /** - * Deletes the data lifecycle of the selected data streams. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/dlm-delete-lifecycle.html | Elasticsearch API documentation} + * Deletes the data stream lifecycle of the selected data streams. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-delete-lifecycle.html | Elasticsearch API documentation} */ async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -274,7 +300,7 @@ export default class Indices { /** * Deletes a data stream. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/data-streams.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation} */ async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -300,7 +326,7 @@ export default class Indices { /** * Deletes an index template. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation} */ async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest | TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest | TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -324,61 +350,9 @@ export default class Indices { return await this.transport.request({ path, method, querystring, body }, options) } - /** - * Deletes an index template. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} - */ - async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): Promise - async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['name'] - const querystring: Record = {} - const body = undefined - - for (const key in params) { - if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - const method = 'DELETE' - const path = `/_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) - } - - /** - * Analyzes the disk usage of each field of an index or data stream - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-disk-usage.html | Elasticsearch API documentation} - */ - async diskUsage (this: That, params: T.IndicesDiskUsageRequest | TB.IndicesDiskUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async diskUsage (this: That, params: T.IndicesDiskUsageRequest | TB.IndicesDiskUsageRequest, options?: TransportRequestOptionsWithMeta): Promise> - async diskUsage (this: That, params: T.IndicesDiskUsageRequest | TB.IndicesDiskUsageRequest, options?: TransportRequestOptions): Promise - async diskUsage (this: That, params: T.IndicesDiskUsageRequest | TB.IndicesDiskUsageRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['index'] - const querystring: Record = {} - const body = undefined - - for (const key in params) { - if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - const method = 'POST' - const path = `/${encodeURIComponent(params.index.toString())}/_disk_usage` - return await this.transport.request({ path, method, querystring, body }, options) - } - /** * Returns information about whether a particular index exists. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-exists.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html | Elasticsearch API documentation} */ async exists (this: That, params: T.IndicesExistsRequest | TB.IndicesExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async exists (this: That, params: T.IndicesExistsRequest | TB.IndicesExistsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -404,7 +378,7 @@ export default class Indices { /** * Returns information about whether a particular alias exists. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-aliases.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html | Elasticsearch API documentation} */ async existsAlias (this: That, params: T.IndicesExistsAliasRequest | TB.IndicesExistsAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise async existsAlias (this: That, params: T.IndicesExistsAliasRequest | TB.IndicesExistsAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -437,7 +411,7 @@ export default class Indices { /** * Returns information about whether a particular index template exists. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation} */ async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest | TB.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest | TB.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -462,34 +436,8 @@ export default class Indices { } /** - * Returns information about whether a particular index template exists. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} - */ - async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptions): Promise - async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['name'] - const querystring: Record = {} - const body = undefined - - for (const key in params) { - if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - const method = 'HEAD' - const path = `/_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) - } - - /** - * Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/dlm-explain-lifecycle.html | Elasticsearch API documentation} + * Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-explain-lifecycle.html | Elasticsearch API documentation} */ async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -515,7 +463,7 @@ export default class Indices { /** * Returns information about one or more indices. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-get-index.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html | Elasticsearch API documentation} */ async get (this: That, params: T.IndicesGetRequest | TB.IndicesGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise async get (this: That, params: T.IndicesGetRequest | TB.IndicesGetRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -541,7 +489,7 @@ export default class Indices { /** * Returns an alias. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-aliases.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html | Elasticsearch API documentation} */ async getAlias (this: That, params?: T.IndicesGetAliasRequest | TB.IndicesGetAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getAlias (this: That, params?: T.IndicesGetAliasRequest | TB.IndicesGetAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -580,8 +528,8 @@ export default class Indices { } /** - * Returns the data lifecycle of the selected data streams. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/dlm-get-lifecycle.html | Elasticsearch API documentation} + * Returns the data stream lifecycle of the selected data streams. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle.html | Elasticsearch API documentation} */ async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -607,7 +555,7 @@ export default class Indices { /** * Returns data streams. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/data-streams.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation} */ async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -641,7 +589,7 @@ export default class Indices { /** * Returns an index template. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation} */ async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest | TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest | TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -675,7 +623,7 @@ export default class Indices { /** * Returns mappings for one or more indices. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-get-mapping.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html | Elasticsearch API documentation} */ async getMapping (this: That, params?: T.IndicesGetMappingRequest | TB.IndicesGetMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getMapping (this: That, params?: T.IndicesGetMappingRequest | TB.IndicesGetMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -709,7 +657,7 @@ export default class Indices { /** * Returns settings for one or more indices. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-get-settings.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html | Elasticsearch API documentation} */ async getSettings (this: That, params?: T.IndicesGetSettingsRequest | TB.IndicesGetSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getSettings (this: That, params?: T.IndicesGetSettingsRequest | TB.IndicesGetSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -747,43 +695,9 @@ export default class Indices { return await this.transport.request({ path, method, querystring, body }, options) } - /** - * Returns an index template. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} - */ - async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptions): Promise - async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['name'] - const querystring: Record = {} - const body = undefined - - params = params ?? {} - for (const key in params) { - if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - let method = '' - let path = '' - if (params.name != null) { - method = 'GET' - path = `/_template/${encodeURIComponent(params.name.toString())}` - } else { - method = 'GET' - path = '/_template' - } - return await this.transport.request({ path, method, querystring, body }, options) - } - /** * Migrates an alias to a data stream - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/data-streams.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation} */ async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest | TB.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest | TB.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -809,7 +723,7 @@ export default class Indices { /** * Modifies a data stream - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/data-streams.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation} */ async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -847,7 +761,7 @@ export default class Indices { /** * Creates or updates an alias. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-aliases.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html | Elasticsearch API documentation} */ async putAlias (this: That, params: T.IndicesPutAliasRequest | TB.IndicesPutAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putAlias (this: That, params: T.IndicesPutAliasRequest | TB.IndicesPutAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -891,15 +805,15 @@ export default class Indices { } /** - * Updates the data lifecycle of the selected data streams. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/dlm-put-lifecycle.html | Elasticsearch API documentation} + * Updates the data stream lifecycle of the selected data streams. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-put-lifecycle.html | Elasticsearch API documentation} */ async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['data_retention'] + const acceptedBody: string[] = ['data_retention', 'downsampling'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body @@ -930,7 +844,7 @@ export default class Indices { /** * Creates or updates an index template. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation} */ async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -968,7 +882,7 @@ export default class Indices { /** * Updates the index mappings. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-put-mapping.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html | Elasticsearch API documentation} */ async putMapping (this: That, params: T.IndicesPutMappingRequest | TB.IndicesPutMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putMapping (this: That, params: T.IndicesPutMappingRequest | TB.IndicesPutMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1006,7 +920,7 @@ export default class Indices { /** * Updates the index settings. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-update-settings.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html | Elasticsearch API documentation} */ async putSettings (this: That, params: T.IndicesPutSettingsRequest | TB.IndicesPutSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putSettings (this: That, params: T.IndicesPutSettingsRequest | TB.IndicesPutSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1044,7 +958,7 @@ export default class Indices { /** * Creates or updates an index template. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation} */ async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1080,9 +994,43 @@ export default class Indices { return await this.transport.request({ path, method, querystring, body }, options) } + /** + * Performs the refresh operation in one or more indices. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html | Elasticsearch API documentation} + */ + async refresh (this: That, params?: T.IndicesRefreshRequest | TB.IndicesRefreshRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async refresh (this: That, params?: T.IndicesRefreshRequest | TB.IndicesRefreshRequest, options?: TransportRequestOptionsWithMeta): Promise> + async refresh (this: That, params?: T.IndicesRefreshRequest | TB.IndicesRefreshRequest, options?: TransportRequestOptions): Promise + async refresh (this: That, params?: T.IndicesRefreshRequest | TB.IndicesRefreshRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['index'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + let method = '' + let path = '' + if (params.index != null) { + method = body != null ? 'POST' : 'GET' + path = `/${encodeURIComponent(params.index.toString())}/_refresh` + } else { + method = body != null ? 'POST' : 'GET' + path = '/_refresh' + } + return await this.transport.request({ path, method, querystring, body }, options) + } + /** * Returns information about any matching indices, aliases, and data streams - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-resolve-index-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html | Elasticsearch API documentation} */ async resolveIndex (this: That, params: T.IndicesResolveIndexRequest | TB.IndicesResolveIndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise async resolveIndex (this: That, params: T.IndicesResolveIndexRequest | TB.IndicesResolveIndexRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1108,7 +1056,7 @@ export default class Indices { /** * Updates an alias to point to a new index when the existing index is considered to be too large or too old. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-rollover-index.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html | Elasticsearch API documentation} */ async rollover (this: That, params: T.IndicesRolloverRequest | TB.IndicesRolloverRequest, options?: TransportRequestOptionsWithOutMeta): Promise async rollover (this: That, params: T.IndicesRolloverRequest | TB.IndicesRolloverRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1153,7 +1101,7 @@ export default class Indices { /** * Simulate matching the given index name against the index templates in the system - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation} */ async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1191,7 +1139,7 @@ export default class Indices { /** * Simulate resolving the given template name or body - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-templates.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation} */ async simulateTemplate (this: That, params: T.IndicesSimulateTemplateRequest | TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async simulateTemplate (this: That, params: T.IndicesSimulateTemplateRequest | TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1229,7 +1177,7 @@ export default class Indices { /** * Updates index aliases. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/indices-aliases.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html | Elasticsearch API documentation} */ async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest | TB.IndicesUpdateAliasesRequest, options?: TransportRequestOptionsWithOutMeta): Promise async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest | TB.IndicesUpdateAliasesRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1268,7 +1216,7 @@ export default class Indices { /** * Allows a user to validate a potentially expensive query without executing it. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-validate.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html | Elasticsearch API documentation} */ async validateQuery (this: That, params?: T.IndicesValidateQueryRequest | TB.IndicesValidateQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise async validateQuery (this: That, params?: T.IndicesValidateQueryRequest | TB.IndicesValidateQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/info.ts b/src/api/api/info.ts index 71db746..3eca995 100644 --- a/src/api/api/info.ts +++ b/src/api/api/info.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns basic information about the cluster. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/index.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation} */ export default async function InfoApi (this: That, params?: T.InfoRequest | TB.InfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function InfoApi (this: That, params?: T.InfoRequest | TB.InfoRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/ingest.ts b/src/api/api/ingest.ts index ccc2a48..f6c3477 100644 --- a/src/api/api/ingest.ts +++ b/src/api/api/ingest.ts @@ -45,7 +45,7 @@ export default class Ingest { /** * Deletes a pipeline. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/delete-pipeline-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html | Elasticsearch API documentation} */ async deletePipeline (this: That, params: T.IngestDeletePipelineRequest | TB.IngestDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deletePipeline (this: That, params: T.IngestDeletePipelineRequest | TB.IngestDeletePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -71,7 +71,7 @@ export default class Ingest { /** * Returns a pipeline. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/get-pipeline-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html | Elasticsearch API documentation} */ async getPipeline (this: That, params?: T.IngestGetPipelineRequest | TB.IngestGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getPipeline (this: That, params?: T.IngestGetPipelineRequest | TB.IngestGetPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -105,7 +105,7 @@ export default class Ingest { /** * Returns a list of the built-in patterns. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/grok-processor.html#grok-processor-rest-get | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html | Elasticsearch API documentation} */ async processorGrok (this: That, params?: T.IngestProcessorGrokRequest | TB.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithOutMeta): Promise async processorGrok (this: That, params?: T.IngestProcessorGrokRequest | TB.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -132,7 +132,7 @@ export default class Ingest { /** * Creates or updates a pipeline. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-pipeline-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html | Elasticsearch API documentation} */ async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -170,7 +170,7 @@ export default class Ingest { /** * Allows to simulate a pipeline with example documents. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/simulate-pipeline-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html | Elasticsearch API documentation} */ async simulate (this: That, params?: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async simulate (this: That, params?: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/license.ts b/src/api/api/license.ts new file mode 100644 index 0000000..6b99f37 --- /dev/null +++ b/src/api/api/license.ts @@ -0,0 +1,72 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class License { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Retrieves licensing information for the cluster + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html | Elasticsearch API documentation} + */ + async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_license' + return await this.transport.request({ path, method, querystring, body }, options) + } +} diff --git a/src/api/api/logstash.ts b/src/api/api/logstash.ts index 36cc562..0b85093 100644 --- a/src/api/api/logstash.ts +++ b/src/api/api/logstash.ts @@ -45,7 +45,7 @@ export default class Logstash { /** * Deletes Logstash Pipelines used by Central Management - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/logstash-api-delete-pipeline.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-delete-pipeline.html | Elasticsearch API documentation} */ async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest | TB.LogstashDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest | TB.LogstashDeletePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -71,7 +71,7 @@ export default class Logstash { /** * Retrieves Logstash Pipelines used by Central Management - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/logstash-api-get-pipeline.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-get-pipeline.html | Elasticsearch API documentation} */ async getPipeline (this: That, params: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getPipeline (this: That, params: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -104,7 +104,7 @@ export default class Logstash { /** * Adds and updates Logstash Pipelines used for Central Management - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/logstash-api-put-pipeline.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-put-pipeline.html | Elasticsearch API documentation} */ async putPipeline (this: That, params: T.LogstashPutPipelineRequest | TB.LogstashPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putPipeline (this: That, params: T.LogstashPutPipelineRequest | TB.LogstashPutPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/mget.ts b/src/api/api/mget.ts index c8ec5b3..bf6717a 100644 --- a/src/api/api/mget.ts +++ b/src/api/api/mget.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Allows to get multiple documents in one request. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-multi-get.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html | Elasticsearch API documentation} */ export default async function MgetApi (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function MgetApi (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index e437445..671d49d 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -45,7 +45,7 @@ export default class Ml { /** * Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-close-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-close-job.html | Elasticsearch API documentation} */ async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -83,7 +83,7 @@ export default class Ml { /** * Deletes a calendar. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-delete-calendar.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-calendar.html | Elasticsearch API documentation} */ async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest | TB.MlDeleteCalendarRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest | TB.MlDeleteCalendarRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -109,7 +109,7 @@ export default class Ml { /** * Deletes scheduled events from a calendar. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-delete-calendar-event.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-calendar-event.html | Elasticsearch API documentation} */ async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest | TB.MlDeleteCalendarEventRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest | TB.MlDeleteCalendarEventRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -135,7 +135,7 @@ export default class Ml { /** * Deletes anomaly detection jobs from a calendar. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-delete-calendar-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-calendar-job.html | Elasticsearch API documentation} */ async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest | TB.MlDeleteCalendarJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest | TB.MlDeleteCalendarJobRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -161,7 +161,7 @@ export default class Ml { /** * Deletes an existing data frame analytics job. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/delete-dfanalytics.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-dfanalytics.html | Elasticsearch API documentation} */ async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest | TB.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest | TB.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -187,7 +187,7 @@ export default class Ml { /** * Deletes an existing datafeed. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-delete-datafeed.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-datafeed.html | Elasticsearch API documentation} */ async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest | TB.MlDeleteDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest | TB.MlDeleteDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -213,7 +213,7 @@ export default class Ml { /** * Deletes a filter. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-delete-filter.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-filter.html | Elasticsearch API documentation} */ async deleteFilter (this: That, params: T.MlDeleteFilterRequest | TB.MlDeleteFilterRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteFilter (this: That, params: T.MlDeleteFilterRequest | TB.MlDeleteFilterRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -239,7 +239,7 @@ export default class Ml { /** * Deletes an existing anomaly detection job. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-delete-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-job.html | Elasticsearch API documentation} */ async deleteJob (this: That, params: T.MlDeleteJobRequest | TB.MlDeleteJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteJob (this: That, params: T.MlDeleteJobRequest | TB.MlDeleteJobRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -265,7 +265,7 @@ export default class Ml { /** * Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/delete-trained-models.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-trained-models.html | Elasticsearch API documentation} */ async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest | TB.MlDeleteTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest | TB.MlDeleteTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -291,7 +291,7 @@ export default class Ml { /** * Deletes a model alias that refers to the trained model - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/delete-trained-models-aliases.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-trained-models-aliases.html | Elasticsearch API documentation} */ async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest | TB.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest | TB.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -317,7 +317,7 @@ export default class Ml { /** * Estimates the model memory - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-apis.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-apis.html | Elasticsearch API documentation} */ async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest | TB.MlEstimateModelMemoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest | TB.MlEstimateModelMemoryRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -356,7 +356,7 @@ export default class Ml { /** * Evaluates the data frame analytics for an annotated index. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/evaluate-dfanalytics.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/evaluate-dfanalytics.html | Elasticsearch API documentation} */ async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest | TB.MlEvaluateDataFrameRequest, options?: TransportRequestOptionsWithOutMeta): Promise async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest | TB.MlEvaluateDataFrameRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -394,7 +394,7 @@ export default class Ml { /** * Forces any buffered data to be processed by the job. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-flush-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-flush-job.html | Elasticsearch API documentation} */ async flushJob (this: That, params: T.MlFlushJobRequest | TB.MlFlushJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise async flushJob (this: That, params: T.MlFlushJobRequest | TB.MlFlushJobRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -432,7 +432,7 @@ export default class Ml { /** * Retrieves information about the scheduled events in calendars. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-get-calendar-event.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-calendar-event.html | Elasticsearch API documentation} */ async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest | TB.MlGetCalendarEventsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest | TB.MlGetCalendarEventsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -458,7 +458,7 @@ export default class Ml { /** * Retrieves configuration information for calendars. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-get-calendar.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-calendar.html | Elasticsearch API documentation} */ async getCalendars (this: That, params?: T.MlGetCalendarsRequest | TB.MlGetCalendarsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getCalendars (this: That, params?: T.MlGetCalendarsRequest | TB.MlGetCalendarsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -504,7 +504,7 @@ export default class Ml { /** * Retrieves configuration information for data frame analytics jobs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/get-dfanalytics.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-dfanalytics.html | Elasticsearch API documentation} */ async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest | TB.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest | TB.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -538,7 +538,7 @@ export default class Ml { /** * Retrieves usage information for data frame analytics jobs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/get-dfanalytics-stats.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-dfanalytics-stats.html | Elasticsearch API documentation} */ async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest | TB.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest | TB.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -572,7 +572,7 @@ export default class Ml { /** * Retrieves usage information for datafeeds. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-get-datafeed-stats.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-datafeed-stats.html | Elasticsearch API documentation} */ async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest | TB.MlGetDatafeedStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest | TB.MlGetDatafeedStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -606,7 +606,7 @@ export default class Ml { /** * Retrieves configuration information for datafeeds. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-get-datafeed.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-datafeed.html | Elasticsearch API documentation} */ async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest | TB.MlGetDatafeedsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest | TB.MlGetDatafeedsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -640,7 +640,7 @@ export default class Ml { /** * Retrieves filters. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-get-filter.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-filter.html | Elasticsearch API documentation} */ async getFilters (this: That, params?: T.MlGetFiltersRequest | TB.MlGetFiltersRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getFilters (this: That, params?: T.MlGetFiltersRequest | TB.MlGetFiltersRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -674,7 +674,7 @@ export default class Ml { /** * Retrieves usage information for anomaly detection jobs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-get-job-stats.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-job-stats.html | Elasticsearch API documentation} */ async getJobStats (this: That, params?: T.MlGetJobStatsRequest | TB.MlGetJobStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getJobStats (this: That, params?: T.MlGetJobStatsRequest | TB.MlGetJobStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -708,7 +708,7 @@ export default class Ml { /** * Retrieves configuration information for anomaly detection jobs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-get-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-job.html | Elasticsearch API documentation} */ async getJobs (this: That, params?: T.MlGetJobsRequest | TB.MlGetJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getJobs (this: That, params?: T.MlGetJobsRequest | TB.MlGetJobsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -742,7 +742,7 @@ export default class Ml { /** * Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-get-overall-buckets.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-overall-buckets.html | Elasticsearch API documentation} */ async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest | TB.MlGetOverallBucketsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest | TB.MlGetOverallBucketsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -780,7 +780,7 @@ export default class Ml { /** * Retrieves configuration information for a trained inference model. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/get-trained-models.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trained-models.html | Elasticsearch API documentation} */ async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest | TB.MlGetTrainedModelsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest | TB.MlGetTrainedModelsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -814,7 +814,7 @@ export default class Ml { /** * Retrieves usage information for trained inference models. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/get-trained-models-stats.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trained-models-stats.html | Elasticsearch API documentation} */ async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest | TB.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest | TB.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -846,9 +846,47 @@ export default class Ml { return await this.transport.request({ path, method, querystring, body }, options) } + /** + * Evaluate a trained model. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html | Elasticsearch API documentation} + */ + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['model_id'] + const acceptedBody: string[] = ['docs', 'inference_config'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/_infer` + return await this.transport.request({ path, method, querystring, body }, options) + } + /** * Opens one or more anomaly detection jobs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-open-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-open-job.html | Elasticsearch API documentation} */ async openJob (this: That, params: T.MlOpenJobRequest | TB.MlOpenJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise async openJob (this: That, params: T.MlOpenJobRequest | TB.MlOpenJobRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -886,7 +924,7 @@ export default class Ml { /** * Posts scheduled events in a calendar. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-post-calendar-event.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-post-calendar-event.html | Elasticsearch API documentation} */ async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest | TB.MlPostCalendarEventsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest | TB.MlPostCalendarEventsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -924,7 +962,7 @@ export default class Ml { /** * Previews that will be analyzed given a data frame analytics config. - * @see {@link http://www.elastic.co/guide/en/elasticsearch/reference/main/preview-dfanalytics.html | Elasticsearch API documentation} + * @see {@link http://www.elastic.co/guide/en/elasticsearch/reference/master/preview-dfanalytics.html | Elasticsearch API documentation} */ async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest | TB.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest | TB.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -970,7 +1008,7 @@ export default class Ml { /** * Previews a datafeed. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-preview-datafeed.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-preview-datafeed.html | Elasticsearch API documentation} */ async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest | TB.MlPreviewDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise> async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest | TB.MlPreviewDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> @@ -1016,7 +1054,7 @@ export default class Ml { /** * Instantiates a calendar. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-put-calendar.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-calendar.html | Elasticsearch API documentation} */ async putCalendar (this: That, params: T.MlPutCalendarRequest | TB.MlPutCalendarRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putCalendar (this: That, params: T.MlPutCalendarRequest | TB.MlPutCalendarRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1054,7 +1092,7 @@ export default class Ml { /** * Adds an anomaly detection job to a calendar. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-put-calendar-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-calendar-job.html | Elasticsearch API documentation} */ async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest | TB.MlPutCalendarJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest | TB.MlPutCalendarJobRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1080,7 +1118,7 @@ export default class Ml { /** * Instantiates a data frame analytics job. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-dfanalytics.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-dfanalytics.html | Elasticsearch API documentation} */ async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest | TB.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest | TB.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1118,7 +1156,7 @@ export default class Ml { /** * Instantiates a datafeed. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-put-datafeed.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-datafeed.html | Elasticsearch API documentation} */ async putDatafeed (this: That, params: T.MlPutDatafeedRequest | TB.MlPutDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putDatafeed (this: That, params: T.MlPutDatafeedRequest | TB.MlPutDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1156,7 +1194,7 @@ export default class Ml { /** * Instantiates a filter. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-put-filter.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-filter.html | Elasticsearch API documentation} */ async putFilter (this: That, params: T.MlPutFilterRequest | TB.MlPutFilterRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putFilter (this: That, params: T.MlPutFilterRequest | TB.MlPutFilterRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1194,7 +1232,7 @@ export default class Ml { /** * Instantiates an anomaly detection job. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-put-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-job.html | Elasticsearch API documentation} */ async putJob (this: That, params: T.MlPutJobRequest | TB.MlPutJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putJob (this: That, params: T.MlPutJobRequest | TB.MlPutJobRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1232,14 +1270,14 @@ export default class Ml { /** * Creates an inference trained model. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-trained-models.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-trained-models.html | Elasticsearch API documentation} */ async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptions): Promise async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] - const acceptedBody: string[] = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'model_type', 'model_size_bytes', 'tags'] + const acceptedBody: string[] = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'model_type', 'model_size_bytes', 'platform_architecture', 'tags'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body @@ -1270,7 +1308,7 @@ export default class Ml { /** * Creates a new model alias (or reassigns an existing one) to refer to the trained model - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-trained-models-aliases.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-trained-models-aliases.html | Elasticsearch API documentation} */ async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest | TB.MlPutTrainedModelAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest | TB.MlPutTrainedModelAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1296,7 +1334,7 @@ export default class Ml { /** * Creates part of a trained model definition - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-trained-model-definition-part.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-trained-model-definition-part.html | Elasticsearch API documentation} */ async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest | TB.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest | TB.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1334,7 +1372,7 @@ export default class Ml { /** * Creates a trained model vocabulary - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-trained-model-vocabulary.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-trained-model-vocabulary.html | Elasticsearch API documentation} */ async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1372,7 +1410,7 @@ export default class Ml { /** * Resets an existing anomaly detection job. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-reset-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-reset-job.html | Elasticsearch API documentation} */ async resetJob (this: That, params: T.MlResetJobRequest | TB.MlResetJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise async resetJob (this: That, params: T.MlResetJobRequest | TB.MlResetJobRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1398,7 +1436,7 @@ export default class Ml { /** * Starts a data frame analytics job. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/start-dfanalytics.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-dfanalytics.html | Elasticsearch API documentation} */ async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1424,7 +1462,7 @@ export default class Ml { /** * Starts one or more datafeeds. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-start-datafeed.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-start-datafeed.html | Elasticsearch API documentation} */ async startDatafeed (this: That, params: T.MlStartDatafeedRequest | TB.MlStartDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise async startDatafeed (this: That, params: T.MlStartDatafeedRequest | TB.MlStartDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1462,7 +1500,7 @@ export default class Ml { /** * Start a trained model deployment. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/start-trained-model-deployment.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html | Elasticsearch API documentation} */ async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest | TB.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest | TB.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1488,7 +1526,7 @@ export default class Ml { /** * Stops one or more data frame analytics jobs. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/stop-dfanalytics.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-dfanalytics.html | Elasticsearch API documentation} */ async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1514,7 +1552,7 @@ export default class Ml { /** * Stops one or more datafeeds. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-stop-datafeed.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-stop-datafeed.html | Elasticsearch API documentation} */ async stopDatafeed (this: That, params: T.MlStopDatafeedRequest | TB.MlStopDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise async stopDatafeed (this: That, params: T.MlStopDatafeedRequest | TB.MlStopDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1552,7 +1590,7 @@ export default class Ml { /** * Stop a trained model deployment. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/stop-trained-model-deployment.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html | Elasticsearch API documentation} */ async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1578,7 +1616,7 @@ export default class Ml { /** * Updates certain properties of a data frame analytics job. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/update-dfanalytics.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-dfanalytics.html | Elasticsearch API documentation} */ async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest | TB.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest | TB.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1616,7 +1654,7 @@ export default class Ml { /** * Updates certain properties of a datafeed. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-update-datafeed.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-update-datafeed.html | Elasticsearch API documentation} */ async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1654,7 +1692,7 @@ export default class Ml { /** * Updates the description of a filter, adds items, or removes items. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-update-filter.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-update-filter.html | Elasticsearch API documentation} */ async updateFilter (this: That, params: T.MlUpdateFilterRequest | TB.MlUpdateFilterRequest, options?: TransportRequestOptionsWithOutMeta): Promise async updateFilter (this: That, params: T.MlUpdateFilterRequest | TB.MlUpdateFilterRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1692,7 +1730,7 @@ export default class Ml { /** * Updates certain properties of an anomaly detection job. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/ml-update-job.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-update-job.html | Elasticsearch API documentation} */ async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/msearch.ts b/src/api/api/msearch.ts index f31f397..b799c54 100644 --- a/src/api/api/msearch.ts +++ b/src/api/api/msearch.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Allows to execute several search operations in one request. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-multi-search.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html | Elasticsearch API documentation} */ export default async function MsearchApi> (this: That, params: T.MsearchRequest | TB.MsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function MsearchApi> (this: That, params: T.MsearchRequest | TB.MsearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/msearch_template.ts b/src/api/api/msearch_template.ts index 2af745c..7e35d0b 100644 --- a/src/api/api/msearch_template.ts +++ b/src/api/api/msearch_template.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Allows to execute several search template operations in one request. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-multi-search.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html | Elasticsearch API documentation} */ export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/mtermvectors.ts b/src/api/api/mtermvectors.ts index 8d24bfd..7509fb7 100644 --- a/src/api/api/mtermvectors.ts +++ b/src/api/api/mtermvectors.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns multiple termvectors in one request. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-multi-termvectors.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html | Elasticsearch API documentation} */ export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest | TB.MtermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest | TB.MtermvectorsRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/open_point_in_time.ts b/src/api/api/open_point_in_time.ts index 2fa0135..dbe2fb1 100644 --- a/src/api/api/open_point_in_time.ts +++ b/src/api/api/open_point_in_time.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Open a point in time that can be used in subsequent searches - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/point-in-time-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html | Elasticsearch API documentation} */ export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/ping.ts b/src/api/api/ping.ts index 8e36b7d..b91a22f 100644 --- a/src/api/api/ping.ts +++ b/src/api/api/ping.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns whether the cluster is running. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/index.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation} */ export default async function PingApi (this: That, params?: T.PingRequest | TB.PingRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function PingApi (this: That, params?: T.PingRequest | TB.PingRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/put_script.ts b/src/api/api/put_script.ts index 6644c50..36ea03b 100644 --- a/src/api/api/put_script.ts +++ b/src/api/api/put_script.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Creates or updates a script. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/modules-scripting.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation} */ export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/query_ruleset.ts b/src/api/api/query_ruleset.ts new file mode 100644 index 0000000..771205b --- /dev/null +++ b/src/api/api/query_ruleset.ts @@ -0,0 +1,162 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class QueryRuleset { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Deletes a query ruleset. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html | Elasticsearch API documentation} + */ + async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['ruleset_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Returns the details about a query ruleset. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html | Elasticsearch API documentation} + */ + async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['ruleset_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Lists query rulesets. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html | Elasticsearch API documentation} + */ + async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptionsWithMeta): Promise> + async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptions): Promise + async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_query_rules' + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Creates or updates a query ruleset. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html | Elasticsearch API documentation} + */ + async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptionsWithMeta): Promise> + async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptions): Promise + async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['ruleset_id'] + const acceptedBody: string[] = ['rules'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } +} diff --git a/src/api/api/rank_eval.ts b/src/api/api/rank_eval.ts index afc3412..5e0e1c2 100644 --- a/src/api/api/rank_eval.ts +++ b/src/api/api/rank_eval.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Allows to evaluate the quality of ranked search results over a set of typical search queries - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-rank-eval.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html | Elasticsearch API documentation} */ export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/reindex.ts b/src/api/api/reindex.ts new file mode 100644 index 0000000..17790d7 --- /dev/null +++ b/src/api/api/reindex.ts @@ -0,0 +1,76 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +/** + * Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html | Elasticsearch API documentation} + */ +export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise +export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['conflicts', 'dest', 'max_docs', 'script', 'size', 'source'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_reindex' + return await this.transport.request({ path, method, querystring, body }, options) +} diff --git a/src/api/api/render_search_template.ts b/src/api/api/render_search_template.ts index af31325..ef14b73 100644 --- a/src/api/api/render_search_template.ts +++ b/src/api/api/render_search_template.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Allows to use the Mustache language to pre-render a search definition. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/render-search-template-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/render-search-template-api.html | Elasticsearch API documentation} */ export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/scripts_painless_execute.ts b/src/api/api/scripts_painless_execute.ts index 67a023d..e27a599 100644 --- a/src/api/api/scripts_painless_execute.ts +++ b/src/api/api/scripts_painless_execute.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Allows an arbitrary script to be executed and a result to be returned - * @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/main/painless-execute-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html | Elasticsearch API documentation} */ export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/scroll.ts b/src/api/api/scroll.ts index c673af3..77e2917 100644 --- a/src/api/api/scroll.ts +++ b/src/api/api/scroll.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Allows to retrieve a large numbers of results from a single search request. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-request-body.html#request-body-search-scroll | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll | Elasticsearch API documentation} */ export default async function ScrollApi> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function ScrollApi> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/search.ts b/src/api/api/search.ts index 050a5b6..ca1acc5 100644 --- a/src/api/api/search.ts +++ b/src/api/api/search.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns results matching a query. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-search.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html | Elasticsearch API documentation} */ export default async function SearchApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function SearchApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/search_application.ts b/src/api/api/search_application.ts index ed1700a..cb797a8 100644 --- a/src/api/api/search_application.ts +++ b/src/api/api/search_application.ts @@ -45,7 +45,7 @@ export default class SearchApplication { /** * Deletes a search application. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-search-application.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-search-application.html | Elasticsearch API documentation} */ async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -71,7 +71,7 @@ export default class SearchApplication { /** * Delete a behavioral analytics collection. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/delete-analytics-collection.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-analytics-collection.html | Elasticsearch API documentation} */ async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -97,7 +97,7 @@ export default class SearchApplication { /** * Returns the details about a search application. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/get-search-application.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-search-application.html | Elasticsearch API documentation} */ async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -123,7 +123,7 @@ export default class SearchApplication { /** * Returns the existing behavioral analytics collections. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/list-analytics-collection.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-analytics-collection.html | Elasticsearch API documentation} */ async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -157,7 +157,7 @@ export default class SearchApplication { /** * Returns the existing search applications. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/list-search-applications.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-search-applications.html | Elasticsearch API documentation} */ async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithOutMeta): Promise async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -184,7 +184,7 @@ export default class SearchApplication { /** * Creates or updates a search application. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-search-application.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-search-application.html | Elasticsearch API documentation} */ async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -215,7 +215,7 @@ export default class SearchApplication { /** * Creates a behavioral analytics collection. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-analytics-collection.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-analytics-collection.html | Elasticsearch API documentation} */ async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -241,7 +241,7 @@ export default class SearchApplication { /** * Perform a search against a search application - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-application-search.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-search.html | Elasticsearch API documentation} */ async search> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> async search> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/search_mvt.ts b/src/api/api/search_mvt.ts new file mode 100644 index 0000000..5d3fbdb --- /dev/null +++ b/src/api/api/search_mvt.ts @@ -0,0 +1,76 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +/** + * Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html | Elasticsearch API documentation} + */ +export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise +export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['index', 'field', 'zoom', 'x', 'y'] + const acceptedBody: string[] = ['aggs', 'buffer', 'exact_bounds', 'extent', 'fields', 'grid_agg', 'grid_precision', 'grid_type', 'query', 'runtime_mappings', 'size', 'sort', 'track_total_hits', 'with_labels'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = body != null ? 'POST' : 'GET' + const path = `/${encodeURIComponent(params.index.toString())}/_mvt/${encodeURIComponent(params.field.toString())}/${encodeURIComponent(params.zoom.toString())}/${encodeURIComponent(params.x.toString())}/${encodeURIComponent(params.y.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) +} diff --git a/src/api/api/search_template.ts b/src/api/api/search_template.ts index 540b49d..f8a5c35 100644 --- a/src/api/api/search_template.ts +++ b/src/api/api/search_template.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Allows to use the Mustache language to pre-render a search definition. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-template.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html | Elasticsearch API documentation} */ export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/security.ts b/src/api/api/security.ts index 5fd3f54..91f2f8f 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -45,7 +45,7 @@ export default class Security { /** * Enables authentication as a user and retrieve information about the authenticated user. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/security-api-authenticate.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-authenticate.html | Elasticsearch API documentation} */ async authenticate (this: That, params?: T.SecurityAuthenticateRequest | TB.SecurityAuthenticateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async authenticate (this: That, params?: T.SecurityAuthenticateRequest | TB.SecurityAuthenticateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -70,35 +70,9 @@ export default class Security { return await this.transport.request({ path, method, querystring, body }, options) } - /** - * Clear a subset or all entries from the API key cache. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/security-api-clear-api-key-cache.html | Elasticsearch API documentation} - */ - async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest | TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest | TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest | TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions): Promise - async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest | TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['ids'] - const querystring: Record = {} - const body = undefined - - for (const key in params) { - if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - const method = 'POST' - const path = `/_security/api_key/${encodeURIComponent(params.ids.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) - } - /** * Creates an API key for access without requiring basic authentication. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/security-api-create-api-key.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-create-api-key.html | Elasticsearch API documentation} */ async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest | TB.SecurityCreateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest | TB.SecurityCreateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -137,7 +111,7 @@ export default class Security { /** * Retrieves information for one or more API keys. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/security-api-get-api-key.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-api-key.html | Elasticsearch API documentation} */ async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest | TB.SecurityGetApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest | TB.SecurityGetApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -162,9 +136,55 @@ export default class Security { return await this.transport.request({ path, method, querystring, body }, options) } + /** + * Determines whether the specified user has a specified list of privileges. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-has-privileges.html | Elasticsearch API documentation} + */ + async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest | TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest | TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest | TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptions): Promise + async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest | TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['user'] + const acceptedBody: string[] = ['application', 'cluster', 'index'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + params = params ?? {} + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + let method = '' + let path = '' + if (params.user != null) { + method = body != null ? 'POST' : 'GET' + path = `/_security/user/${encodeURIComponent(params.user.toString())}/_has_privileges` + } else { + method = body != null ? 'POST' : 'GET' + path = '/_security/user/_has_privileges' + } + return await this.transport.request({ path, method, querystring, body }, options) + } + /** * Invalidates one or more API keys. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/security-api-invalidate-api-key.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-invalidate-api-key.html | Elasticsearch API documentation} */ async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest | TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest | TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -203,7 +223,7 @@ export default class Security { /** * Retrieves information for API keys using a subset of query DSL - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/security-api-query-api-key.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-query-api-key.html | Elasticsearch API documentation} */ async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest | TB.SecurityQueryApiKeysRequest, options?: TransportRequestOptionsWithOutMeta): Promise async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest | TB.SecurityQueryApiKeysRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -242,7 +262,7 @@ export default class Security { /** * Updates attributes of an existing API key. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/security-api-update-api-key.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-update-api-key.html | Elasticsearch API documentation} */ async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/sql.ts b/src/api/api/sql.ts new file mode 100644 index 0000000..05e5975 --- /dev/null +++ b/src/api/api/sql.ts @@ -0,0 +1,238 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class Sql { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Clears the SQL cursor + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-sql-cursor-api.html | Elasticsearch API documentation} + */ + async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptions): Promise + async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['cursor'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_sql/close' + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html | Elasticsearch API documentation} + */ + async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptions): Promise + async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_sql/async/delete/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Returns the current status and available results for an async SQL search or stored synchronous SQL search + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html | Elasticsearch API documentation} + */ + async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptions): Promise + async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_sql/async/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Returns the current status of an async SQL search or a stored synchronous SQL search + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html | Elasticsearch API documentation} + */ + async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptions): Promise + async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_sql/async/status/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Executes a SQL request + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/sql-search-api.html | Elasticsearch API documentation} + */ + async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptions): Promise + async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['catalog', 'columnar', 'cursor', 'fetch_size', 'filter', 'query', 'request_timeout', 'page_timeout', 'time_zone', 'field_multi_value_leniency', 'runtime_mappings', 'wait_for_completion_timeout', 'params', 'keep_alive', 'keep_on_completion', 'index_using_frozen'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + params = params ?? {} + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = body != null ? 'POST' : 'GET' + const path = '/_sql' + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Translates SQL into Elasticsearch queries + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/sql-translate-api.html | Elasticsearch API documentation} + */ + async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptions): Promise + async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['fetch_size', 'filter', 'query', 'time_zone'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = body != null ? 'POST' : 'GET' + const path = '/_sql/translate' + return await this.transport.request({ path, method, querystring, body }, options) + } +} diff --git a/src/api/api/synonyms.ts b/src/api/api/synonyms.ts new file mode 100644 index 0000000..80ba965 --- /dev/null +++ b/src/api/api/synonyms.ts @@ -0,0 +1,252 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class Synonyms { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Deletes a synonym set + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonyms-set.html | Elasticsearch API documentation} + */ + async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptions): Promise + async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_synonyms/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Deletes a synonym rule in a synonym set + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonym-rule.html | Elasticsearch API documentation} + */ + async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptions): Promise + async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['set_id', 'rule_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_synonyms/${encodeURIComponent(params.set_id.toString())}/${encodeURIComponent(params.rule_id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Retrieves a synonym set + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonyms-set.html | Elasticsearch API documentation} + */ + async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptions): Promise + async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_synonyms/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Retrieves a synonym rule from a synonym set + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonym-rule.html | Elasticsearch API documentation} + */ + async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptions): Promise + async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['set_id', 'rule_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_synonyms/${encodeURIComponent(params.set_id.toString())}/${encodeURIComponent(params.rule_id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Retrieves a summary of all defined synonym sets + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-synonyms-sets.html | Elasticsearch API documentation} + */ + async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptions): Promise + async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_synonyms' + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Creates or updates a synonyms set + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonyms-set.html | Elasticsearch API documentation} + */ + async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptions): Promise + async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const acceptedBody: string[] = ['synonyms_set'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_synonyms/${encodeURIComponent(params.id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } + + /** + * Creates or updates a synonym rule in a synonym set + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonym-rule.html | Elasticsearch API documentation} + */ + async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptions): Promise + async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['set_id', 'rule_id'] + const acceptedBody: string[] = ['synonyms'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_synonyms/${encodeURIComponent(params.set_id.toString())}/${encodeURIComponent(params.rule_id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } +} diff --git a/src/api/api/tasks.ts b/src/api/api/tasks.ts new file mode 100644 index 0000000..f4706ed --- /dev/null +++ b/src/api/api/tasks.ts @@ -0,0 +1,71 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class Tasks { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Returns information about a task. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html | Elasticsearch API documentation} + */ + async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['task_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_tasks/${encodeURIComponent(params.task_id.toString())}` + return await this.transport.request({ path, method, querystring, body }, options) + } +} diff --git a/src/api/api/terms_enum.ts b/src/api/api/terms_enum.ts index 54e2b88..db54a8c 100644 --- a/src/api/api/terms_enum.ts +++ b/src/api/api/terms_enum.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/search-terms-enum.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-terms-enum.html | Elasticsearch API documentation} */ export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/termvectors.ts b/src/api/api/termvectors.ts index 0b68b06..6ffee1f 100644 --- a/src/api/api/termvectors.ts +++ b/src/api/api/termvectors.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Returns information and statistics about terms in the fields of a particular document. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-termvectors.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html | Elasticsearch API documentation} */ export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest | TB.TermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest | TB.TermvectorsRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/transform.ts b/src/api/api/transform.ts index 3581864..b2c8675 100644 --- a/src/api/api/transform.ts +++ b/src/api/api/transform.ts @@ -45,7 +45,7 @@ export default class Transform { /** * Deletes an existing transform. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/delete-transform.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-transform.html | Elasticsearch API documentation} */ async deleteTransform (this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise async deleteTransform (this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -71,7 +71,7 @@ export default class Transform { /** * Retrieves configuration information for transforms. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/get-transform.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform.html | Elasticsearch API documentation} */ async getTransform (this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getTransform (this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -105,7 +105,7 @@ export default class Transform { /** * Retrieves usage information for transforms. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/get-transform-stats.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform-stats.html | Elasticsearch API documentation} */ async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -131,7 +131,7 @@ export default class Transform { /** * Previews a transform. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/preview-transform.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/preview-transform.html | Elasticsearch API documentation} */ async previewTransform (this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise> async previewTransform (this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> @@ -177,7 +177,7 @@ export default class Transform { /** * Instantiates a transform. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/put-transform.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-transform.html | Elasticsearch API documentation} */ async putTransform (this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise async putTransform (this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -215,7 +215,7 @@ export default class Transform { /** * Resets an existing transform. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/reset-transform.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/reset-transform.html | Elasticsearch API documentation} */ async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -241,7 +241,7 @@ export default class Transform { /** * Schedules now a transform. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/schedule-now-transform.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/schedule-now-transform.html | Elasticsearch API documentation} */ async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -267,7 +267,7 @@ export default class Transform { /** * Starts one or more transforms. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/start-transform.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-transform.html | Elasticsearch API documentation} */ async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -293,7 +293,7 @@ export default class Transform { /** * Stops one or more transforms. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/stop-transform.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-transform.html | Elasticsearch API documentation} */ async stopTransform (this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise async stopTransform (this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -319,7 +319,7 @@ export default class Transform { /** * Updates certain properties of a transform. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/update-transform.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-transform.html | Elasticsearch API documentation} */ async updateTransform (this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise async updateTransform (this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/update.ts b/src/api/api/update.ts index 504ea89..d15e007 100644 --- a/src/api/api/update.ts +++ b/src/api/api/update.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Updates a document with a script or partial document. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-update.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html | Elasticsearch API documentation} */ export default async function UpdateApi (this: That, params: T.UpdateRequest | TB.UpdateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function UpdateApi (this: That, params: T.UpdateRequest | TB.UpdateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/update_by_query.ts b/src/api/api/update_by_query.ts index 869fbf3..5549386 100644 --- a/src/api/api/update_by_query.ts +++ b/src/api/api/update_by_query.ts @@ -39,7 +39,7 @@ interface That { transport: Transport } /** * Performs an update on every document in the index without changing the source, for example to pick up a mapping change. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/main/docs-update-by-query.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html | Elasticsearch API documentation} */ export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest | TB.UpdateByQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest | TB.UpdateByQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/index.ts b/src/api/index.ts index 6c7d3f4..bd42f45 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -38,8 +38,10 @@ import deleteApi from './api/delete' import deleteByQueryApi from './api/delete_by_query' import deleteScriptApi from './api/delete_script' import EnrichApi from './api/enrich' +import EqlApi from './api/eql' import existsApi from './api/exists' import existsSourceApi from './api/exists_source' +import explainApi from './api/explain' import fieldCapsApi from './api/field_caps' import getApi from './api/get' import getScriptApi from './api/get_script' @@ -49,6 +51,7 @@ import indexApi from './api/index' import IndicesApi from './api/indices' import infoApi from './api/info' import IngestApi from './api/ingest' +import LicenseApi from './api/license' import LogstashApi from './api/logstash' import mgetApi from './api/mget' import MlApi from './api/ml' @@ -58,14 +61,20 @@ import mtermvectorsApi from './api/mtermvectors' import openPointInTimeApi from './api/open_point_in_time' import pingApi from './api/ping' import putScriptApi from './api/put_script' +import QueryRulesetApi from './api/query_ruleset' import rankEvalApi from './api/rank_eval' +import reindexApi from './api/reindex' import renderSearchTemplateApi from './api/render_search_template' import scriptsPainlessExecuteApi from './api/scripts_painless_execute' import scrollApi from './api/scroll' import searchApi from './api/search' import SearchApplicationApi from './api/search_application' +import searchMvtApi from './api/search_mvt' import searchTemplateApi from './api/search_template' import SecurityApi from './api/security' +import SqlApi from './api/sql' +import SynonymsApi from './api/synonyms' +import TasksApi from './api/tasks' import termsEnumApi from './api/terms_enum' import termvectorsApi from './api/termvectors' import TransformApi from './api/transform' @@ -86,8 +95,10 @@ export default interface API { deleteByQuery: typeof deleteByQueryApi deleteScript: typeof deleteScriptApi enrich: EnrichApi + eql: EqlApi exists: typeof existsApi existsSource: typeof existsSourceApi + explain: typeof explainApi fieldCaps: typeof fieldCapsApi get: typeof getApi getScript: typeof getScriptApi @@ -97,6 +108,7 @@ export default interface API { indices: IndicesApi info: typeof infoApi ingest: IngestApi + license: LicenseApi logstash: LogstashApi mget: typeof mgetApi ml: MlApi @@ -106,14 +118,20 @@ export default interface API { openPointInTime: typeof openPointInTimeApi ping: typeof pingApi putScript: typeof putScriptApi + queryRuleset: QueryRulesetApi rankEval: typeof rankEvalApi + reindex: typeof reindexApi renderSearchTemplate: typeof renderSearchTemplateApi scriptsPainlessExecute: typeof scriptsPainlessExecuteApi scroll: typeof scrollApi search: typeof searchApi searchApplication: SearchApplicationApi + searchMvt: typeof searchMvtApi searchTemplate: typeof searchTemplateApi security: SecurityApi + sql: SqlApi + synonyms: SynonymsApi + tasks: TasksApi termsEnum: typeof termsEnumApi termvectors: typeof termvectorsApi transform: TransformApi @@ -125,13 +143,19 @@ const kAsyncSearch = Symbol('AsyncSearch') const kCat = Symbol('Cat') const kCluster = Symbol('Cluster') const kEnrich = Symbol('Enrich') +const kEql = Symbol('Eql') const kGraph = Symbol('Graph') const kIndices = Symbol('Indices') const kIngest = Symbol('Ingest') +const kLicense = Symbol('License') const kLogstash = Symbol('Logstash') const kMl = Symbol('Ml') +const kQueryRuleset = Symbol('QueryRuleset') const kSearchApplication = Symbol('SearchApplication') const kSecurity = Symbol('Security') +const kSql = Symbol('Sql') +const kSynonyms = Symbol('Synonyms') +const kTasks = Symbol('Tasks') const kTransform = Symbol('Transform') export default class API { @@ -139,26 +163,38 @@ export default class API { [kCat]: symbol | null [kCluster]: symbol | null [kEnrich]: symbol | null + [kEql]: symbol | null [kGraph]: symbol | null [kIndices]: symbol | null [kIngest]: symbol | null + [kLicense]: symbol | null [kLogstash]: symbol | null [kMl]: symbol | null + [kQueryRuleset]: symbol | null [kSearchApplication]: symbol | null [kSecurity]: symbol | null + [kSql]: symbol | null + [kSynonyms]: symbol | null + [kTasks]: symbol | null [kTransform]: symbol | null constructor () { this[kAsyncSearch] = null this[kCat] = null this[kCluster] = null this[kEnrich] = null + this[kEql] = null this[kGraph] = null this[kIndices] = null this[kIngest] = null + this[kLicense] = null this[kLogstash] = null this[kMl] = null + this[kQueryRuleset] = null this[kSearchApplication] = null this[kSecurity] = null + this[kSql] = null + this[kSynonyms] = null + this[kTasks] = null this[kTransform] = null } } @@ -173,6 +209,7 @@ API.prototype.deleteByQuery = deleteByQueryApi API.prototype.deleteScript = deleteScriptApi API.prototype.exists = existsApi API.prototype.existsSource = existsSourceApi +API.prototype.explain = explainApi API.prototype.fieldCaps = fieldCapsApi API.prototype.get = getApi API.prototype.getScript = getScriptApi @@ -187,10 +224,12 @@ API.prototype.openPointInTime = openPointInTimeApi API.prototype.ping = pingApi API.prototype.putScript = putScriptApi API.prototype.rankEval = rankEvalApi +API.prototype.reindex = reindexApi API.prototype.renderSearchTemplate = renderSearchTemplateApi API.prototype.scriptsPainlessExecute = scriptsPainlessExecuteApi API.prototype.scroll = scrollApi API.prototype.search = searchApi +API.prototype.searchMvt = searchMvtApi API.prototype.searchTemplate = searchTemplateApi API.prototype.termsEnum = termsEnumApi API.prototype.termvectors = termvectorsApi @@ -210,6 +249,9 @@ Object.defineProperties(API.prototype, { enrich: { get () { return this[kEnrich] === null ? (this[kEnrich] = new EnrichApi(this.transport)) : this[kEnrich] } }, + eql: { + get () { return this[kEql] === null ? (this[kEql] = new EqlApi(this.transport)) : this[kEql] } + }, graph: { get () { return this[kGraph] === null ? (this[kGraph] = new GraphApi(this.transport)) : this[kGraph] } }, @@ -219,18 +261,33 @@ Object.defineProperties(API.prototype, { ingest: { get () { return this[kIngest] === null ? (this[kIngest] = new IngestApi(this.transport)) : this[kIngest] } }, + license: { + get () { return this[kLicense] === null ? (this[kLicense] = new LicenseApi(this.transport)) : this[kLicense] } + }, logstash: { get () { return this[kLogstash] === null ? (this[kLogstash] = new LogstashApi(this.transport)) : this[kLogstash] } }, ml: { get () { return this[kMl] === null ? (this[kMl] = new MlApi(this.transport)) : this[kMl] } }, + queryRuleset: { + get () { return this[kQueryRuleset] === null ? (this[kQueryRuleset] = new QueryRulesetApi(this.transport)) : this[kQueryRuleset] } + }, searchApplication: { get () { return this[kSearchApplication] === null ? (this[kSearchApplication] = new SearchApplicationApi(this.transport)) : this[kSearchApplication] } }, security: { get () { return this[kSecurity] === null ? (this[kSecurity] = new SecurityApi(this.transport)) : this[kSecurity] } }, + sql: { + get () { return this[kSql] === null ? (this[kSql] = new SqlApi(this.transport)) : this[kSql] } + }, + synonyms: { + get () { return this[kSynonyms] === null ? (this[kSynonyms] = new SynonymsApi(this.transport)) : this[kSynonyms] } + }, + tasks: { + get () { return this[kTasks] === null ? (this[kTasks] = new TasksApi(this.transport)) : this[kTasks] } + }, transform: { get () { return this[kTransform] === null ? (this[kTransform] = new TransformApi(this.transport)) : this[kTransform] } } diff --git a/src/api/types.ts b/src/api/types.ts index e1ac1af..b9d1811 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -555,6 +555,7 @@ export interface HealthReportRequest extends RequestBase { export interface HealthReportResponse { cluster_name: string indicators: HealthReportIndicators + status?: HealthReportIndicatorHealthStatus } export interface HealthReportShardsAvailabilityIndicator extends HealthReportBaseIndicator { @@ -1136,6 +1137,7 @@ export interface SearchRequest extends RequestBase { _source_includes?: Fields q?: string aggregations?: Record + /** @alias aggregations */ aggs?: Record collapse?: SearchFieldCollapse explain?: boolean @@ -1939,6 +1941,8 @@ export interface SpecUtilsBaseNode { transport_address: TransportAddress } +export type SpecUtilsPipeSeparatedFlags = T | string + export type SpecUtilsStringified = T | string export interface AcknowledgedResponseBase { @@ -1973,14 +1977,28 @@ export type Bytes = 'b' | 'kb' | 'mb' | 'gb' | 'tb' | 'pb' export type CategoryId = string +export type ClusterAlias = string + +export interface ClusterDetails { + status: ClusterSearchStatus + indices: string + took?: DurationValue + timed_out: boolean + _shards?: ShardStatistics + failures?: ShardFailure[] +} + export type ClusterInfoTarget = '_all' | 'http' | 'ingest' | 'thread_pool' | 'script' export type ClusterInfoTargets = ClusterInfoTarget | ClusterInfoTarget[] +export type ClusterSearchStatus = 'running' | 'successful' | 'partial' | 'skipped' | 'failed' + export interface ClusterStatistics { skipped: integer successful: integer total: integer + details?: Record } export interface CompletionStats { @@ -2242,6 +2260,7 @@ export interface KnnQuery { num_candidates: long boost?: float filter?: QueryDslQueryContainer | QueryDslQueryContainer[] + similarity?: float } export interface LatLonGeoLocation { @@ -2984,11 +3003,20 @@ export interface AggregationsCompositeAggregation extends AggregationsBucketAggr sources?: Record[] } +export interface AggregationsCompositeAggregationBase { + field?: Field + missing_bucket?: boolean + missing_order?: AggregationsMissingOrder + script?: Script + value_type?: AggregationsValueType + order?: SortOrder +} + export interface AggregationsCompositeAggregationSource { - terms?: AggregationsTermsAggregation - histogram?: AggregationsHistogramAggregation - date_histogram?: AggregationsDateHistogramAggregation - geotile_grid?: AggregationsGeoTileGridAggregation + terms?: AggregationsCompositeTermsAggregation + histogram?: AggregationsCompositeHistogramAggregation + date_histogram?: AggregationsCompositeDateHistogramAggregation + geotile_grid?: AggregationsCompositeGeoTileGridAggregation } export interface AggregationsCompositeBucketKeys extends AggregationsMultiBucketBase { @@ -2997,6 +3025,26 @@ export interface AggregationsCompositeBucketKeys extends AggregationsMultiBucket export type AggregationsCompositeBucket = AggregationsCompositeBucketKeys & { [property: string]: AggregationsAggregate | AggregationsCompositeAggregateKey | long } +export interface AggregationsCompositeDateHistogramAggregation extends AggregationsCompositeAggregationBase { + format?: string + calendar_interval?: DurationLarge + fixed_interval?: DurationLarge + offset?: Duration + time_zone?: TimeZone +} + +export interface AggregationsCompositeGeoTileGridAggregation extends AggregationsCompositeAggregationBase { + precision?: integer + bounds?: GeoBounds +} + +export interface AggregationsCompositeHistogramAggregation extends AggregationsCompositeAggregationBase { + interval: double +} + +export interface AggregationsCompositeTermsAggregation extends AggregationsCompositeAggregationBase { +} + export interface AggregationsCumulativeCardinalityAggregate extends AggregationsAggregateBase { value: long value_as_string?: string @@ -3178,8 +3226,8 @@ export type AggregationsFrequentItemSetsBucket = AggregationsFrequentItemSetsBuc export interface AggregationsFrequentItemSetsField { field: Field - exclude?: string | string[] - include?: string | string[] + exclude?: AggregationsTermsExclude + include?: AggregationsTermsInclude } export type AggregationsGapPolicy = 'skip' | 'insert_zeros' | 'keep_values' @@ -3794,7 +3842,7 @@ export interface AggregationsSignificantTextAggregation extends AggregationsBuck field?: Field filter_duplicate_text?: boolean gnd?: AggregationsGoogleNormalizedDistanceHeuristic - include?: string | string[] + include?: AggregationsTermsInclude jlh?: EmptyObject min_doc_count?: long mutual_information?: AggregationsMutualInformationHeuristic @@ -4171,7 +4219,7 @@ export interface AnalysisElisionTokenFilter extends AnalysisTokenFilterBase { type: 'elision' articles?: string[] articles_path?: string - articles_case?: boolean + articles_case?: SpecUtilsStringified } export interface AnalysisFingerprintAnalyzer { @@ -4440,11 +4488,11 @@ export type AnalysisNormalizer = AnalysisLowercaseNormalizer | AnalysisCustomNor export interface AnalysisPathHierarchyTokenizer extends AnalysisTokenizerBase { type: 'path_hierarchy' - buffer_size: integer + buffer_size: SpecUtilsStringified delimiter: string replacement: string - reverse: boolean - skip: integer + reverse: SpecUtilsStringified + skip: SpecUtilsStringified } export interface AnalysisPatternAnalyzer { @@ -4479,9 +4527,9 @@ export interface AnalysisPatternReplaceTokenFilter extends AnalysisTokenFilterBa export interface AnalysisPatternTokenizer extends AnalysisTokenizerBase { type: 'pattern' - flags: string - group: integer - pattern: string + flags?: string + group?: integer + pattern?: string } export type AnalysisPhoneticEncoder = 'metaphone' | 'double_metaphone' | 'soundex' | 'refined_soundex' | 'caverphone1' | 'caverphone2' | 'cologne' | 'nysiis' | 'koelnerphonetik' | 'haasephonetik' | 'beider_morse' | 'daitch_mokotoff' @@ -5687,6 +5735,7 @@ export interface QueryDslQueryContainer { range?: Partial> rank_feature?: QueryDslRankFeatureQuery regexp?: Partial> + rule_query?: QueryDslRuleQuery script?: QueryDslScriptQuery script_score?: QueryDslScriptScoreQuery shape?: QueryDslShapeQuery @@ -5783,6 +5832,12 @@ export interface QueryDslRegexpQuery extends QueryDslQueryBase { value: string } +export interface QueryDslRuleQuery extends QueryDslQueryBase { + organic: QueryDslQueryContainer + ruleset_id: Id + match_criteria: any +} + export interface QueryDslScriptQuery extends QueryDslQueryBase { script: Script } @@ -5809,9 +5864,9 @@ export interface QueryDslShapeQueryKeys extends QueryDslQueryBase { export type QueryDslShapeQuery = QueryDslShapeQueryKeys & { [property: string]: QueryDslShapeFieldQuery | boolean | float | string } -export type QueryDslSimpleQueryStringFlag = 'NONE' | 'AND' | 'OR' | 'NOT' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL' +export type QueryDslSimpleQueryStringFlag = 'NONE' | 'AND' | 'NOT' | 'OR' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL' -export type QueryDslSimpleQueryStringFlags = QueryDslSimpleQueryStringFlag | string +export type QueryDslSimpleQueryStringFlags = SpecUtilsPipeSeparatedFlags export interface QueryDslSimpleQueryStringQuery extends QueryDslQueryBase { analyzer?: string @@ -5915,7 +5970,6 @@ export interface QueryDslTermsSetQuery extends QueryDslQueryBase { } export interface QueryDslTextExpansionQuery extends QueryDslQueryBase { - value: Field model_id: string model_text: string } @@ -5967,6 +6021,8 @@ export interface AsyncSearchAsyncSearchResponseBase { expiration_time_in_millis: EpochTime start_time?: DateTime start_time_in_millis: EpochTime + completion_time?: DateTime + completion_time_in_millis?: EpochTime } export interface AsyncSearchDeleteRequest extends RequestBase { @@ -5992,6 +6048,7 @@ export type AsyncSearchStatusResponse = AsyncSearchStatusStatusResponseBase export interface AsyncSearchStatusStatusResponseBase extends AsyncSearchAsyncSearchResponseBase { _shards: ShardStatistics + _clusters?: ClusterStatistics completion_status?: integer } @@ -6030,6 +6087,7 @@ export interface AsyncSearchSubmitRequest extends RequestBase { _source_includes?: Fields q?: string aggregations?: Record + /** @alias aggregations */ aggs?: Record collapse?: SearchFieldCollapse explain?: boolean @@ -9099,6 +9157,7 @@ export interface FleetSearchRequest extends RequestBase { wait_for_checkpoints?: FleetCheckpoint[] allow_partial_search_results?: boolean aggregations?: Record + /** @alias aggregations */ aggs?: Record collapse?: SearchFieldCollapse explain?: boolean @@ -9416,15 +9475,6 @@ export interface IndicesCacheQueries { enabled: boolean } -export interface IndicesDataLifecycle { - data_retention?: Duration -} - -export interface IndicesDataLifecycleWithRollover { - data_retention?: Duration - rollover?: IndicesDlmRolloverConditions -} - export interface IndicesDataStream { _meta?: Metadata allow_custom_routing?: boolean @@ -9444,15 +9494,16 @@ export interface IndicesDataStreamIndex { index_uuid: Uuid } -export interface IndicesDataStreamTimestampField { - name: Field +export interface IndicesDataStreamLifecycle { + data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling } -export interface IndicesDataStreamVisibility { - hidden?: boolean +export interface IndicesDataStreamLifecycleDownsampling { + rounds: IndicesDownsamplingRound[] } -export interface IndicesDlmRolloverConditions { +export interface IndicesDataStreamLifecycleRolloverConditions { min_age?: Duration max_age?: string min_docs?: long @@ -9465,10 +9516,29 @@ export interface IndicesDlmRolloverConditions { max_primary_shard_docs?: long } +export interface IndicesDataStreamLifecycleWithRollover { + data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling + rollover?: IndicesDataStreamLifecycleRolloverConditions +} + +export interface IndicesDataStreamTimestampField { + name: Field +} + +export interface IndicesDataStreamVisibility { + hidden?: boolean +} + export interface IndicesDownsampleConfig { fixed_interval: DurationLarge } +export interface IndicesDownsamplingRound { + after: Duration + config: IndicesDownsampleConfig +} + export interface IndicesFielddataFrequencyFilter { max: double min: double @@ -9580,7 +9650,7 @@ export interface IndicesIndexSettingsKeys { queries?: IndicesQueries similarity?: IndicesSettingsSimilarity mapping?: IndicesMappingLimitSettings - 'indexing.slowlog'?: IndicesSlowlogSettings + 'indexing.slowlog'?: IndicesIndexingSlowlogSettings indexing_pressure?: IndicesIndexingPressure store?: IndicesStorage } @@ -9656,6 +9726,17 @@ export interface IndicesIndexingPressureMemory { limit?: integer } +export interface IndicesIndexingSlowlogSettings { + level?: string + source?: integer + reformat?: boolean + threshold?: IndicesIndexingSlowlogTresholds +} + +export interface IndicesIndexingSlowlogTresholds { + index?: IndicesSlowlogTresholdLevels +} + export interface IndicesMappingLimitSettings { coerce?: boolean total_fields?: IndicesMappingLimitSettingsTotalFields @@ -9809,7 +9890,6 @@ export interface IndicesSlowlogTresholdLevels { export interface IndicesSlowlogTresholds { query?: IndicesSlowlogTresholdLevels fetch?: IndicesSlowlogTresholdLevels - index?: IndicesSlowlogTresholdLevels } export interface IndicesSoftDeletes { @@ -10144,14 +10224,14 @@ export interface IndicesExistsTemplateRequest extends RequestBase { export type IndicesExistsTemplateResponse = boolean -export interface IndicesExplainDataLifecycleDataLifecycleExplain { +export interface IndicesExplainDataLifecycleDataStreamLifecycleExplain { index: IndexName - managed_by_dlm: boolean + managed_by_lifecycle: boolean index_creation_date_millis?: EpochTime time_since_index_creation?: Duration rollover_date_millis?: EpochTime time_since_rollover?: Duration - lifecycle?: IndicesDataLifecycleWithRollover + lifecycle?: IndicesDataStreamLifecycleWithRollover generation_time?: Duration error?: string } @@ -10163,7 +10243,7 @@ export interface IndicesExplainDataLifecycleRequest extends RequestBase { } export interface IndicesExplainDataLifecycleResponse { - indices: Record + indices: Record } export interface IndicesFieldUsageStatsFieldSummary { @@ -10282,9 +10362,9 @@ export interface IndicesGetAliasRequest extends RequestBase { export type IndicesGetAliasResponse = Record -export interface IndicesGetDataLifecycleDataStreamLifecycle { +export interface IndicesGetDataLifecycleDataStreamWithLifecycle { name: DataStreamName - lifecycle?: IndicesDataLifecycle + lifecycle?: IndicesDataStreamLifecycle } export interface IndicesGetDataLifecycleRequest extends RequestBase { @@ -10294,7 +10374,7 @@ export interface IndicesGetDataLifecycleRequest extends RequestBase { } export interface IndicesGetDataLifecycleResponse { - data_streams: IndicesGetDataLifecycleDataStreamLifecycle[] + data_streams: IndicesGetDataLifecycleDataStreamWithLifecycle[] } export interface IndicesGetDataStreamRequest extends RequestBase { @@ -10440,6 +10520,7 @@ export interface IndicesPutDataLifecycleRequest extends RequestBase { master_timeout?: Duration timeout?: Duration data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling } export type IndicesPutDataLifecycleResponse = AcknowledgedResponseBase @@ -10639,6 +10720,11 @@ export interface IndicesReloadSearchAnalyzersReloadDetails { reloaded_node_ids: string[] } +export interface IndicesReloadSearchAnalyzersReloadResult { + reload_details: IndicesReloadSearchAnalyzersReloadDetails[] + _shards: ShardStatistics +} + export interface IndicesReloadSearchAnalyzersRequest extends RequestBase { index: Indices allow_no_indices?: boolean @@ -10646,10 +10732,7 @@ export interface IndicesReloadSearchAnalyzersRequest extends RequestBase { ignore_unavailable?: boolean } -export interface IndicesReloadSearchAnalyzersResponse { - reload_details: IndicesReloadSearchAnalyzersReloadDetails[] - _shards: ShardStatistics -} +export type IndicesReloadSearchAnalyzersResponse = IndicesReloadSearchAnalyzersReloadResult export interface IndicesResolveIndexRequest extends RequestBase { name: Names @@ -12008,7 +12091,6 @@ export type MlDatafeedState = 'started' | 'stopped' | 'starting' | 'stopping' export interface MlDatafeedStats { assignment_explanation?: string datafeed_id: Id - node?: MlDiscoveryNode state: MlDatafeedState timing_stats: MlDatafeedTimingStats running_state?: MlDatafeedRunningState @@ -12120,7 +12202,6 @@ export interface MlDataframeAnalytics { data_counts: MlDataframeAnalyticsStatsDataCounts id: Id memory_usage: MlDataframeAnalyticsStatsMemoryUsage - node?: NodeAttributes progress: MlDataframeAnalyticsStatsProgress[] state: MlDataframeState } @@ -12509,7 +12590,6 @@ export interface MlJobStats { forecasts_stats: MlJobForecastStatistics job_id: string model_size_stats: MlModelSizeStats - node?: MlDiscoveryNode open_time?: DateTime state: MlJobState timing_stats: MlJobTimingStats @@ -12574,7 +12654,6 @@ export interface MlModelSnapshotUpgrade { job_id: Id snapshot_id: Id state: MlSnapshotUpgradeState - node: MlDiscoveryNode assignment_explanation: string } @@ -12834,7 +12913,6 @@ export interface MlTrainedModelDeploymentNodesStats { error_count: integer inference_count: integer last_access: long - node: MlDiscoveryNode number_of_allocations: integer number_of_pending_requests: integer rejection_execution_count: integer @@ -13690,6 +13768,7 @@ export interface MlPutDatafeedRequest extends RequestBase { delayed_data_check_config?: MlDelayedDataCheckConfig frequency?: Duration indices?: Indices + /** @alias indices */ indexes?: Indices indices_options?: IndicesOptions job_id?: Id @@ -13824,6 +13903,7 @@ export interface MlPutTrainedModelRequest extends RequestBase { metadata?: any model_type?: MlTrainedModelType model_size_bytes?: long + platform_architecture?: string tags?: string[] } @@ -14018,6 +14098,7 @@ export interface MlUpdateDatafeedRequest extends RequestBase { delayed_data_check_config?: MlDelayedDataCheckConfig frequency?: Duration indices?: string[] + /** @alias indices */ indexes?: string[] indices_options?: IndicesOptions job_id?: Id @@ -15069,6 +15150,69 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { nodes: Record } +export interface QueryRulesetQueryRule { + rule_id: Id + type: QueryRulesetQueryRuleType + criteria: QueryRulesetQueryRuleCriteria[] + actions: QueryRulesetQueryRuleActions +} + +export interface QueryRulesetQueryRuleActions { + ids?: Id[] + docs?: QueryDslPinnedDoc[] +} + +export interface QueryRulesetQueryRuleCriteria { + type: QueryRulesetQueryRuleCriteriaType + metadata: string + values?: any[] +} + +export type QueryRulesetQueryRuleCriteriaType = 'global' | 'exact' | 'exact_fuzzy' | 'prefix' | 'suffix' | 'contains' | 'lt' | 'lte' | 'gt' | 'gte' + +export type QueryRulesetQueryRuleType = 'pinned' + +export interface QueryRulesetQueryRuleset { + ruleset_id: Id + rules: QueryRulesetQueryRule[] +} + +export interface QueryRulesetDeleteRequest extends RequestBase { + ruleset_id: Id +} + +export type QueryRulesetDeleteResponse = AcknowledgedResponseBase + +export interface QueryRulesetGetRequest extends RequestBase { + ruleset_id: Id +} + +export type QueryRulesetGetResponse = QueryRulesetQueryRuleset + +export interface QueryRulesetListQueryRulesetListItem { + ruleset_id: Id + rules_count: integer +} + +export interface QueryRulesetListRequest extends RequestBase { + from?: integer + size?: integer +} + +export interface QueryRulesetListResponse { + count: long + results: QueryRulesetListQueryRulesetListItem[] +} + +export interface QueryRulesetPutRequest extends RequestBase { + ruleset_id: Id + rules: QueryRulesetQueryRule[] +} + +export interface QueryRulesetPutResponse { + result: Result +} + export interface RollupDateHistogramGrouping { delay?: Duration field: Field @@ -15223,6 +15367,7 @@ export interface RollupRollupSearchRequest extends RequestBase { rest_total_hits_as_int?: boolean typed_keys?: boolean aggregations?: Record + /** @alias aggregations */ aggs?: Record query?: QueryDslQueryContainer size?: integer @@ -16849,6 +16994,87 @@ export interface SslCertificatesRequest extends RequestBase { export type SslCertificatesResponse = SslCertificatesCertificateInformation[] +export interface SynonymsSynonymRule { + id?: Id + synonyms: SynonymsSynonymString +} + +export interface SynonymsSynonymRuleRead { + id: Id + synonyms: SynonymsSynonymString +} + +export type SynonymsSynonymString = string + +export interface SynonymsSynonymsUpdateResult { + result: Result + reload_analyzers_details: IndicesReloadSearchAnalyzersReloadResult +} + +export interface SynonymsDeleteSynonymRequest extends RequestBase { + id: Id +} + +export type SynonymsDeleteSynonymResponse = AcknowledgedResponseBase + +export interface SynonymsDeleteSynonymRuleRequest extends RequestBase { + set_id: Id + rule_id: Id +} + +export type SynonymsDeleteSynonymRuleResponse = SynonymsSynonymsUpdateResult + +export interface SynonymsGetSynonymRequest extends RequestBase { + id: Id + from?: integer + size?: integer +} + +export interface SynonymsGetSynonymResponse { + count: integer + synonyms_set: SynonymsSynonymRuleRead[] +} + +export interface SynonymsGetSynonymRuleRequest extends RequestBase { + set_id: Id + rule_id: Id +} + +export type SynonymsGetSynonymRuleResponse = SynonymsSynonymRuleRead + +export interface SynonymsGetSynonymsSetsRequest extends RequestBase { + from?: integer + size?: integer +} + +export interface SynonymsGetSynonymsSetsResponse { + count: integer + results: SynonymsGetSynonymsSetsSynonymsSetItem[] +} + +export interface SynonymsGetSynonymsSetsSynonymsSetItem { + synonyms_set: Id + count: integer +} + +export interface SynonymsPutSynonymRequest extends RequestBase { + id: Id + synonyms_set: SynonymsSynonymRule[] +} + +export interface SynonymsPutSynonymResponse { + result: Result + reload_analyzers_details: IndicesReloadSearchAnalyzersReloadDetails +} + +export interface SynonymsPutSynonymRuleRequest extends RequestBase { + set_id: Id + rule_id: Id + synonyms: SynonymsSynonymString[] +} + +export type SynonymsPutSynonymRuleResponse = SynonymsSynonymsUpdateResult + export type TasksGroupBy = 'nodes' | 'parents' | 'none' export interface TasksNodeTasks { @@ -16876,7 +17102,7 @@ export interface TasksTaskInfo { running_time?: Duration running_time_in_nanos: DurationValue start_time_in_millis: EpochTime - status?: TasksTaskStatus + status?: any type: string parent_task_id?: TaskId } @@ -16890,26 +17116,6 @@ export interface TasksTaskListResponseBase { tasks?: TasksTaskInfos } -export interface TasksTaskStatus { - batches: long - canceled?: string - created: long - deleted: long - noops: long - failures?: string[] - requests_per_second: float - retries: Retries - throttled?: Duration - throttled_millis: DurationValue - throttled_until?: Duration - throttled_until_millis: DurationValue - timed_out?: boolean - took?: DurationValue - total: long - updated: long - version_conflicts: long -} - export interface TasksCancelRequest extends RequestBase { task_id?: TaskId actions?: string | string[] @@ -16929,7 +17135,7 @@ export interface TasksGetRequest extends RequestBase { export interface TasksGetResponse { completed: boolean task: TasksTaskInfo - response?: TasksTaskStatus + response?: any error?: ErrorCause } @@ -17161,7 +17367,6 @@ export interface TransformGetTransformStatsTransformStats { checkpointing: TransformGetTransformStatsCheckpointing health?: TransformGetTransformStatsTransformStatsHealth id: Id - node?: NodeAttributes reason?: string state: string stats: TransformGetTransformStatsTransformIndexerStats diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 08551be..bf19fc7 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -576,6 +576,7 @@ export interface HealthReportRequest extends RequestBase { export interface HealthReportResponse { cluster_name: string indicators: HealthReportIndicators + status?: HealthReportIndicatorHealthStatus } export interface HealthReportShardsAvailabilityIndicator extends HealthReportBaseIndicator { @@ -1190,6 +1191,7 @@ export interface SearchRequest extends RequestBase { /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { aggregations?: Record + /** @alias aggregations */ aggs?: Record collapse?: SearchFieldCollapse explain?: boolean @@ -2012,6 +2014,8 @@ export interface SpecUtilsBaseNode { transport_address: TransportAddress } +export type SpecUtilsPipeSeparatedFlags = T | string + export type SpecUtilsStringified = T | string export interface AcknowledgedResponseBase { @@ -2046,14 +2050,28 @@ export type Bytes = 'b' | 'kb' | 'mb' | 'gb' | 'tb' | 'pb' export type CategoryId = string +export type ClusterAlias = string + +export interface ClusterDetails { + status: ClusterSearchStatus + indices: string + took?: DurationValue + timed_out: boolean + _shards?: ShardStatistics + failures?: ShardFailure[] +} + export type ClusterInfoTarget = '_all' | 'http' | 'ingest' | 'thread_pool' | 'script' export type ClusterInfoTargets = ClusterInfoTarget | ClusterInfoTarget[] +export type ClusterSearchStatus = 'running' | 'successful' | 'partial' | 'skipped' | 'failed' + export interface ClusterStatistics { skipped: integer successful: integer total: integer + details?: Record } export interface CompletionStats { @@ -2315,6 +2333,7 @@ export interface KnnQuery { num_candidates: long boost?: float filter?: QueryDslQueryContainer | QueryDslQueryContainer[] + similarity?: float } export interface LatLonGeoLocation { @@ -3057,11 +3076,20 @@ export interface AggregationsCompositeAggregation extends AggregationsBucketAggr sources?: Record[] } +export interface AggregationsCompositeAggregationBase { + field?: Field + missing_bucket?: boolean + missing_order?: AggregationsMissingOrder + script?: Script + value_type?: AggregationsValueType + order?: SortOrder +} + export interface AggregationsCompositeAggregationSource { - terms?: AggregationsTermsAggregation - histogram?: AggregationsHistogramAggregation - date_histogram?: AggregationsDateHistogramAggregation - geotile_grid?: AggregationsGeoTileGridAggregation + terms?: AggregationsCompositeTermsAggregation + histogram?: AggregationsCompositeHistogramAggregation + date_histogram?: AggregationsCompositeDateHistogramAggregation + geotile_grid?: AggregationsCompositeGeoTileGridAggregation } export interface AggregationsCompositeBucketKeys extends AggregationsMultiBucketBase { @@ -3070,6 +3098,26 @@ export interface AggregationsCompositeBucketKeys extends AggregationsMultiBucket export type AggregationsCompositeBucket = AggregationsCompositeBucketKeys & { [property: string]: AggregationsAggregate | AggregationsCompositeAggregateKey | long } +export interface AggregationsCompositeDateHistogramAggregation extends AggregationsCompositeAggregationBase { + format?: string + calendar_interval?: DurationLarge + fixed_interval?: DurationLarge + offset?: Duration + time_zone?: TimeZone +} + +export interface AggregationsCompositeGeoTileGridAggregation extends AggregationsCompositeAggregationBase { + precision?: integer + bounds?: GeoBounds +} + +export interface AggregationsCompositeHistogramAggregation extends AggregationsCompositeAggregationBase { + interval: double +} + +export interface AggregationsCompositeTermsAggregation extends AggregationsCompositeAggregationBase { +} + export interface AggregationsCumulativeCardinalityAggregate extends AggregationsAggregateBase { value: long value_as_string?: string @@ -3251,8 +3299,8 @@ export type AggregationsFrequentItemSetsBucket = AggregationsFrequentItemSetsBuc export interface AggregationsFrequentItemSetsField { field: Field - exclude?: string | string[] - include?: string | string[] + exclude?: AggregationsTermsExclude + include?: AggregationsTermsInclude } export type AggregationsGapPolicy = 'skip' | 'insert_zeros' | 'keep_values' @@ -3867,7 +3915,7 @@ export interface AggregationsSignificantTextAggregation extends AggregationsBuck field?: Field filter_duplicate_text?: boolean gnd?: AggregationsGoogleNormalizedDistanceHeuristic - include?: string | string[] + include?: AggregationsTermsInclude jlh?: EmptyObject min_doc_count?: long mutual_information?: AggregationsMutualInformationHeuristic @@ -4244,7 +4292,7 @@ export interface AnalysisElisionTokenFilter extends AnalysisTokenFilterBase { type: 'elision' articles?: string[] articles_path?: string - articles_case?: boolean + articles_case?: SpecUtilsStringified } export interface AnalysisFingerprintAnalyzer { @@ -4513,11 +4561,11 @@ export type AnalysisNormalizer = AnalysisLowercaseNormalizer | AnalysisCustomNor export interface AnalysisPathHierarchyTokenizer extends AnalysisTokenizerBase { type: 'path_hierarchy' - buffer_size: integer + buffer_size: SpecUtilsStringified delimiter: string replacement: string - reverse: boolean - skip: integer + reverse: SpecUtilsStringified + skip: SpecUtilsStringified } export interface AnalysisPatternAnalyzer { @@ -4552,9 +4600,9 @@ export interface AnalysisPatternReplaceTokenFilter extends AnalysisTokenFilterBa export interface AnalysisPatternTokenizer extends AnalysisTokenizerBase { type: 'pattern' - flags: string - group: integer - pattern: string + flags?: string + group?: integer + pattern?: string } export type AnalysisPhoneticEncoder = 'metaphone' | 'double_metaphone' | 'soundex' | 'refined_soundex' | 'caverphone1' | 'caverphone2' | 'cologne' | 'nysiis' | 'koelnerphonetik' | 'haasephonetik' | 'beider_morse' | 'daitch_mokotoff' @@ -5760,6 +5808,7 @@ export interface QueryDslQueryContainer { range?: Partial> rank_feature?: QueryDslRankFeatureQuery regexp?: Partial> + rule_query?: QueryDslRuleQuery script?: QueryDslScriptQuery script_score?: QueryDslScriptScoreQuery shape?: QueryDslShapeQuery @@ -5856,6 +5905,12 @@ export interface QueryDslRegexpQuery extends QueryDslQueryBase { value: string } +export interface QueryDslRuleQuery extends QueryDslQueryBase { + organic: QueryDslQueryContainer + ruleset_id: Id + match_criteria: any +} + export interface QueryDslScriptQuery extends QueryDslQueryBase { script: Script } @@ -5882,9 +5937,9 @@ export interface QueryDslShapeQueryKeys extends QueryDslQueryBase { export type QueryDslShapeQuery = QueryDslShapeQueryKeys & { [property: string]: QueryDslShapeFieldQuery | boolean | float | string } -export type QueryDslSimpleQueryStringFlag = 'NONE' | 'AND' | 'OR' | 'NOT' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL' +export type QueryDslSimpleQueryStringFlag = 'NONE' | 'AND' | 'NOT' | 'OR' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL' -export type QueryDslSimpleQueryStringFlags = QueryDslSimpleQueryStringFlag | string +export type QueryDslSimpleQueryStringFlags = SpecUtilsPipeSeparatedFlags export interface QueryDslSimpleQueryStringQuery extends QueryDslQueryBase { analyzer?: string @@ -5988,7 +6043,6 @@ export interface QueryDslTermsSetQuery extends QueryDslQueryBase { } export interface QueryDslTextExpansionQuery extends QueryDslQueryBase { - value: Field model_id: string model_text: string } @@ -6040,6 +6094,8 @@ export interface AsyncSearchAsyncSearchResponseBase { expiration_time_in_millis: EpochTime start_time?: DateTime start_time_in_millis: EpochTime + completion_time?: DateTime + completion_time_in_millis?: EpochTime } export interface AsyncSearchDeleteRequest extends RequestBase { @@ -6065,6 +6121,7 @@ export type AsyncSearchStatusResponse = AsyncSearchStatusStatusResponseBase export interface AsyncSearchStatusStatusResponseBase extends AsyncSearchAsyncSearchResponseBase { _shards: ShardStatistics + _clusters?: ClusterStatistics completion_status?: integer } @@ -6105,6 +6162,7 @@ export interface AsyncSearchSubmitRequest extends RequestBase { /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { aggregations?: Record + /** @alias aggregations */ aggs?: Record collapse?: SearchFieldCollapse explain?: boolean @@ -9209,6 +9267,7 @@ export interface FleetSearchRequest extends RequestBase { /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { aggregations?: Record + /** @alias aggregations */ aggs?: Record collapse?: SearchFieldCollapse explain?: boolean @@ -9539,15 +9598,6 @@ export interface IndicesCacheQueries { enabled: boolean } -export interface IndicesDataLifecycle { - data_retention?: Duration -} - -export interface IndicesDataLifecycleWithRollover { - data_retention?: Duration - rollover?: IndicesDlmRolloverConditions -} - export interface IndicesDataStream { _meta?: Metadata allow_custom_routing?: boolean @@ -9567,15 +9617,16 @@ export interface IndicesDataStreamIndex { index_uuid: Uuid } -export interface IndicesDataStreamTimestampField { - name: Field +export interface IndicesDataStreamLifecycle { + data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling } -export interface IndicesDataStreamVisibility { - hidden?: boolean +export interface IndicesDataStreamLifecycleDownsampling { + rounds: IndicesDownsamplingRound[] } -export interface IndicesDlmRolloverConditions { +export interface IndicesDataStreamLifecycleRolloverConditions { min_age?: Duration max_age?: string min_docs?: long @@ -9588,10 +9639,29 @@ export interface IndicesDlmRolloverConditions { max_primary_shard_docs?: long } +export interface IndicesDataStreamLifecycleWithRollover { + data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling + rollover?: IndicesDataStreamLifecycleRolloverConditions +} + +export interface IndicesDataStreamTimestampField { + name: Field +} + +export interface IndicesDataStreamVisibility { + hidden?: boolean +} + export interface IndicesDownsampleConfig { fixed_interval: DurationLarge } +export interface IndicesDownsamplingRound { + after: Duration + config: IndicesDownsampleConfig +} + export interface IndicesFielddataFrequencyFilter { max: double min: double @@ -9703,7 +9773,7 @@ export interface IndicesIndexSettingsKeys { queries?: IndicesQueries similarity?: IndicesSettingsSimilarity mapping?: IndicesMappingLimitSettings - 'indexing.slowlog'?: IndicesSlowlogSettings + 'indexing.slowlog'?: IndicesIndexingSlowlogSettings indexing_pressure?: IndicesIndexingPressure store?: IndicesStorage } @@ -9779,6 +9849,17 @@ export interface IndicesIndexingPressureMemory { limit?: integer } +export interface IndicesIndexingSlowlogSettings { + level?: string + source?: integer + reformat?: boolean + threshold?: IndicesIndexingSlowlogTresholds +} + +export interface IndicesIndexingSlowlogTresholds { + index?: IndicesSlowlogTresholdLevels +} + export interface IndicesMappingLimitSettings { coerce?: boolean total_fields?: IndicesMappingLimitSettingsTotalFields @@ -9932,7 +10013,6 @@ export interface IndicesSlowlogTresholdLevels { export interface IndicesSlowlogTresholds { query?: IndicesSlowlogTresholdLevels fetch?: IndicesSlowlogTresholdLevels - index?: IndicesSlowlogTresholdLevels } export interface IndicesSoftDeletes { @@ -10277,14 +10357,14 @@ export interface IndicesExistsTemplateRequest extends RequestBase { export type IndicesExistsTemplateResponse = boolean -export interface IndicesExplainDataLifecycleDataLifecycleExplain { +export interface IndicesExplainDataLifecycleDataStreamLifecycleExplain { index: IndexName - managed_by_dlm: boolean + managed_by_lifecycle: boolean index_creation_date_millis?: EpochTime time_since_index_creation?: Duration rollover_date_millis?: EpochTime time_since_rollover?: Duration - lifecycle?: IndicesDataLifecycleWithRollover + lifecycle?: IndicesDataStreamLifecycleWithRollover generation_time?: Duration error?: string } @@ -10296,7 +10376,7 @@ export interface IndicesExplainDataLifecycleRequest extends RequestBase { } export interface IndicesExplainDataLifecycleResponse { - indices: Record + indices: Record } export interface IndicesFieldUsageStatsFieldSummary { @@ -10415,9 +10495,9 @@ export interface IndicesGetAliasRequest extends RequestBase { export type IndicesGetAliasResponse = Record -export interface IndicesGetDataLifecycleDataStreamLifecycle { +export interface IndicesGetDataLifecycleDataStreamWithLifecycle { name: DataStreamName - lifecycle?: IndicesDataLifecycle + lifecycle?: IndicesDataStreamLifecycle } export interface IndicesGetDataLifecycleRequest extends RequestBase { @@ -10427,7 +10507,7 @@ export interface IndicesGetDataLifecycleRequest extends RequestBase { } export interface IndicesGetDataLifecycleResponse { - data_streams: IndicesGetDataLifecycleDataStreamLifecycle[] + data_streams: IndicesGetDataLifecycleDataStreamWithLifecycle[] } export interface IndicesGetDataStreamRequest extends RequestBase { @@ -10581,6 +10661,7 @@ export interface IndicesPutDataLifecycleRequest extends RequestBase { /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling } } @@ -10791,6 +10872,11 @@ export interface IndicesReloadSearchAnalyzersReloadDetails { reloaded_node_ids: string[] } +export interface IndicesReloadSearchAnalyzersReloadResult { + reload_details: IndicesReloadSearchAnalyzersReloadDetails[] + _shards: ShardStatistics +} + export interface IndicesReloadSearchAnalyzersRequest extends RequestBase { index: Indices allow_no_indices?: boolean @@ -10798,10 +10884,7 @@ export interface IndicesReloadSearchAnalyzersRequest extends RequestBase { ignore_unavailable?: boolean } -export interface IndicesReloadSearchAnalyzersResponse { - reload_details: IndicesReloadSearchAnalyzersReloadDetails[] - _shards: ShardStatistics -} +export type IndicesReloadSearchAnalyzersResponse = IndicesReloadSearchAnalyzersReloadResult export interface IndicesResolveIndexRequest extends RequestBase { name: Names @@ -12189,7 +12272,6 @@ export type MlDatafeedState = 'started' | 'stopped' | 'starting' | 'stopping' export interface MlDatafeedStats { assignment_explanation?: string datafeed_id: Id - node?: MlDiscoveryNode state: MlDatafeedState timing_stats: MlDatafeedTimingStats running_state?: MlDatafeedRunningState @@ -12301,7 +12383,6 @@ export interface MlDataframeAnalytics { data_counts: MlDataframeAnalyticsStatsDataCounts id: Id memory_usage: MlDataframeAnalyticsStatsMemoryUsage - node?: NodeAttributes progress: MlDataframeAnalyticsStatsProgress[] state: MlDataframeState } @@ -12690,7 +12771,6 @@ export interface MlJobStats { forecasts_stats: MlJobForecastStatistics job_id: string model_size_stats: MlModelSizeStats - node?: MlDiscoveryNode open_time?: DateTime state: MlJobState timing_stats: MlJobTimingStats @@ -12755,7 +12835,6 @@ export interface MlModelSnapshotUpgrade { job_id: Id snapshot_id: Id state: MlSnapshotUpgradeState - node: MlDiscoveryNode assignment_explanation: string } @@ -13015,7 +13094,6 @@ export interface MlTrainedModelDeploymentNodesStats { error_count: integer inference_count: integer last_access: long - node: MlDiscoveryNode number_of_allocations: integer number_of_pending_requests: integer rejection_execution_count: integer @@ -13937,6 +14015,7 @@ export interface MlPutDatafeedRequest extends RequestBase { delayed_data_check_config?: MlDelayedDataCheckConfig frequency?: Duration indices?: Indices + /** @alias indices */ indexes?: Indices indices_options?: IndicesOptions job_id?: Id @@ -14080,6 +14159,7 @@ export interface MlPutTrainedModelRequest extends RequestBase { metadata?: any model_type?: MlTrainedModelType model_size_bytes?: long + platform_architecture?: string tags?: string[] } } @@ -14295,6 +14375,7 @@ export interface MlUpdateDatafeedRequest extends RequestBase { delayed_data_check_config?: MlDelayedDataCheckConfig frequency?: Duration indices?: string[] + /** @alias indices */ indexes?: string[] indices_options?: IndicesOptions job_id?: Id @@ -15364,6 +15445,72 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { nodes: Record } +export interface QueryRulesetQueryRule { + rule_id: Id + type: QueryRulesetQueryRuleType + criteria: QueryRulesetQueryRuleCriteria[] + actions: QueryRulesetQueryRuleActions +} + +export interface QueryRulesetQueryRuleActions { + ids?: Id[] + docs?: QueryDslPinnedDoc[] +} + +export interface QueryRulesetQueryRuleCriteria { + type: QueryRulesetQueryRuleCriteriaType + metadata: string + values?: any[] +} + +export type QueryRulesetQueryRuleCriteriaType = 'global' | 'exact' | 'exact_fuzzy' | 'prefix' | 'suffix' | 'contains' | 'lt' | 'lte' | 'gt' | 'gte' + +export type QueryRulesetQueryRuleType = 'pinned' + +export interface QueryRulesetQueryRuleset { + ruleset_id: Id + rules: QueryRulesetQueryRule[] +} + +export interface QueryRulesetDeleteRequest extends RequestBase { + ruleset_id: Id +} + +export type QueryRulesetDeleteResponse = AcknowledgedResponseBase + +export interface QueryRulesetGetRequest extends RequestBase { + ruleset_id: Id +} + +export type QueryRulesetGetResponse = QueryRulesetQueryRuleset + +export interface QueryRulesetListQueryRulesetListItem { + ruleset_id: Id + rules_count: integer +} + +export interface QueryRulesetListRequest extends RequestBase { + from?: integer + size?: integer +} + +export interface QueryRulesetListResponse { + count: long + results: QueryRulesetListQueryRulesetListItem[] +} + +export interface QueryRulesetPutRequest extends RequestBase { + ruleset_id: Id + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + rules: QueryRulesetQueryRule[] + } +} + +export interface QueryRulesetPutResponse { + result: Result +} + export interface RollupDateHistogramGrouping { delay?: Duration field: Field @@ -15523,6 +15670,7 @@ export interface RollupRollupSearchRequest extends RequestBase { /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { aggregations?: Record + /** @alias aggregations */ aggs?: Record query?: QueryDslQueryContainer size?: integer @@ -17249,6 +17397,93 @@ export interface SslCertificatesRequest extends RequestBase { export type SslCertificatesResponse = SslCertificatesCertificateInformation[] +export interface SynonymsSynonymRule { + id?: Id + synonyms: SynonymsSynonymString +} + +export interface SynonymsSynonymRuleRead { + id: Id + synonyms: SynonymsSynonymString +} + +export type SynonymsSynonymString = string + +export interface SynonymsSynonymsUpdateResult { + result: Result + reload_analyzers_details: IndicesReloadSearchAnalyzersReloadResult +} + +export interface SynonymsDeleteSynonymRequest extends RequestBase { + id: Id +} + +export type SynonymsDeleteSynonymResponse = AcknowledgedResponseBase + +export interface SynonymsDeleteSynonymRuleRequest extends RequestBase { + set_id: Id + rule_id: Id +} + +export type SynonymsDeleteSynonymRuleResponse = SynonymsSynonymsUpdateResult + +export interface SynonymsGetSynonymRequest extends RequestBase { + id: Id + from?: integer + size?: integer +} + +export interface SynonymsGetSynonymResponse { + count: integer + synonyms_set: SynonymsSynonymRuleRead[] +} + +export interface SynonymsGetSynonymRuleRequest extends RequestBase { + set_id: Id + rule_id: Id +} + +export type SynonymsGetSynonymRuleResponse = SynonymsSynonymRuleRead + +export interface SynonymsGetSynonymsSetsRequest extends RequestBase { + from?: integer + size?: integer +} + +export interface SynonymsGetSynonymsSetsResponse { + count: integer + results: SynonymsGetSynonymsSetsSynonymsSetItem[] +} + +export interface SynonymsGetSynonymsSetsSynonymsSetItem { + synonyms_set: Id + count: integer +} + +export interface SynonymsPutSynonymRequest extends RequestBase { + id: Id + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + synonyms_set: SynonymsSynonymRule[] + } +} + +export interface SynonymsPutSynonymResponse { + result: Result + reload_analyzers_details: IndicesReloadSearchAnalyzersReloadDetails +} + +export interface SynonymsPutSynonymRuleRequest extends RequestBase { + set_id: Id + rule_id: Id + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + synonyms: SynonymsSynonymString[] + } +} + +export type SynonymsPutSynonymRuleResponse = SynonymsSynonymsUpdateResult + export type TasksGroupBy = 'nodes' | 'parents' | 'none' export interface TasksNodeTasks { @@ -17276,7 +17511,7 @@ export interface TasksTaskInfo { running_time?: Duration running_time_in_nanos: DurationValue start_time_in_millis: EpochTime - status?: TasksTaskStatus + status?: any type: string parent_task_id?: TaskId } @@ -17290,26 +17525,6 @@ export interface TasksTaskListResponseBase { tasks?: TasksTaskInfos } -export interface TasksTaskStatus { - batches: long - canceled?: string - created: long - deleted: long - noops: long - failures?: string[] - requests_per_second: float - retries: Retries - throttled?: Duration - throttled_millis: DurationValue - throttled_until?: Duration - throttled_until_millis: DurationValue - timed_out?: boolean - took?: DurationValue - total: long - updated: long - version_conflicts: long -} - export interface TasksCancelRequest extends RequestBase { task_id?: TaskId actions?: string | string[] @@ -17329,7 +17544,7 @@ export interface TasksGetRequest extends RequestBase { export interface TasksGetResponse { completed: boolean task: TasksTaskInfo - response?: TasksTaskStatus + response?: any error?: ErrorCause } @@ -17562,7 +17777,6 @@ export interface TransformGetTransformStatsTransformStats { checkpointing: TransformGetTransformStatsCheckpointing health?: TransformGetTransformStatsTransformStatsHealth id: Id - node?: NodeAttributes reason?: string state: string stats: TransformGetTransformStatsTransformIndexerStats