From 384debee9e199a73fa78a95c3a1b3bb196ab0a73 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Thu, 25 Jul 2024 07:38:52 +1000 Subject: [PATCH] Auto-generated code for main (#2306) --- docs/reference.asciidoc | 1579 +++++++++++++++++---- src/api/api/async_search.ts | 41 +- src/api/api/autoscaling.ts | 30 +- src/api/api/bulk.ts | 11 +- src/api/api/capabilities.ts | 68 + src/api/api/cat.ts | 232 ++- src/api/api/ccr.ts | 102 +- src/api/api/clear_scroll.ts | 11 +- src/api/api/close_point_in_time.ts | 8 +- src/api/api/cluster.ts | 122 +- src/api/api/count.ts | 9 +- src/api/api/create.ts | 12 +- src/api/api/dangling_indices.ts | 22 +- src/api/api/delete.ts | 12 +- src/api/api/delete_by_query.ts | 11 +- src/api/api/delete_by_query_rethrottle.ts | 9 +- src/api/api/delete_script.ts | 11 +- src/api/api/enrich.ts | 44 +- src/api/api/eql.ts | 39 +- src/api/api/esql.ts | 71 +- src/api/api/exists.ts | 12 +- src/api/api/exists_source.ts | 12 +- src/api/api/explain.ts | 12 +- src/api/api/features.ts | 11 +- src/api/api/field_caps.ts | 11 +- src/api/api/fleet.ts | 50 +- src/api/api/get.ts | 10 +- src/api/api/get_script.ts | 11 +- src/api/api/get_script_context.ts | 6 +- src/api/api/get_script_languages.ts | 6 +- src/api/api/get_source.ts | 10 +- src/api/api/graph.ts | 11 +- src/api/api/health_report.ts | 9 +- src/api/api/ilm.ts | 87 +- src/api/api/index.ts | 12 +- src/api/api/indices.ts | 584 ++++++-- src/api/api/inference.ts | 41 +- src/api/api/info.ts | 6 +- src/api/api/ingest.ts | 158 ++- src/api/api/knn_search.ts | 9 +- src/api/api/license.ts | 42 +- src/api/api/logstash.ts | 31 +- src/api/api/mget.ts | 9 +- src/api/api/migration.ts | 19 +- src/api/api/ml.ts | 698 +++++++-- src/api/api/monitoring.ts | 9 +- src/api/api/msearch.ts | 9 +- src/api/api/msearch_template.ts | 11 +- src/api/api/mtermvectors.ts | 9 +- src/api/api/nodes.ts | 76 +- src/api/api/open_point_in_time.ts | 11 +- src/api/api/ping.ts | 6 +- src/api/api/profiling.ts | 162 +++ src/api/api/put_script.ts | 12 +- src/api/api/query_rules.ts | 295 ++++ src/api/api/query_ruleset.ts | 162 --- src/api/api/rank_eval.ts | 11 +- src/api/api/reindex.ts | 6 +- src/api/api/reindex_rethrottle.ts | 11 +- src/api/api/render_search_template.ts | 11 +- src/api/api/rollup.ts | 69 +- src/api/api/scripts_painless_execute.ts | 8 +- src/api/api/scroll.ts | 9 +- src/api/api/search.ts | 11 +- src/api/api/search_application.ts | 83 +- src/api/api/search_mvt.ts | 13 +- src/api/api/search_shards.ts | 9 +- src/api/api/search_template.ts | 11 +- src/api/api/searchable_snapshots.ts | 34 +- src/api/api/security.ts | 613 ++++++-- src/api/api/shutdown.ts | 25 +- src/api/api/simulate.ts | 85 ++ src/api/api/slm.ts | 58 +- src/api/api/snapshot.ts | 106 +- src/api/api/sql.ts | 40 +- src/api/api/ssl.ts | 6 +- src/api/api/synonyms.ts | 59 +- src/api/api/tasks.ts | 24 +- src/api/api/terms_enum.ts | 9 +- src/api/api/termvectors.ts | 10 +- src/api/api/text_structure.ts | 69 +- src/api/api/transform.ts | 131 +- src/api/api/update.ts | 10 +- src/api/api/update_by_query.ts | 11 +- src/api/api/update_by_query_rethrottle.ts | 9 +- src/api/api/watcher.ts | 93 +- src/api/api/xpack.ts | 15 +- src/api/index.ts | 33 +- src/api/types.ts | 520 ++++--- src/api/typesWithBodyKey.ts | 535 ++++--- 90 files changed, 6331 insertions(+), 1489 deletions(-) create mode 100644 src/api/api/capabilities.ts create mode 100644 src/api/api/profiling.ts create mode 100644 src/api/api/query_rules.ts delete mode 100644 src/api/api/query_ruleset.ts create mode 100644 src/api/api/simulate.ts diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 1bdef0d5e..c7668ae7a 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -27,7 +27,8 @@ [discrete] === bulk -Allows to perform multiple index/update/delete operations in a single request. +Performs multiple indexing or delete operations in a single API call. +This reduces overhead and can greatly increase indexing speed. {ref}/docs-bulk.html[Endpoint documentation] [source,ts] @@ -56,7 +57,7 @@ Set to all or any positive integer up to the total number of shards in the index [discrete] === clear_scroll -Explicitly clears the search context for a scroll. +Clears the search context and results for a scrolling search. {ref}/clear-scroll-api.html[Endpoint documentation] [source,ts] @@ -72,7 +73,7 @@ To clear all scroll IDs, use `_all`. [discrete] === close_point_in_time -Close a point in time +Closes a point-in-time. {ref}/point-in-time-api.html[Endpoint documentation] [source,ts] @@ -101,7 +102,7 @@ client.count({ ... }) ** *`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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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. @@ -129,9 +130,8 @@ Elasticsearch collects documents before sorting. [discrete] === create -Creates a new document in the index. - -Returns a 409 response when a document with a same ID already exists in the index. +Adds a JSON document to the specified data stream or index and makes it searchable. +If the target is an index and the document already exists, the request updates the document and increments its version. {ref}/docs-index_.html[Endpoint documentation] [source,ts] @@ -162,7 +162,7 @@ Set to `all` or any positive integer up to the total number of shards in the ind [discrete] === delete -Removes a document from the index. +Removes a JSON document from the specified index. {ref}/docs-delete.html[Endpoint documentation] [source,ts] @@ -189,7 +189,7 @@ Set to `all` or any positive integer up to the total number of shards in the ind [discrete] === delete_by_query -Deletes documents matching the provided query. +Deletes documents that match the specified query. {ref}/docs-delete-by-query.html[Endpoint documentation] [source,ts] @@ -204,7 +204,7 @@ client.deleteByQuery({ index }) 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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specifies the documents to delete using the Query DSL. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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. @@ -268,7 +268,7 @@ client.deleteByQueryRethrottle({ task_id }) [discrete] === delete_script -Deletes a script. +Deletes a stored script or search template. {ref}/modules-scripting.html[Endpoint documentation] [source,ts] @@ -287,7 +287,7 @@ If no response is received before the timeout expires, the request fails and ret [discrete] === exists -Returns information about whether a document exists in an index. +Checks if a document in an index exists. {ref}/docs-get.html[Endpoint documentation] [source,ts] @@ -318,7 +318,7 @@ The specified version must match the current version of the document for the req [discrete] === exists_source -Returns information about whether a document source exists in an index. +Checks if a document's `_source` is stored. {ref}/docs-get.html[Endpoint documentation] [source,ts] @@ -346,7 +346,7 @@ The specified version must match the current version of the document for the req [discrete] === explain -Returns information about why a specific matches (or doesn't match) a query. +Returns information about why a specific document matches (or doesn’t match) a query. {ref}/search-explain.html[Endpoint documentation] [source,ts] @@ -360,7 +360,7 @@ client.explain({ id, index }) ** *`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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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. @@ -378,7 +378,9 @@ Random by default. [discrete] === field_caps -Returns the information about the capabilities of fields among multiple indices. +The field capabilities API returns the information about the capabilities of fields among multiple indices. +The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type +of keyword is returned as any other field that belongs to the `keyword` family. {ref}/search-field-caps.html[Endpoint documentation] [source,ts] @@ -391,7 +393,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. ** *`fields` (Optional, string | string[])*: List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. -** *`index_filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Allows to filter indices if the provided query rewrites to match_none on every shard. +** *`index_filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Allows to filter indices if the provided query rewrites to match_none on every shard. ** *`runtime_mappings` (Optional, Record)*: Defines ad-hoc runtime fields in the request similar to the way it is done in search requests. These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings. ** *`allow_no_indices` (Optional, boolean)*: If false, the request returns an error if any wildcard expression, index alias, @@ -437,7 +439,7 @@ If this field is specified, the `_source` parameter defaults to false. [discrete] === get_script -Returns a script. +Retrieves a stored script or search template. {ref}/modules-scripting.html[Endpoint documentation] [source,ts] @@ -517,7 +519,8 @@ client.healthReport({ ... }) [discrete] === index -Creates or updates a document in an index. +Adds a JSON document to the specified data stream or index and makes it searchable. +If the target is an index and the document already exists, the request updates the document and increments its version. {ref}/docs-index_.html[Endpoint documentation] [source,ts] @@ -589,7 +592,7 @@ parameter defaults to false. You can pass _source: true to return both source fi and stored fields in the search response. ** *`fields` (Optional, string | string[])*: The request returns values for field names matching these patterns in the hits.fields property of the response. Accepts wildcard (*) patterns. -** *`filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type } | { bool, boosting, common, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type }[])*: Query to filter the documents that can match. The kNN search will return the top +** *`filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type } | { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type }[])*: Query to filter the documents that can match. The kNN search will return the top `k` documents that also match this filter. The value can be a single query or a list of queries. If `filter` isn't provided, all documents are allowed to match. ** *`routing` (Optional, string)*: A list of specific routing values @@ -655,7 +658,7 @@ client.msearch({ ... }) [discrete] === msearch_template -Allows to execute several search template operations in one request. +Runs multiple templated searches with a single request. {ref}/search-multi-search.html[Endpoint documentation] [source,ts] @@ -710,7 +713,12 @@ Random by default. [discrete] === open_point_in_time -Open a point in time that can be used in subsequent searches +A search request by default executes against the most recent visible data of the target indices, +which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the +state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple +search requests using the same point in time. For example, if refreshes happen between +`search_after` requests, then the results of those requests might not be consistent as changes happening +between searches are only visible to the more recent point in time. {ref}/point-in-time-api.html[Endpoint documentation] [source,ts] @@ -743,7 +751,7 @@ client.ping() [discrete] === put_script -Creates or updates a script. +Creates or updates a stored script or search template. {ref}/modules-scripting.html[Endpoint documentation] [source,ts] @@ -766,7 +774,7 @@ If no response is received before the timeout expires, the request fails and ret [discrete] === rank_eval -Allows to evaluate the quality of ranked search results over a set of typical search queries +Enables you to evaluate the quality of ranked search results over a set of typical search queries. {ref}/search-rank-eval.html[Endpoint documentation] [source,ts] @@ -805,7 +813,7 @@ client.reindex({ dest, source }) ** *`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. +** *`script` (Optional, { source, id, params, lang, options })*: 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. @@ -821,7 +829,7 @@ Set to `all` or any positive integer up to the total number of shards in the ind [discrete] === reindex_rethrottle -Changes the number of requests per second for a particular Reindex operation. +Copies documents from a source to a destination. {ref}/docs-reindex.html[Endpoint documentation] [source,ts] @@ -837,7 +845,7 @@ client.reindexRethrottle({ task_id }) [discrete] === render_search_template -Allows to use the Mustache language to pre-render a search definition. +Renders a search template as a search request body. {ref}/render-search-template-api.html[Endpoint documentation] [source,ts] @@ -861,7 +869,7 @@ If no `id` or `` is specified, this parameter is required. [discrete] === scripts_painless_execute -Allows an arbitrary script to be executed and a result to be returned +Runs a script and returns a result. {painless}/painless-execute-api.html[Endpoint documentation] [source,ts] @@ -874,7 +882,7 @@ client.scriptsPainlessExecute({ ... }) * *Request (object):* ** *`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. +** *`script` (Optional, { source, id, params, lang, options })*: The Painless script to execute. [discrete] === scroll @@ -895,7 +903,9 @@ client.scroll({ scroll_id }) [discrete] === search -Returns results matching a query. +Returns search hits that match the query defined in the request. +You can provide search queries using the `q` query string parameter or the request body. +If both are specified, only the query parameter is used. {ref}/search-search.html[Endpoint documentation] [source,ts] @@ -928,12 +938,12 @@ The request returns doc values for field names matching these patterns in the `h ** *`rank` (Optional, { rrf })*: Defines the Reciprocal Rank Fusion (RRF) to use. ** *`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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Use the `post_filter` parameter to filter search results. +** *`post_filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. ** *`rescore` (Optional, { window_size, query, learning_to_rank } | { window_size, query, learning_to_rank }[])*: Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. ** *`retriever` (Optional, { standard, knn, rrf })*: A retriever is a specification to describe top documents returned from a search. A retriever replaces other elements of the search API that also return top documents such as query and knn. ** *`script_fields` (Optional, Record)*: Retrieve a script evaluation (based on different fields) for each hit. @@ -1087,7 +1097,7 @@ don’t include 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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Query DSL used to filter documents for the search. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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. @@ -1130,7 +1140,7 @@ Random by default. [discrete] === search_template -Allows to use the Mustache language to pre-render a search definition. +Runs a search with a search template. {ref}/search-template.html[Endpoint documentation] [source,ts] @@ -1190,7 +1200,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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Allows to filter an index shard if the provided query rewrites to match_none. +** *`index_filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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)* @@ -1245,7 +1255,7 @@ client.update({ id, index }) to 'noop' if no change to the document occurred. ** *`doc` (Optional, object)*: A partial update to an existing document. ** *`doc_as_upsert` (Optional, boolean)*: Set to true to use the contents of 'doc' as the value of 'upsert' -** *`script` (Optional, { lang, options, source } | { id })*: Script to execute to update the document. +** *`script` (Optional, { source, id, params, lang, options })*: Script to execute to update the document. ** *`scripted_upsert` (Optional, boolean)*: Set to true to execute the script whether or not the document exists. ** *`_source` (Optional, boolean | { excludes, includes })*: Set to false to disable source retrieval. You can also specify a comma-separated list of the fields you want to retrieve. @@ -1271,9 +1281,8 @@ Set to 'all' or any positive integer up to the total number of shards in the ind [discrete] === update_by_query -Updates documents that match the specified query. If no query is specified, - performs an update on every document in the index without changing the source, -for example to pick up a mapping change. +Updates documents that match the specified query. +If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes. {ref}/docs-update-by-query.html[Endpoint documentation] [source,ts] @@ -1288,8 +1297,8 @@ client.updateByQuery({ index }) 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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, 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. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specifies the documents to update using the Query DSL. +** *`script` (Optional, { source, id, params, lang, options })*: 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. @@ -1356,7 +1365,10 @@ client.updateByQueryRethrottle({ task_id }) === async_search [discrete] ==== delete -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. +Deletes an async search by identifier. +If the search is still running, the search request will be cancelled. +Otherwise, the saved search results are deleted. +If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege. {ref}/async-search.html[Endpoint documentation] [source,ts] @@ -1372,7 +1384,8 @@ client.asyncSearch.delete({ id }) [discrete] ==== get -Retrieves the results of a previously submitted async search request given its ID. +Retrieves the results of a previously submitted async search request given its identifier. +If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it. {ref}/async-search.html[Endpoint documentation] [source,ts] @@ -1397,7 +1410,9 @@ By default no timeout is set meaning that the currently available results will b [discrete] ==== status -Retrieves the status of a previously submitted async search request given its ID. +Get async search status +Retrieves the status of a previously submitted async search request given its identifier, without retrieving search results. +If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role. {ref}/async-search.html[Endpoint documentation] [source,ts] @@ -1413,7 +1428,11 @@ client.asyncSearch.status({ id }) [discrete] ==== submit -Executes a search request asynchronously. +Runs a search request asynchronously. +When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested. +Warning: Async search does not support scroll nor search requests that only include the suggest section. +By default, Elasticsearch doesn’t allow you to store an async search response larger than 10Mb and an attempt to do this results in an error. +The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting. {ref}/async-search.html[Endpoint documentation] [source,ts] @@ -1444,9 +1463,9 @@ names matching these patterns in the hits.fields property of the response. ** *`knn` (Optional, { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity, inner_hits } | { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity, inner_hits }[])*: Defines the approximate kNN search to run. ** *`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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })* +** *`post_filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })* ** *`profile` (Optional, boolean)* -** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. ** *`rescore` (Optional, { window_size, query, learning_to_rank } | { window_size, query, learning_to_rank }[])* ** *`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[])* @@ -1517,11 +1536,75 @@ A partial reduction is performed every time the coordinating node has received a ** *`_source_includes` (Optional, string | string[])*: A list of fields to extract and return from the _source field ** *`q` (Optional, string)*: Query in the Lucene query string syntax +[discrete] +=== autoscaling +[discrete] +==== delete_autoscaling_policy +Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +{ref}/autoscaling-delete-autoscaling-policy.html[Endpoint documentation] +[source,ts] +---- +client.autoscaling.deleteAutoscalingPolicy({ name }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (string)*: the name of the autoscaling policy + +[discrete] +==== get_autoscaling_capacity +Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +{ref}/autoscaling-get-autoscaling-capacity.html[Endpoint documentation] +[source,ts] +---- +client.autoscaling.getAutoscalingCapacity() +---- + + +[discrete] +==== get_autoscaling_policy +Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +{ref}/autoscaling-get-autoscaling-capacity.html[Endpoint documentation] +[source,ts] +---- +client.autoscaling.getAutoscalingPolicy({ name }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (string)*: the name of the autoscaling policy + +[discrete] +==== put_autoscaling_policy +Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +{ref}/autoscaling-put-autoscaling-policy.html[Endpoint documentation] +[source,ts] +---- +client.autoscaling.putAutoscalingPolicy({ name }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (string)*: the name of the autoscaling policy +** *`policy` (Optional, { roles, deciders })* + [discrete] === cat [discrete] ==== aliases -Shows information about currently configured aliases to indices including filter and routing infos. +Retrieves the cluster’s index aliases, including filter and routing information. +The API does not return data stream aliases. +IMPORTANT: cat APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API. {ref}/cat-alias.html[Endpoint documentation] [source,ts] @@ -1538,7 +1621,8 @@ client.cat.aliases({ ... }) [discrete] ==== allocation -Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. +Provides a snapshot of the number of shards allocated to each data node and their disk space. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. {ref}/cat-allocation.html[Endpoint documentation] [source,ts] @@ -1555,7 +1639,10 @@ client.cat.allocation({ ... }) [discrete] ==== component_templates -Returns information about existing component_templates templates. +Returns information about component templates in a cluster. +Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. +They are not intended for use by applications. For application consumption, use the get component template API. {ref}/cat-component-templates.html[Endpoint documentation] [source,ts] @@ -1571,7 +1658,10 @@ client.cat.componentTemplates({ ... }) [discrete] ==== count -Provides quick access to the document count of the entire cluster, or individual indices. +Provides quick access to a document count for a data stream, an index, or an entire cluster. +NOTE: The document count only includes live documents, not deleted documents which have not yet been removed by the merge process. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. +They are not intended for use by applications. For application consumption, use the count API. {ref}/cat-count.html[Endpoint documentation] [source,ts] @@ -1588,7 +1678,9 @@ Supports wildcards (`*`). To target all data streams and indices, omit this para [discrete] ==== fielddata -Shows how much heap memory is currently being used by fielddata on every data node in the cluster. +Returns the amount of heap memory currently used by the field data cache on every data node in the cluster. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. +They are not intended for use by applications. For application consumption, use the nodes stats API. {ref}/cat-fielddata.html[Endpoint documentation] [source,ts] @@ -1606,7 +1698,16 @@ To retrieve all fields, omit this parameter. [discrete] ==== health -Returns a concise representation of the cluster health. +Returns the health status of a cluster, similar to the cluster health API. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. +They are not intended for use by applications. For application consumption, use the cluster health API. +This API is often used to check malfunctioning clusters. +To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats: +`HH:MM:SS`, which is human-readable but includes no date information; +`Unix epoch time`, which is machine-sortable and includes date information. +The latter format is useful for cluster recoveries that take multiple days. +You can use the cat health API to verify cluster health across multiple nodes. +You also can use the API to track the recovery of a large cluster over a longer period of time. {ref}/cat-health.html[Endpoint documentation] [source,ts] @@ -1634,7 +1735,12 @@ client.cat.help() [discrete] ==== indices -Returns information about indices: number of primaries and replicas, document counts, disk size, ... +Returns high-level information about indices in a cluster, including backing indices for data streams. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. +They are not intended for use by applications. For application consumption, use the get index API. +Use the cat indices API to get the following information for each index in a cluster: shard count; document count; deleted document count; primary store size; total store size of all shards, including shard replicas. +These metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents. +To get an accurate count of Elasticsearch documents, use the cat count or count APIs. {ref}/cat-indices.html[Endpoint documentation] [source,ts] @@ -1657,7 +1763,8 @@ Supports wildcards (`*`). To target all data streams and indices, omit this para [discrete] ==== master -Returns information about the master node. +Returns information about the master node, including the ID, bound IP address, and name. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. {ref}/cat-master.html[Endpoint documentation] [source,ts] @@ -1668,7 +1775,11 @@ client.cat.master() [discrete] ==== ml_data_frame_analytics -Gets configuration and usage information about data frame analytics jobs. +Returns configuration and usage information about data frame analytics jobs. + +IMPORTANT: cat APIs are only intended for human consumption using the Kibana +console or command line. They are not intended for use by applications. For +application consumption, use the get data frame analytics jobs statistics API. {ref}/cat-dfanalytics.html[Endpoint documentation] [source,ts] @@ -1690,7 +1801,14 @@ response. [discrete] ==== ml_datafeeds -Gets configuration and usage information about datafeeds. +Returns configuration and usage information about datafeeds. +This API returns a maximum of 10,000 datafeeds. +If the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` +cluster privileges to use this API. + +IMPORTANT: cat APIs are only intended for human consumption using the Kibana +console or command line. They are not intended for use by applications. For +application consumption, use the get datafeed statistics API. {ref}/cat-datafeeds.html[Endpoint documentation] [source,ts] @@ -1718,7 +1836,14 @@ partial matches. [discrete] ==== ml_jobs -Gets configuration and usage information about anomaly detection jobs. +Returns configuration and usage information for anomaly detection jobs. +This API returns a maximum of 10,000 jobs. +If the Elasticsearch security features are enabled, you must have `monitor_ml`, +`monitor`, `manage_ml`, or `manage` cluster privileges to use this API. + +IMPORTANT: cat APIs are only intended for human consumption using the Kibana +console or command line. They are not intended for use by applications. For +application consumption, use the get anomaly detection job statistics API. {ref}/cat-anomaly-detectors.html[Endpoint documentation] [source,ts] @@ -1747,7 +1872,11 @@ matches. [discrete] ==== ml_trained_models -Gets configuration and usage information about inference trained models. +Returns configuration and usage information about inference trained models. + +IMPORTANT: cat APIs are only intended for human consumption using the Kibana +console or command line. They are not intended for use by applications. For +application consumption, use the get trained models statistics API. {ref}/cat-trained-model.html[Endpoint documentation] [source,ts] @@ -1772,6 +1901,7 @@ If `false`, the API returns a 404 status code when there are no matches or only [discrete] ==== nodeattrs Returns information about custom node attributes. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. {ref}/cat-nodeattrs.html[Endpoint documentation] [source,ts] @@ -1782,7 +1912,8 @@ client.cat.nodeattrs() [discrete] ==== nodes -Returns basic statistics about performance of cluster nodes. +Returns information about the nodes in a cluster. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. {ref}/cat-nodes.html[Endpoint documentation] [source,ts] @@ -1800,7 +1931,8 @@ client.cat.nodes({ ... }) [discrete] ==== pending_tasks -Returns a concise representation of the cluster pending tasks. +Returns cluster-level changes that have not yet been executed. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the pending cluster tasks API. {ref}/cat-pending-tasks.html[Endpoint documentation] [source,ts] @@ -1811,7 +1943,8 @@ client.cat.pendingTasks() [discrete] ==== plugins -Returns information about installed plugins across nodes node. +Returns a list of plugins running on each node of a cluster. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. {ref}/cat-plugins.html[Endpoint documentation] [source,ts] @@ -1822,7 +1955,10 @@ client.cat.plugins() [discrete] ==== recovery -Returns information about index shard recoveries, both on-going completed. +Returns information about ongoing and completed shard recoveries. +Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or syncing a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing. +For data streams, the API returns information about the stream’s backing indices. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API. {ref}/cat-recovery.html[Endpoint documentation] [source,ts] @@ -1842,7 +1978,8 @@ Supports wildcards (`*`). To target all data streams and indices, omit this para [discrete] ==== repositories -Returns information about snapshot repositories registered in the cluster. +Returns the snapshot repositories for a cluster. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot repository API. {ref}/cat-repositories.html[Endpoint documentation] [source,ts] @@ -1853,7 +1990,9 @@ client.cat.repositories() [discrete] ==== segments -Provides low-level information about the segments in the shards of an index. +Returns low-level information about the Lucene segments in index shards. +For data streams, the API returns information about the backing indices. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API. {ref}/cat-segments.html[Endpoint documentation] [source,ts] @@ -1872,7 +2011,9 @@ To target all data streams and indices, omit this parameter or use `*` or `_all` [discrete] ==== shards -Provides a detailed view of shard allocation on nodes. +Returns information about the shards in a cluster. +For data streams, the API returns information about the backing indices. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. {ref}/cat-shards.html[Endpoint documentation] [source,ts] @@ -1891,7 +2032,9 @@ To target all data streams and indices, omit this parameter or use `*` or `_all` [discrete] ==== snapshots -Returns all snapshots in a specific repository. +Returns information about the snapshots stored in one or more repositories. +A snapshot is a backup of an index or running Elasticsearch cluster. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot API. {ref}/cat-snapshots.html[Endpoint documentation] [source,ts] @@ -1911,7 +2054,8 @@ If any repository fails during the request, Elasticsearch returns an error. [discrete] ==== tasks -Returns information about the tasks currently executing on one or more nodes in the cluster. +Returns information about tasks currently executing in the cluster. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API. {ref}/tasks.html[Endpoint documentation] [source,ts] @@ -1930,7 +2074,9 @@ client.cat.tasks({ ... }) [discrete] ==== templates -Returns information about existing templates. +Returns information about index templates in a cluster. +You can use index templates to apply index settings and field mappings to new indices at creation. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index template API. {ref}/cat-templates.html[Endpoint documentation] [source,ts] @@ -1947,8 +2093,9 @@ Accepts wildcard expressions. If omitted, all templates are returned. [discrete] ==== thread_pool -Returns cluster-wide thread pool statistics per node. -By default the active, queue and rejected statistics are returned for all thread pools. +Returns thread pool statistics for each node in a cluster. +Returned information includes all built-in thread pools and custom thread pools. +IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. {ref}/cat-thread-pool.html[Endpoint documentation] [source,ts] @@ -1966,7 +2113,11 @@ Accepts wildcard expressions. [discrete] ==== transforms -Gets configuration and usage information about transforms. +Returns configuration and usage information about transforms. + +IMPORTANT: cat APIs are only intended for human consumption using the Kibana +console or command line. They are not intended for use by applications. For +application consumption, use the get transform statistics API. {ref}/cat-transforms.html[Endpoint documentation] [source,ts] @@ -2261,7 +2412,8 @@ client.cluster.allocationExplain({ ... }) [discrete] ==== delete_component_template -Deletes a component template +Deletes component templates. +Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. {ref}/indices-component-template.html[Endpoint documentation] [source,ts] @@ -2324,7 +2476,7 @@ Defaults to false, which means information is retrieved from the master node. [discrete] ==== get_component_template -Returns one or more component templates +Retrieves information about component templates. {ref}/indices-component-template.html[Endpoint documentation] [source,ts] @@ -2347,7 +2499,8 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== get_settings -Returns cluster settings. +Returns cluster-wide settings. +By default, it returns only settings that have been explicitly defined. {ref}/cluster-get-settings.html[Endpoint documentation] [source,ts] @@ -2368,7 +2521,8 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== health -Returns basic information about the health of the cluster. +The cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the stream’s backing indices. +The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status. {ref}/cluster-health.html[Endpoint documentation] [source,ts] @@ -2411,8 +2565,10 @@ client.cluster.info({ target }) [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. +Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed. +NOTE: This API returns a list of any pending updates to the cluster state. +These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests. +However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API. {ref}/cluster-pending.html[Endpoint documentation] [source,ts] @@ -2454,7 +2610,21 @@ is satisfied, the request fails and returns an error. [discrete] ==== put_component_template -Creates or updates a component template +Creates or updates a component template. +Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. + +An index template can be composed of multiple component templates. +To use a component template, specify it in an index template’s `composed_of` list. +Component templates are only applied to new data streams and indices as part of a matching index template. + +Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. + +Component templates are only used during index creation. +For data streams, this includes data stream creation and the creation of a stream’s backing indices. +Changes to component templates do not affect existing indices, including a stream’s backing indices. + +You can use C-style `/* *\/` block comments in component templates. +You can include comments anywhere in the request body except before the opening curly bracket. {ref}/indices-component-template.html[Endpoint documentation] [source,ts] @@ -2507,7 +2677,9 @@ client.cluster.putSettings({ ... }) [discrete] ==== remote_info -Returns the information about configured remote clusters. +The cluster remote info API allows you to retrieve all of the configured +remote cluster information. It returns connection and endpoint information +keyed by the configured remote cluster alias. {ref}/cluster-remote-info.html[Endpoint documentation] [source,ts] @@ -2565,7 +2737,8 @@ client.cluster.state({ ... }) [discrete] ==== stats -Returns high-level overview of cluster statistics. +Returns cluster statistics. +It returns basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins). {ref}/cluster-stats.html[Endpoint documentation] [source,ts] @@ -2671,7 +2844,7 @@ client.enrich.executePolicy({ name }) [discrete] ==== get_policy -Gets information about an enrich policy. +Returns information about an enrich policy. {ref}/get-enrich-policy-api.html[Endpoint documentation] [source,ts] @@ -2688,7 +2861,7 @@ To return information for all enrich policies, omit this parameter. [discrete] ==== put_policy -Creates a new enrich policy. +Creates an enrich policy. {ref}/put-enrich-policy-api.html[Endpoint documentation] [source,ts] @@ -2707,7 +2880,7 @@ client.enrich.putPolicy({ name }) [discrete] ==== stats -Gets enrich coordinator statistics and information about enrich policies that are currently executing. +Returns enrich coordinator statistics and information about enrich policies that are currently executing. {ref}/enrich-stats-api.html[Endpoint documentation] [source,ts] @@ -2720,7 +2893,8 @@ client.enrich.stats() === 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. +Deletes an async EQL search or a stored synchronous EQL search. +The API also deletes results for the search. {ref}/eql-search-api.html[Endpoint documentation] [source,ts] @@ -2738,7 +2912,7 @@ A search ID is also provided if the request’s `keep_on_completion` parameter i [discrete] ==== get -Returns async results from previously executed Event Query Language (EQL) search +Returns the current status and available results for an async EQL search or a stored synchronous EQL search. {ref}/get-async-eql-search-api.html[Endpoint documentation] [source,ts] @@ -2758,7 +2932,7 @@ 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 +Returns the current status for an async EQL search or a stored synchronous EQL search without returning results. {ref}/get-async-eql-status-api.html[Endpoint documentation] [source,ts] @@ -2793,7 +2967,7 @@ client.eql.search({ index, query }) ** *`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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type } | { bool, boosting, common, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type }[])*: Query, written in Query DSL, used to filter the events on which the EQL query runs. +** *`filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type } | { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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)* @@ -2807,9 +2981,31 @@ client.eql.search({ index, query }) [discrete] === esql +[discrete] +==== async_query +Executes an ESQL request asynchronously + +{ref}/esql-async-query-api.html[Endpoint documentation] +[source,ts] +---- +client.esql.asyncQuery() +---- + + +[discrete] +==== async_query_get +Retrieves the results of a previously submitted async query request given its ID. + +{ref}/esql-async-query-get-api.html[Endpoint documentation] +[source,ts] +---- +client.esql.asyncQueryGet() +---- + + [discrete] ==== query -Executes an ESQL request +Executes an ES|QL request {ref}/esql-rest.html[Endpoint documentation] [source,ts] @@ -2823,11 +3019,19 @@ client.esql.query({ query }) * *Request (object):* ** *`query` (string)*: The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. ** *`columnar` (Optional, boolean)*: By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results. -** *`filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on. +** *`filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on. ** *`locale` (Optional, string)* -** *`params` (Optional, number | number | string | boolean | null[])*: To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. +** *`params` (Optional, number | number | string | boolean | null | User-defined value[])*: To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. +** *`profile` (Optional, boolean)*: If provided and `true` the response will include an extra `profile` object +with information on how the query was executed. This information is for human debugging +and its format can change at any time but it can give some insight into the performance +of each part of the query. +** *`tables` (Optional, Record>)*: Tables to use with the LOOKUP operation. The top level key is the table +name and the next level key is the column name. ** *`format` (Optional, string)*: A short version of the Accept header, e.g. json, yaml. ** *`delimiter` (Optional, string)*: The character to use between values within a CSV row. Only valid for the CSV format. +** *`drop_null_columns` (Optional, boolean)*: Should columns that are entirely `null` be removed from the `columns` and `values` portion of the results? +Defaults to `false`. If `true` then the response will include an extra section under the name `all_columns` which has the name of all columns. [discrete] === features @@ -2881,7 +3085,9 @@ will cause Elasticsearch to immediately return the current global checkpoints. [discrete] ==== msearch -Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. +Executes several [fleet searches](https://www.elastic.co/guide/en/elasticsearch/reference/current/fleet-search.html) with a single API request. +The API follows the same structure as the [multi search](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html) API. However, similar to the fleet search API, it +supports the wait_for_checkpoints parameter. [source,ts] ---- client.fleet.msearch({ ... }) @@ -2913,7 +3119,8 @@ which is true by default. [discrete] ==== search -Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. +The purpose of the fleet search api is to provide a search api where the search will only be executed +after provided checkpoint has been processed and is visible for searches inside of Elasticsearch. [source,ts] ---- client.fleet.search({ index }) @@ -2941,9 +3148,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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })* +** *`post_filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })* ** *`profile` (Optional, boolean)* -** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. ** *`rescore` (Optional, { window_size, query, learning_to_rank } | { window_size, query, learning_to_rank }[])* ** *`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[])* @@ -3017,7 +3224,7 @@ which is true by default. === graph [discrete] ==== explore -Explore extracted and summarized information about the documents and terms in an index. +Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index. {ref}/graph-explore-api.html[Endpoint documentation] [source,ts] @@ -3032,7 +3239,7 @@ client.graph.explore({ index }) ** *`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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: A seed query that identifies the documents of interest. Can be any valid Elasticsearch query. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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. @@ -3043,7 +3250,7 @@ Defaults to no timeout. === ilm [discrete] ==== delete_lifecycle -Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. +Deletes the specified lifecycle policy definition. You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error. {ref}/ilm-delete-lifecycle.html[Endpoint documentation] [source,ts] @@ -3061,7 +3268,7 @@ client.ilm.deleteLifecycle({ policy }) [discrete] ==== explain_lifecycle -Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. +Retrieves information about the index’s current lifecycle state, such as the currently executing phase, action, and step. Shows when the index entered each one, the definition of the running phase, and information about any failures. {ref}/ilm-explain-lifecycle.html[Endpoint documentation] [source,ts] @@ -3082,7 +3289,7 @@ To target all data streams and indices, use `*` or `_all`. [discrete] ==== get_lifecycle -Returns the specified policy definition. Includes the policy version and last modified date. +Retrieves a lifecycle policy. {ref}/ilm-get-lifecycle.html[Endpoint documentation] [source,ts] @@ -3111,7 +3318,9 @@ client.ilm.getStatus() [discrete] ==== migrate_to_data_tiers -Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing +Switches the indices, ILM policies, and legacy, composable and component templates from using custom node attributes and +attribute-based allocation filters to using data tiers, and optionally deletes one legacy index template.+ +Using node roles enables ILM to automatically move the indices between data tiers. {ref}/ilm-migrate-to-data-tiers.html[Endpoint documentation] [source,ts] @@ -3148,7 +3357,7 @@ client.ilm.moveToStep({ index }) [discrete] ==== put_lifecycle -Creates a lifecycle policy +Creates a lifecycle policy. If the specified policy exists, the policy is replaced and the policy version is incremented. {ref}/ilm-put-lifecycle.html[Endpoint documentation] [source,ts] @@ -3256,7 +3465,7 @@ client.indices.addBlock({ index, block }) [discrete] ==== analyze -Performs the analysis process on a text and return the tokens breakdown of the text. +Performs analysis on a text string and returns the resulting tokens. {ref}/indices-analyze.html[Endpoint documentation] [source,ts] @@ -3287,7 +3496,8 @@ If an array of strings is provided, it is analyzed as a multi-value field. [discrete] ==== clear_cache -Clears all or specific caches for one or more indices. +Clears the caches of one or more indices. +For data streams, the API clears the caches of the stream’s backing indices. {ref}/indices-clearcache.html[Endpoint documentation] [source,ts] @@ -3317,7 +3527,7 @@ Use the `fields` parameter to clear the cache of specific fields only. [discrete] ==== clone -Clones an index +Clones an existing index. {ref}/indices-clone-index.html[Endpoint documentation] [source,ts] @@ -3371,7 +3581,7 @@ Set to `all` or any positive integer up to the total number of shards in the ind [discrete] ==== create -Creates an index with optional settings and mappings. +Creates a new index. {ref}/indices-create-index.html[Endpoint documentation] [source,ts] @@ -3399,7 +3609,9 @@ Set to `all` or any positive integer up to the total number of shards in the ind [discrete] ==== create_data_stream -Creates a data stream +Create a data stream. +Creates a data stream. +You must have a matching index template with data stream enabled. {ref}/data-streams.html[Endpoint documentation] [source,ts] @@ -3420,7 +3632,8 @@ Cannot be longer than 255 bytes. Multi-byte characters count towards this limit [discrete] ==== data_streams_stats -Provides statistics on operations happening in a data stream. +Get data stream stats. +Retrieves statistics for one or more data streams. {ref}/data-streams.html[Endpoint documentation] [source,ts] @@ -3440,7 +3653,7 @@ Supports a list of values, such as `open,hidden`. [discrete] ==== delete -Deletes an index. +Deletes one or more indices. {ref}/indices-delete-index.html[Endpoint documentation] [source,ts] @@ -3470,7 +3683,7 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== delete_alias -Deletes an alias. +Removes a data stream or index from an alias. {ref}/indices-aliases.html[Endpoint documentation] [source,ts] @@ -3493,7 +3706,8 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== delete_data_lifecycle -Deletes the data stream lifecycle of the selected data streams. +Delete data stream lifecycles. +Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle. {ref}/data-streams-delete-lifecycle.html[Endpoint documentation] [source,ts] @@ -3512,7 +3726,8 @@ client.indices.deleteDataLifecycle({ name }) [discrete] ==== delete_data_stream -Deletes a data stream. +Delete data streams. +Deletes one or more data streams and their backing indices. {ref}/data-streams.html[Endpoint documentation] [source,ts] @@ -3529,7 +3744,10 @@ client.indices.deleteDataStream({ name }) [discrete] ==== delete_index_template -Deletes an index template. +Delete an index template. +The provided may contain multiple template names separated by a comma. If multiple template +names are specified then there is no wildcard support and the provided names should match completely with +existing templates. {ref}/indices-delete-template.html[Endpoint documentation] [source,ts] @@ -3547,7 +3765,7 @@ client.indices.deleteIndexTemplate({ name }) [discrete] ==== delete_template -Deletes an index template. +Deletes a legacy index template. {ref}/indices-delete-template-v1.html[Endpoint documentation] [source,ts] @@ -3568,7 +3786,7 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== disk_usage -Analyzes the disk usage of each field of an index or data stream +Analyzes the disk usage of each field of an index or data stream. {ref}/indices-disk-usage.html[Endpoint documentation] [source,ts] @@ -3596,7 +3814,7 @@ To use the API, this parameter must be set to `true`. [discrete] ==== downsample -Downsample an index +Aggregates a time series (TSDS) index and stores pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval. {ref}/indices-downsample-data-stream.html[Endpoint documentation] [source,ts] @@ -3614,7 +3832,7 @@ client.indices.downsample({ index, target_index }) [discrete] ==== exists -Returns information about whether a particular index exists. +Checks if a data stream, index, or alias exists. {ref}/indices-exists.html[Endpoint documentation] [source,ts] @@ -3640,7 +3858,7 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== exists_alias -Returns information about whether a particular alias exists. +Checks if an alias exists. {ref}/indices-aliases.html[Endpoint documentation] [source,ts] @@ -3683,6 +3901,7 @@ client.indices.existsIndexTemplate({ name }) [discrete] ==== exists_template +Check existence of index templates. Returns information about whether a particular index template exists. {ref}/indices-template-exists-v1.html[Endpoint documentation] @@ -3720,7 +3939,7 @@ client.indices.explainDataLifecycle({ index }) [discrete] ==== field_usage_stats -Returns the field usage stats for each field of an index +Returns field usage information for each shard and field of an index. {ref}/field-usage-stats.html[Endpoint documentation] [source,ts] @@ -3750,7 +3969,7 @@ Set to all or any positive integer up to the total number of shards in the index [discrete] ==== flush -Performs the flush operation on one or more indices. +Flushes one or more data streams or indices. {ref}/indices-flush.html[Endpoint documentation] [source,ts] @@ -3801,7 +4020,8 @@ client.indices.forcemerge({ ... }) [discrete] ==== get -Returns information about one or more indices. +Returns information about one or more indices. For data streams, the API returns information about the +stream’s backing indices. {ref}/indices-get-index.html[Endpoint documentation] [source,ts] @@ -3830,7 +4050,7 @@ such as open,hidden. [discrete] ==== get_alias -Returns an alias. +Retrieves information for one or more aliases. {ref}/indices-aliases.html[Endpoint documentation] [source,ts] @@ -3859,7 +4079,8 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== get_data_lifecycle -Returns the data stream lifecycle of the selected data streams. +Get data stream lifecycles. +Retrieves the data stream lifecycle configuration of one or more data streams. {ref}/data-streams-get-lifecycle.html[Endpoint documentation] [source,ts] @@ -3881,7 +4102,8 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== get_data_stream -Returns data streams. +Get data streams. +Retrieves information about one or more data streams. {ref}/data-streams.html[Endpoint documentation] [source,ts] @@ -3901,7 +4123,8 @@ Supports a list of values, such as `open,hidden`. [discrete] ==== get_field_mapping -Returns mapping for one or more fields. +Retrieves mapping definitions for one or more fields. +For data streams, the API retrieves field mappings for the stream’s backing indices. {ref}/indices-get-field-mapping.html[Endpoint documentation] [source,ts] @@ -3929,7 +4152,8 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== get_index_template -Returns an index template. +Get index templates. +Returns information about one or more index templates. {ref}/indices-get-template.html[Endpoint documentation] [source,ts] @@ -3949,7 +4173,8 @@ client.indices.getIndexTemplate({ ... }) [discrete] ==== get_mapping -Returns mappings for one or more indices. +Retrieves mapping definitions for one or more indices. +For data streams, the API retrieves mappings for the stream’s backing indices. {ref}/indices-get-mapping.html[Endpoint documentation] [source,ts] @@ -3977,7 +4202,8 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== get_settings -Returns settings for one or more indices. +Returns setting information for one or more indices. For data streams, +returns setting information for the stream’s backing indices. {ref}/indices-get-settings.html[Endpoint documentation] [source,ts] @@ -4012,7 +4238,8 @@ error. [discrete] ==== get_template -Returns an index template. +Get index templates. +Retrieves information about one or more index templates. {ref}/indices-get-template-v1.html[Endpoint documentation] [source,ts] @@ -4034,7 +4261,17 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== migrate_to_data_stream -Migrates an alias to a data stream +Convert an index alias to a data stream. +Converts an index alias to a data stream. +You must have a matching index template that is data stream enabled. +The alias must meet the following criteria: +The alias must have a write index; +All indices for the alias must have a `@timestamp` field mapping of a `date` or `date_nanos` field type; +The alias must not have any filters; +The alias must not use custom routing. +If successful, the request removes the alias and creates a data stream with the same name. +The indices for the alias become hidden backing indices for the stream. +The write index for the alias becomes the write index for the stream. {ref}/data-streams.html[Endpoint documentation] [source,ts] @@ -4050,7 +4287,8 @@ client.indices.migrateToDataStream({ name }) [discrete] ==== modify_data_stream -Modifies a data stream +Update data streams. +Performs one or more data stream modification actions in a single atomic operation. {ref}/data-streams.html[Endpoint documentation] [source,ts] @@ -4066,7 +4304,8 @@ client.indices.modifyDataStream({ actions }) [discrete] ==== open -Opens an index. +Opens a closed index. +For data streams, the API opens any closed backing indices. {ref}/indices-open-close.html[Endpoint documentation] [source,ts] @@ -4115,7 +4354,7 @@ client.indices.promoteDataStream({ name }) [discrete] ==== put_alias -Creates or updates an alias. +Adds a data stream or index to an alias. {ref}/indices-aliases.html[Endpoint documentation] [source,ts] @@ -4133,7 +4372,7 @@ 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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Query used to limit documents the alias can access. +** *`filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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. @@ -4153,7 +4392,8 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== put_data_lifecycle -Updates the data stream lifecycle of the selected data streams. +Update data stream lifecycles. +Update the data stream lifecycle of the specified data streams. {ref}/data-streams-put-lifecycle.html[Endpoint documentation] [source,ts] @@ -4184,7 +4424,8 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== put_index_template -Creates or updates an index template. +Create or update an index template. +Index templates define settings, mappings, and aliases that can be applied automatically to new indices. {ref}/indices-put-template.html[Endpoint documentation] [source,ts] @@ -4228,7 +4469,9 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== put_mapping -Updates the index mappings. +Adds new fields to an existing data stream or index. +You can also use this API to change the search settings of existing fields. +For data streams, these changes are applied to all backing indices by default. {ref}/indices-put-mapping.html[Endpoint documentation] [source,ts] @@ -4275,7 +4518,8 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== put_settings -Updates the index settings. +Changes a dynamic index setting in real time. For data streams, index setting +changes are applied to all backing indices by default. {ref}/indices-update-settings.html[Endpoint documentation] [source,ts] @@ -4311,7 +4555,8 @@ error. [discrete] ==== put_template -Creates or updates an index template. +Create or update an index template. +Index templates define settings, mappings, and aliases that can be applied automatically to new indices. {ref}/indices-templates-v1.html[Endpoint documentation] [source,ts] @@ -4343,7 +4588,8 @@ received before the timeout expires, the request fails and returns an error. [discrete] ==== recovery -Returns information about ongoing index shard recoveries. +Returns information about ongoing and completed shard recoveries for one or more indices. +For data streams, the API returns information for the stream’s backing indices. {ref}/indices-recovery.html[Endpoint documentation] [source,ts] @@ -4363,7 +4609,8 @@ To target all data streams and indices, omit this parameter or use `*` or `_all` [discrete] ==== refresh -Performs the refresh operation in one or more indices. +A refresh makes recent operations performed on one or more indices available for search. +For data streams, the API runs the refresh operation on the stream’s backing indices. {ref}/indices-refresh.html[Endpoint documentation] [source,ts] @@ -4407,7 +4654,9 @@ client.indices.reloadSearchAnalyzers({ index }) [discrete] ==== resolve_cluster -Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. +Resolves the specified index expressions to return information about each cluster, including +the local cluster, if included. +Multiple patterns and remote clusters are supported. {ref}/indices-resolve-cluster-api.html[Endpoint documentation] [source,ts] @@ -4433,7 +4682,8 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== resolve_index -Returns information about any matching indices, aliases, and data streams +Resolves the specified name(s) and/or index patterns for indices, aliases, and data streams. +Multiple patterns and remote clusters are supported. {ref}/indices-resolve-index-api.html[Endpoint documentation] [source,ts] @@ -4454,8 +4704,7 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== rollover -Updates an alias to point to a new index when the existing index -is considered to be too large or too old. +Creates a new index for a data stream or index alias. {ref}/indices-rollover-index.html[Endpoint documentation] [source,ts] @@ -4492,7 +4741,8 @@ Set to all or any positive integer up to the total number of shards in the index [discrete] ==== segments -Provides low-level information about segments in a Lucene index. +Returns low-level information about the Lucene segments in index shards. +For data streams, the API returns information about the stream’s backing indices. {ref}/indices-segments.html[Endpoint documentation] [source,ts] @@ -4518,7 +4768,8 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== shard_stores -Provides store information for shard copies of indices. +Retrieves store information about replica shards in one or more indices. +For data streams, the API retrieves store information for the stream’s backing indices. {ref}/indices-shards-stores.html[Endpoint documentation] [source,ts] @@ -4541,7 +4792,7 @@ this argument determines whether wildcard expressions match hidden data streams. [discrete] ==== shrink -Allow to shrink an existing index into a new index with fewer primary shards. +Shrinks an existing index into a new index with fewer primary shards. {ref}/indices-shrink-index.html[Endpoint documentation] [source,ts] @@ -4567,7 +4818,8 @@ Set to `all` or any positive integer up to the total number of shards in the ind [discrete] ==== simulate_index_template -Simulate matching the given index name against the index templates in the system +Simulate an index. +Returns the index configuration that would be applied to the specified index from an existing index template. {ref}/indices-simulate-index.html[Endpoint documentation] [source,ts] @@ -4585,7 +4837,8 @@ client.indices.simulateIndexTemplate({ name }) [discrete] ==== simulate_template -Simulate resolving the given template name or body +Simulate an index template. +Returns the index configuration that would be applied by a particular index template. {ref}/indices-simulate-template.html[Endpoint documentation] [source,ts] @@ -4629,7 +4882,7 @@ that uses deprecated components, Elasticsearch will emit a deprecation warning. [discrete] ==== split -Allows you to split an existing index into a new index with more primary shards. +Splits an existing index into a new index with more primary shards. {ref}/indices-split-index.html[Endpoint documentation] [source,ts] @@ -4654,7 +4907,8 @@ Set to `all` or any positive integer up to the total number of shards in the ind [discrete] ==== stats -Provides statistics on operations happening in an index. +Returns statistics for one or more indices. +For data streams, the API retrieves statistics for the stream’s backing indices. {ref}/indices-stats.html[Endpoint documentation] [source,ts] @@ -4682,7 +4936,7 @@ such as `open,hidden`. [discrete] ==== unfreeze -Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. +Unfreezes an index. {ref}/unfreeze-index-api.html[Endpoint documentation] [source,ts] @@ -4711,7 +4965,7 @@ Set to `all` or any positive integer up to the total number of shards in the ind [discrete] ==== update_aliases -Updates index aliases. +Adds a data stream or index to an alias. {ref}/indices-aliases.html[Endpoint documentation] [source,ts] @@ -4731,7 +4985,7 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== validate_query -Allows a user to validate a potentially expensive query without executing it. +Validates a potentially expensive query without executing it. {ref}/search-validate.html[Endpoint documentation] [source,ts] @@ -4746,7 +5000,7 @@ client.indices.validateQuery({ ... }) ** *`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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Query in the Lucene query string syntax. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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. @@ -4806,7 +5060,7 @@ client.inference.get({ ... }) [discrete] ==== inference -Perform inference +Perform inference on the service {ref}/post-inference-api.html[Endpoint documentation] [source,ts] @@ -4829,7 +5083,7 @@ Not required for other tasks. [discrete] ==== put -Configure an inference endpoint for use in the Inference API +Create an inference endpoint {ref}/put-inference-api.html[Endpoint documentation] [source,ts] @@ -4847,9 +5101,18 @@ client.inference.put({ inference_id }) [discrete] === ingest +[discrete] +==== delete_geoip_database +Deletes a geoip database configuration +[source,ts] +---- +client.ingest.deleteGeoipDatabase() +---- + + [discrete] ==== delete_pipeline -Deletes a pipeline. +Deletes one or more existing ingest pipeline. {ref}/delete-pipeline-api.html[Endpoint documentation] [source,ts] @@ -4870,7 +5133,7 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== geo_ip_stats -Returns statistical information about geoip databases +Gets download statistics for GeoIP2 databases used with the geoip processor. {ref}/geoip-processor.html[Endpoint documentation] [source,ts] @@ -4879,9 +5142,19 @@ client.ingest.geoIpStats() ---- +[discrete] +==== get_geoip_database +Returns geoip database configuration. +[source,ts] +---- +client.ingest.getGeoipDatabase() +---- + + [discrete] ==== get_pipeline -Returns a pipeline. +Returns information about one or more ingest pipelines. +This API returns a local reference of the pipeline. {ref}/get-pipeline-api.html[Endpoint documentation] [source,ts] @@ -4902,7 +5175,9 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== processor_grok -Returns a list of the built-in patterns. +Extracts structured fields out of a single text field within a document. +You choose which field to extract matched fields from, as well as the grok pattern you expect will match. +A grok pattern is like a regular expression that supports aliased expressions that can be reused. {ref}/grok-processor.html[Endpoint documentation] [source,ts] @@ -4911,9 +5186,19 @@ client.ingest.processorGrok() ---- +[discrete] +==== put_geoip_database +Puts the configuration for a geoip database to be downloaded +[source,ts] +---- +client.ingest.putGeoipDatabase() +---- + + [discrete] ==== put_pipeline -Creates or updates a pipeline. +Creates or updates an ingest pipeline. +Changes made using this API take effect immediately. {ref}/ingest.html[Endpoint documentation] [source,ts] @@ -4928,8 +5213,8 @@ client.ingest.putPipeline({ id }) ** *`id` (string)*: ID of the ingest pipeline to create or update. ** *`_meta` (Optional, Record)*: Optional metadata about the ingest pipeline. May have any contents. This map is not automatically generated by Elasticsearch. ** *`description` (Optional, string)*: Description of the ingest pipeline. -** *`on_failure` (Optional, { attachment, append, csv, convert, date, date_index_name, dot_expander, enrich, fail, foreach, json, user_agent, kv, geoip, grok, gsub, join, lowercase, remove, rename, reroute, script, set, sort, split, trim, uppercase, urldecode, bytes, dissect, set_security_user, pipeline, drop, circle, inference }[])*: Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline's remaining processors. -** *`processors` (Optional, { attachment, append, csv, convert, date, date_index_name, dot_expander, enrich, fail, foreach, json, user_agent, kv, geoip, grok, gsub, join, lowercase, remove, rename, reroute, script, set, sort, split, trim, uppercase, urldecode, bytes, dissect, set_security_user, pipeline, drop, circle, inference }[])*: Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified. +** *`on_failure` (Optional, { append, attachment, bytes, circle, convert, csv, date, date_index_name, dissect, dot_expander, drop, enrich, fail, foreach, geoip, grok, gsub, inference, join, json, kv, lowercase, pipeline, remove, rename, reroute, script, set, set_security_user, sort, split, trim, uppercase, urldecode, user_agent }[])*: Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline's remaining processors. +** *`processors` (Optional, { append, attachment, bytes, circle, convert, csv, date, date_index_name, dissect, dot_expander, drop, enrich, fail, foreach, geoip, grok, gsub, inference, join, json, kv, lowercase, pipeline, remove, rename, reroute, script, set, set_security_user, sort, split, trim, uppercase, urldecode, user_agent }[])*: Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified. ** *`version` (Optional, number)*: Version number used by external systems to track ingest pipelines. This parameter is intended for external systems only. Elasticsearch does not use or validate pipeline version numbers. ** *`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. @@ -4937,7 +5222,7 @@ client.ingest.putPipeline({ id }) [discrete] ==== simulate -Allows to simulate a pipeline with example documents. +Executes an ingest pipeline against a set of provided documents. {ref}/simulate-pipeline-api.html[Endpoint documentation] [source,ts] @@ -4972,7 +5257,8 @@ client.license.delete() [discrete] ==== get -Retrieves licensing information for the cluster +This API returns information about the type of license, when it was issued, and when it expires, for example. +For more information about the different types of licenses, see https://www.elastic.co/subscriptions. {ref}/get-license.html[Endpoint documentation] [source,ts] @@ -5030,7 +5316,8 @@ client.license.post({ ... }) [discrete] ==== post_start_basic -Starts an indefinite basic license. +The start basic API enables you to initiate an indefinite basic license, which gives access to all the basic features. If the basic license does not support all of the features that are available with your current license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true. +To check the status of your basic license, use the following API: [Get basic status](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-basic-status.html). {ref}/start-basic.html[Endpoint documentation] [source,ts] @@ -5046,7 +5333,7 @@ client.license.postStartBasic({ ... }) [discrete] ==== post_start_trial -starts a limited time trial license. +The start trial API enables you to start a 30-day trial, which gives access to all subscription features. {ref}/start-trial.html[Endpoint documentation] [source,ts] @@ -5065,7 +5352,7 @@ client.license.postStartTrial({ ... }) === logstash [discrete] ==== delete_pipeline -Deletes Logstash Pipelines used by Central Management +Deletes a pipeline used for Logstash Central Management. {ref}/logstash-api-delete-pipeline.html[Endpoint documentation] [source,ts] @@ -5081,7 +5368,7 @@ client.logstash.deletePipeline({ id }) [discrete] ==== get_pipeline -Retrieves Logstash Pipelines used by Central Management +Retrieves pipelines used for Logstash Central Management. {ref}/logstash-api-get-pipeline.html[Endpoint documentation] [source,ts] @@ -5097,7 +5384,7 @@ client.logstash.getPipeline({ ... }) [discrete] ==== put_pipeline -Adds and updates Logstash Pipelines used for Central Management +Creates or updates a pipeline used for Logstash Central Management. {ref}/logstash-api-put-pipeline.html[Endpoint documentation] [source,ts] @@ -5156,7 +5443,10 @@ client.migration.postFeatureUpgrade() === ml [discrete] ==== clear_trained_model_deployment_cache -Clear the cached results from a trained model deployment +Clears a trained model deployment cache on all nodes where the trained model is assigned. +A trained model deployment may have an inference cache enabled. +As requests are handled by each allocated node, their responses may be cached on that individual node. +Calling this API clears the caches without restarting the deployment. {ref}/clear-trained-model-deployment-cache.html[Endpoint documentation] [source,ts] @@ -5172,7 +5462,11 @@ client.ml.clearTrainedModelDeploymentCache({ model_id }) [discrete] ==== close_job -Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. +Close anomaly detection jobs. +A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results. +When you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data. +If you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request. +When a datafeed that has a specified end date stops, it automatically closes its associated job. {ref}/ml-close-job.html[Endpoint documentation] [source,ts] @@ -5191,7 +5485,7 @@ client.ml.closeJob({ job_id }) [discrete] ==== delete_calendar -Deletes a calendar. +Removes all scheduled events from a calendar, then deletes it. {ref}/ml-delete-calendar.html[Endpoint documentation] [source,ts] @@ -5243,7 +5537,7 @@ list of jobs or groups. [discrete] ==== delete_data_frame_analytics -Deletes an existing data frame analytics job. +Deletes a data frame analytics job. {ref}/delete-dfanalytics.html[Endpoint documentation] [source,ts] @@ -5283,6 +5577,14 @@ stopping and deleting the datafeed. [discrete] ==== delete_expired_data Deletes expired and unused machine learning data. +Deletes all job results, model snapshots and forecast data that have exceeded +their retention days period. Machine learning state documents that are not +associated with any job are also deleted. +You can limit the request to a single or set of anomaly detection jobs by +using a job identifier, a group name, a comma-separated list of jobs, or a +wildcard expression. You can delete expired data for all anomaly detection +jobs by using _all, by specifying * as the , or by omitting the +. {ref}/ml-delete-expired-data.html[Endpoint documentation] [source,ts] @@ -5303,6 +5605,8 @@ behavior is no throttling. [discrete] ==== delete_filter Deletes a filter. +If an anomaly detection job references the filter, you cannot delete the +filter. You must update or delete the job before you can delete the filter. {ref}/ml-delete-filter.html[Endpoint documentation] [source,ts] @@ -5319,6 +5623,10 @@ client.ml.deleteFilter({ filter_id }) [discrete] ==== delete_forecast Deletes forecasts from a machine learning job. +By default, forecasts are retained for 14 days. You can specify a +different retention period with the `expires_in` parameter in the forecast +jobs API. The delete forecast API enables you to delete one or more +forecasts before they expire. {ref}/ml-delete-forecast.html[Endpoint documentation] [source,ts] @@ -5344,7 +5652,13 @@ error. [discrete] ==== delete_job -Deletes an existing anomaly detection job. +Delete an anomaly detection job. +All job configuration, model state and results are deleted. +It is not currently possible to delete multiple jobs using wildcards or a +comma separated list. If you delete a job that has a datafeed, the request +first tries to delete the datafeed. This behavior is equivalent to calling +the delete datafeed API with the same timeout and force parameters as the +delete job request. {ref}/ml-delete-job.html[Endpoint documentation] [source,ts] @@ -5368,6 +5682,9 @@ job deletion completes. [discrete] ==== delete_model_snapshot Deletes an existing model snapshot. +You cannot delete the active model snapshot. To delete that snapshot, first +revert to a different one. To identify the active model snapshot, refer to +the `model_snapshot_id` in the results from the get jobs API. {ref}/ml-delete-snapshot.html[Endpoint documentation] [source,ts] @@ -5384,7 +5701,8 @@ client.ml.deleteModelSnapshot({ job_id, snapshot_id }) [discrete] ==== delete_trained_model -Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. +Deletes an existing trained inference model that is currently not referenced +by an ingest pipeline. {ref}/delete-trained-models.html[Endpoint documentation] [source,ts] @@ -5401,7 +5719,10 @@ client.ml.deleteTrainedModel({ model_id }) [discrete] ==== delete_trained_model_alias -Deletes a model alias that refers to the trained model +Deletes a trained model alias. +This API deletes an existing model alias that refers to a trained model. If +the model alias is missing or refers to a model other than the one identified +by the `model_id`, this API returns an error. {ref}/delete-trained-models-aliases.html[Endpoint documentation] [source,ts] @@ -5418,7 +5739,9 @@ client.ml.deleteTrainedModelAlias({ model_alias, model_id }) [discrete] ==== estimate_model_memory -Estimates the model memory +Makes an estimation of the memory usage for an anomaly detection job model. +It is based on analysis configuration details for the job and cardinality +estimates for the fields it references. {ref}/ml-apis.html[Endpoint documentation] [source,ts] @@ -5448,6 +5771,10 @@ omitted from the request if no detectors have a `by_field_name`, [discrete] ==== evaluate_data_frame Evaluates the data frame analytics for an annotated index. +The API packages together commonly used evaluation metrics for various types +of machine learning features. This has been designed for use on indexes +created by data frame analytics. Evaluation requires both a ground truth +field and an analytics result field to be present. {ref}/evaluate-dfanalytics.html[Endpoint documentation] [source,ts] @@ -5461,11 +5788,17 @@ 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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: A query clause that retrieves a subset of data from the source index. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: A query clause that retrieves a subset of data from the source index. [discrete] ==== explain_data_frame_analytics Explains a data frame analytics config. +This API provides explanations for a data frame analytics config that either +exists already or one that has not been created yet. The following +explanations are provided: +* which fields are included or not in the analysis and why, +* how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on. +If you have object fields or fields that are excluded via source filtering, they are not included in the explanation. {ref}/explain-dfanalytics.html[Endpoint documentation] [source,ts] @@ -5508,6 +5841,14 @@ learning node capacity for it to be immediately assigned to a node. [discrete] ==== flush_job Forces any buffered data to be processed by the job. +The flush jobs API is only applicable when sending data for analysis using +the post data API. Depending on the content of the buffer, then it might +additionally calculate new results. Both flush and close operations are +similar, however the flush is more efficient if you are expecting to send +more data for analysis. When flushing, the job remains open and is available +to continue analyzing data. A close operation additionally prunes and +persists the model state to disk and the job must be opened again before +analyzing further data. {ref}/ml-flush-job.html[Endpoint documentation] [source,ts] @@ -5528,7 +5869,12 @@ client.ml.flushJob({ job_id }) [discrete] ==== forecast -Predicts the future behavior of a time series by using its historical behavior. +Predicts the future behavior of a time series by using its historical +behavior. + +Forecasts are not supported for jobs that perform population analysis; an +error occurs if you try to create a forecast for a job that has an +`over_field_name` in its configuration. {ref}/ml-forecast.html[Endpoint documentation] [source,ts] @@ -5549,6 +5895,7 @@ create a forecast; otherwise, an error occurs. [discrete] ==== get_buckets Retrieves anomaly detection job results for one or more buckets. +The API presents a chronological view of the records, grouped by bucket. {ref}/ml-get-bucket.html[Endpoint documentation] [source,ts] @@ -5643,6 +5990,9 @@ This parameter has the `from` and `size` properties. [discrete] ==== get_data_frame_analytics Retrieves configuration information for data frame analytics jobs. +You can get information for multiple data frame analytics jobs in a single +API request by using a comma-separated list of data frame analytics jobs or a +wildcard expression. {ref}/get-dfanalytics.html[Endpoint documentation] [source,ts] @@ -5709,6 +6059,12 @@ there are no matches or only partial matches. [discrete] ==== get_datafeed_stats Retrieves usage information for datafeeds. +You can get statistics for multiple datafeeds in a single API request by +using a comma-separated list of datafeeds or a wildcard expression. You can +get statistics for all datafeeds by using `_all`, by specifying `*` as the +``, or by omitting the ``. If the datafeed is stopped, the +only information you receive is the `datafeed_id` and the `state`. +This API returns a maximum of 10,000 datafeeds. {ref}/ml-get-datafeed-stats.html[Endpoint documentation] [source,ts] @@ -5737,6 +6093,11 @@ partial matches. If this parameter is `false`, the request returns a [discrete] ==== get_datafeeds Retrieves configuration information for datafeeds. +You can get information for multiple datafeeds in a single API request by +using a comma-separated list of datafeeds or a wildcard expression. You can +get information for all datafeeds by using `_all`, by specifying `*` as the +``, or by omitting the ``. +This API returns a maximum of 10,000 datafeeds. {ref}/ml-get-datafeed.html[Endpoint documentation] [source,ts] @@ -5768,6 +6129,7 @@ be retrieved and then added to another cluster. [discrete] ==== get_filters Retrieves filters. +You can get a single filter or all filters. {ref}/ml-get-filter.html[Endpoint documentation] [source,ts] @@ -5786,6 +6148,9 @@ client.ml.getFilters({ ... }) [discrete] ==== get_influencers Retrieves anomaly detection job results for one or more influencers. +Influencers are the entities that have contributed to, or are to blame for, +the anomalies. Influencer results are available only if an +`influencer_field_name` is specified in the job configuration. {ref}/ml-get-influencer.html[Endpoint documentation] [source,ts] @@ -5847,6 +6212,10 @@ code when there are no matches or only partial matches. [discrete] ==== get_jobs Retrieves configuration information for anomaly detection jobs. +You can get information for multiple anomaly detection jobs in a single API +request by using a group name, a comma-separated list of jobs, or a wildcard +expression. You can get information for all anomaly detection jobs by using +`_all`, by specifying `*` as the ``, or by omitting the ``. {ref}/ml-get-job.html[Endpoint documentation] [source,ts] @@ -5877,7 +6246,8 @@ be retrieved and then added to another cluster. [discrete] ==== get_memory_stats -Returns information on how ML is using memory. +Get information about how machine learning jobs and trained models are using memory, +on each node, both within the JVM heap, and natively, outside of the JVM. {ref}/get-ml-memory.html[Endpoint documentation] [source,ts] @@ -5900,7 +6270,7 @@ fails and returns an error. [discrete] ==== get_model_snapshot_upgrade_stats -Gets stats for anomaly detection job model snapshot upgrades that are in progress. +Retrieves usage information for anomaly detection job model snapshot upgrades. {ref}/ml-get-job-model-snapshot-upgrade-stats.html[Endpoint documentation] [source,ts] @@ -5954,7 +6324,23 @@ by specifying `*` as the snapshot ID, or by omitting the snapshot ID. [discrete] ==== get_overall_buckets -Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. +Retrieves overall bucket results that summarize the bucket results of +multiple anomaly detection jobs. + +The `overall_score` is calculated by combining the scores of all the +buckets within the overall bucket span. First, the maximum +`anomaly_score` per anomaly detection job in the overall bucket is +calculated. Then the `top_n` of those scores are averaged to result in +the `overall_score`. This means that you can fine-tune the +`overall_score` so that it is more or less sensitive to the number of +jobs that detect an anomaly at the same time. For example, if you set +`top_n` to `1`, the `overall_score` is the maximum bucket score in the +overall bucket. Alternatively, if you set `top_n` to the number of jobs, +the `overall_score` is high only when all jobs detect anomalies in that +overall bucket. If you set the `bucket_span` parameter (to a value +greater than its default), the `overall_score` is the maximum +`overall_score` of the overall buckets that have a span equal to the +jobs' largest bucket span. {ref}/ml-get-overall-buckets.html[Endpoint documentation] [source,ts] @@ -5983,6 +6369,16 @@ using `_all` or by specifying `*` as the ``. [discrete] ==== get_records Retrieves anomaly records for an anomaly detection job. +Records contain the detailed analytical results. They describe the anomalous +activity that has been identified in the input data based on the detector +configuration. +There can be many anomaly records depending on the characteristics and size +of the input data. In practice, there are often too many to be able to +manually process them. The machine learning features therefore perform a +sophisticated aggregation of the anomaly records into buckets. +The number of record results depends on the number of anomalies found in each +bucket, which relates to the number of time series being modeled and the +number of detectors. {ref}/ml-get-record.html[Endpoint documentation] [source,ts] @@ -6007,7 +6403,7 @@ client.ml.getRecords({ job_id }) [discrete] ==== get_trained_models -Retrieves configuration information for a trained inference model. +Retrieves configuration information for a trained model. {ref}/get-trained-models.html[Endpoint documentation] [source,ts] @@ -6047,7 +6443,8 @@ tags are returned. [discrete] ==== get_trained_models_stats -Retrieves usage information for trained inference models. +Retrieves usage information for trained models. You can get usage information for multiple trained +models in a single API request by using a comma-separated list of model IDs or a wildcard expression. {ref}/get-trained-models-stats.html[Endpoint documentation] [source,ts] @@ -6074,7 +6471,7 @@ subset of results when there are partial matches. [discrete] ==== infer_trained_model -Evaluate a trained model. +Evaluates a trained model. {ref}/infer-trained-model.html[Endpoint documentation] [source,ts] @@ -6096,6 +6493,12 @@ Currently, for NLP models, only a single value is allowed. [discrete] ==== info Returns defaults and limits used by machine learning. +This endpoint is designed to be used by a user interface that needs to fully +understand machine learning configurations where some options are not +specified, meaning that the defaults should be used. This endpoint may be +used to find out what those defaults are. It also provides information about +the maximum size of machine learning jobs that could run in the current +cluster configuration. {ref}/get-ml-info.html[Endpoint documentation] [source,ts] @@ -6106,7 +6509,14 @@ client.ml.info() [discrete] ==== open_job -Opens one or more anomaly detection jobs. +Open anomaly detection jobs. +An anomaly detection job must be opened in order for it to be ready to +receive and analyze data. It can be opened and closed multiple times +throughout its lifecycle. +When you open a new job, it starts with an empty model. +When you open an existing job, the most recent model state is automatically +loaded. The job is ready to resume its analysis from where it left off, once +new data is received. {ref}/ml-open-job.html[Endpoint documentation] [source,ts] @@ -6123,7 +6533,7 @@ client.ml.openJob({ job_id }) [discrete] ==== post_calendar_events -Posts scheduled events in a calendar. +Adds scheduled events to a calendar. {ref}/ml-post-calendar-event.html[Endpoint documentation] [source,ts] @@ -6142,6 +6552,9 @@ client.ml.postCalendarEvents({ calendar_id, events }) ==== post_data Sends data to an anomaly detection job for analysis. +IMPORTANT: For each job, data can be accepted from only a single connection at a time. +It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list. + {ref}/ml-post-data.html[Endpoint documentation] [source,ts] ---- @@ -6159,7 +6572,7 @@ client.ml.postData({ job_id }) [discrete] ==== preview_data_frame_analytics -Previews that will be analyzed given a data frame analytics config. +Previews the extracted features used by a data frame analytics config. {ref}/preview-dfanalytics.html[Endpoint documentation] [source,ts] @@ -6179,6 +6592,14 @@ this API. [discrete] ==== preview_datafeed Previews a datafeed. +This API returns the first "page" of search results from a datafeed. +You can preview an existing datafeed or provide configuration details for a datafeed +and anomaly detection job in the API. The preview shows the structure of the data +that will be passed to the anomaly detection engine. +IMPORTANT: When Elasticsearch security features are enabled, the preview uses the credentials of the user that +called the API. However, when the datafeed starts it uses the roles of the last user that created or updated the +datafeed. To get a preview that accurately reflects the behavior of the datafeed, use the appropriate credentials. +You can also use secondary authorization headers to supply the credentials. {ref}/ml-preview-datafeed.html[Endpoint documentation] [source,ts] @@ -6204,7 +6625,7 @@ used. You cannot specify a `job_config` object unless you also supply a `datafee [discrete] ==== put_calendar -Instantiates a calendar. +Creates a calendar. {ref}/ml-put-calendar.html[Endpoint documentation] [source,ts] @@ -6240,6 +6661,8 @@ client.ml.putCalendarJob({ calendar_id, job_id }) [discrete] ==== put_data_frame_analytics Instantiates a data frame analytics job. +This API creates a data frame analytics job that performs an analysis on the +source indices and stores the outcome in a destination index. {ref}/put-dfanalytics.html[Endpoint documentation] [source,ts] @@ -6311,6 +6734,15 @@ greater than that setting. [discrete] ==== put_datafeed Instantiates a datafeed. +Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job. +You can associate only one datafeed with each anomaly detection job. +The datafeed contains a query that runs at a defined interval (`frequency`). +If you are concerned about delayed data, you can add a delay (`query_delay') at each interval. +When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had +at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, +those credentials are used instead. +You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed +directly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index. {ref}/ml-put-datafeed.html[Endpoint documentation] [source,ts] @@ -6349,7 +6781,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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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 @@ -6372,6 +6804,8 @@ whether wildcard expressions match hidden data streams. Supports a list of value [discrete] ==== put_filter Instantiates a filter. +A filter contains a list of strings. It can be used by one or more anomaly detection jobs. +Specifically, filters are referenced in the `custom_rules` property of detector configuration objects. {ref}/ml-put-filter.html[Endpoint documentation] [source,ts] @@ -6390,7 +6824,8 @@ Up to 10000 items are allowed in each filter. [discrete] ==== put_job -Instantiates an anomaly detection job. +Create an anomaly detection job. +If you include a `datafeed_config`, you must have read index privileges on the source index. {ref}/ml-put-job.html[Endpoint documentation] [source,ts] @@ -6421,7 +6856,7 @@ client.ml.putJob({ job_id, analysis_config, data_description }) [discrete] ==== put_trained_model -Creates an inference trained model. +Enables you to supply a trained model that is not created by data frame analytics. {ref}/put-trained-models.html[Endpoint documentation] [source,ts] @@ -6467,7 +6902,22 @@ to complete. [discrete] ==== put_trained_model_alias -Creates a new model alias (or reassigns an existing one) to refer to the trained model +Creates or updates a trained model alias. A trained model alias is a logical +name used to reference a single trained model. +You can use aliases instead of trained model identifiers to make it easier to +reference your models. For example, you can use aliases in inference +aggregations and processors. +An alias must be unique and refer to only a single trained model. However, +you can have multiple aliases for each trained model. +If you use this API to update an alias such that it references a different +trained model ID and the model uses a different type of data frame analytics, +an error occurs. For example, this situation occurs if you have a trained +model for regression analysis and a trained model for classification +analysis; you cannot reassign an alias from one type of trained model to +another. +If you use this API to update an alias and there are very few input fields in +common between the old and new trained models for the model alias, the API +returns a warning. {ref}/put-trained-models-aliases.html[Endpoint documentation] [source,ts] @@ -6487,7 +6937,7 @@ already assigned and this parameter is false, the API returns an error. [discrete] ==== put_trained_model_definition_part -Creates part of a trained model definition +Creates part of a trained model definition. {ref}/put-trained-model-definition-part.html[Endpoint documentation] [source,ts] @@ -6508,7 +6958,9 @@ order of their part number. The first part must be `0` and the final part must b [discrete] ==== put_trained_model_vocabulary -Creates a trained model vocabulary +Creates a trained model vocabulary. +This API is supported only for natural language processing (NLP) models. +The vocabulary is stored in the index as described in `inference_config.*.vocabulary` of the trained model definition. {ref}/put-trained-model-vocabulary.html[Endpoint documentation] [source,ts] @@ -6527,7 +6979,11 @@ client.ml.putTrainedModelVocabulary({ model_id, vocabulary }) [discrete] ==== reset_job -Resets an existing anomaly detection job. +Resets an anomaly detection job. +All model state and results are deleted. The job is ready to start over as if +it had just been created. +It is not currently possible to reset multiple jobs using wildcards or a +comma separated list. {ref}/ml-reset-job.html[Endpoint documentation] [source,ts] @@ -6549,6 +7005,13 @@ reset. [discrete] ==== revert_model_snapshot Reverts to a specific snapshot. +The machine learning features react quickly to anomalous input, learning new +behaviors in data. Highly anomalous input increases the variance in the +models whilst the system learns whether this is a new step-change in behavior +or a one-off event. In the case where this anomalous input is known to be a +one-off, then it might be appropriate to reset the model state to a time +before this event. For example, you might consider reverting to a saved +snapshot after Black Friday or a critical system failure. {ref}/ml-revert-snapshot.html[Endpoint documentation] [source,ts] @@ -6568,7 +7031,18 @@ scratch when it is started. [discrete] ==== set_upgrade_mode -Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. +Sets a cluster wide upgrade_mode setting that prepares machine learning +indices for an upgrade. +When upgrading your cluster, in some circumstances you must restart your +nodes and reindex your machine learning indices. In those circumstances, +there must be no machine learning jobs running. You can close the machine +learning jobs, do the upgrade, then open all the jobs again. Alternatively, +you can use this API to temporarily halt tasks associated with the jobs and +datafeeds and prevent new jobs from opening. You can also use this API +during upgrades that do not require you to reindex your machine learning +indices, though stopping jobs is not a requirement in that case. +You can see the current value for the upgrade_mode setting by using the get +machine learning info API. {ref}/ml-set-upgrade-mode.html[Endpoint documentation] [source,ts] @@ -6588,6 +7062,17 @@ starting. [discrete] ==== start_data_frame_analytics Starts a data frame analytics job. +A data frame analytics job can be started and stopped multiple times +throughout its lifecycle. +If the destination index does not exist, it is created automatically the +first time you start the data frame analytics job. The +`index.number_of_shards` and `index.number_of_replicas` settings for the +destination index are copied from the source index. If there are multiple +source indices, the destination index copies the highest setting values. The +mappings for the destination index are also copied from the source indices. +If there are any mapping conflicts, the job fails to start. +If the destination index exists, it is used as is. You can therefore set up +the destination index in advance with custom settings and mappings. {ref}/start-dfanalytics.html[Endpoint documentation] [source,ts] @@ -6609,6 +7094,18 @@ starts. ==== start_datafeed Starts one or more datafeeds. +A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped +multiple times throughout its lifecycle. + +Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs. + +If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped. +If new data was indexed for that exact millisecond between stopping and starting, it will be ignored. + +When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or +update it had at the time of creation or update and runs the query using those same roles. If you provided secondary +authorization headers when you created or updated the datafeed, those credentials are used instead. + {ref}/ml-start-datafeed.html[Endpoint documentation] [source,ts] ---- @@ -6628,7 +7125,7 @@ characters. [discrete] ==== start_trained_model_deployment -Start a trained model deployment. +Starts a trained model deployment, which allocates the model to every machine learning node. {ref}/start-trained-model-deployment.html[Endpoint documentation] [source,ts] @@ -6665,6 +7162,8 @@ it will automatically be changed to a value less than the number of hardware thr [discrete] ==== stop_data_frame_analytics Stops one or more data frame analytics jobs. +A data frame analytics job can be started and stopped multiple times +throughout its lifecycle. {ref}/stop-dfanalytics.html[Endpoint documentation] [source,ts] @@ -6697,6 +7196,8 @@ stops. Defaults to 20 seconds. [discrete] ==== stop_datafeed Stops one or more datafeeds. +A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped +multiple times throughout its lifecycle. {ref}/ml-stop-datafeed.html[Endpoint documentation] [source,ts] @@ -6717,7 +7218,7 @@ the identifier. [discrete] ==== stop_trained_model_deployment -Stop a trained model deployment. +Stops a trained model deployment. {ref}/stop-trained-model-deployment.html[Endpoint documentation] [source,ts] @@ -6739,7 +7240,7 @@ restart the model deployment. [discrete] ==== update_data_frame_analytics -Updates certain properties of a data frame analytics job. +Updates an existing data frame analytics job. {ref}/update-dfanalytics.html[Endpoint documentation] [source,ts] @@ -6769,7 +7270,11 @@ learning node capacity for it to be immediately assigned to a node. [discrete] ==== update_datafeed -Updates certain properties of a datafeed. +Updates the properties of a datafeed. +You must stop and start the datafeed for the changes to be applied. +When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at +the time of the update and runs the query using those same roles. If you provide secondary authorization headers, +those credentials are used instead. {ref}/ml-update-datafeed.html[Endpoint documentation] [source,ts] @@ -6807,7 +7312,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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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 @@ -6838,7 +7343,7 @@ whether wildcard expressions match hidden data streams. Supports a list of value [discrete] ==== update_filter -Updates the description of a filter, adds items, or removes items. +Updates the description of a filter, adds items, or removes items from the list. {ref}/ml-update-filter.html[Endpoint documentation] [source,ts] @@ -6943,7 +7448,7 @@ snapshot will be deleted when the job is deleted. [discrete] ==== update_trained_model_deployment -Updates certain properties of trained model deployment. +Starts a trained model deployment, which allocates the model to every machine learning node. {ref}/update-trained-model-deployment.html[Endpoint documentation] [source,ts] @@ -6965,7 +7470,15 @@ it will automatically be changed to a value less than the number of hardware thr [discrete] ==== upgrade_job_snapshot -Upgrades a given job snapshot to the current major version. +Upgrades an anomaly detection model snapshot to the latest major version. +Over time, older snapshot formats are deprecated and removed. Anomaly +detection jobs support only snapshots that are from the current or previous +major version. +This API provides a means to upgrade a snapshot to the current major version. +This aids in preparing the cluster for an upgrade to the next major version. +Only one snapshot per anomaly detection job can be upgraded at a time and the +upgraded snapshot cannot be the current snapshot of the anomaly detection +job. {ref}/ml-upgrade-job-model-snapshot.html[Endpoint documentation] [source,ts] @@ -6983,11 +7496,33 @@ client.ml.upgradeJobSnapshot({ job_id, snapshot_id }) Otherwise, it responds as soon as the upgrade task is assigned to a node. ** *`timeout` (Optional, string | -1 | 0)*: Controls the time to wait for the request to complete. +[discrete] +=== monitoring +[discrete] +==== bulk +Used by the monitoring features to send monitoring data. + +{ref}/monitor-elasticsearch-cluster.html[Endpoint documentation] +[source,ts] +---- +client.monitoring.bulk({ system_id, system_api_version, interval }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`system_id` (string)*: Identifier of the monitored system +** *`system_api_version` (string)* +** *`interval` (string | -1 | 0)*: Collection interval (e.g., '10s' or '10000ms') of the payload +** *`type` (Optional, string)*: Default document type for items which don't provide one +** *`operations` (Optional, { index, create, update, delete } | { detect_noop, doc, doc_as_upsert, script, scripted_upsert, _source, upsert } | object[])* + [discrete] === nodes [discrete] ==== clear_repositories_metering_archive -Removes the archived repositories metering information present in the cluster. +You can use this API to clear the archived repositories metering information in the cluster. {ref}/clear-repositories-metering-archive-api.html[Endpoint documentation] [source,ts] @@ -7005,7 +7540,10 @@ All the nodes selective options are explained [here](https://www.elastic.co/guid [discrete] ==== get_repositories_metering_info -Returns cluster repositories metering information. +You can use the cluster repositories metering API to retrieve repositories metering information in a cluster. +This API exposes monotonically non-decreasing counters and it’s expected that clients would durably store the +information needed to compute aggregations over a period of time. Additionally, the information exposed by this +API is volatile, meaning that it won’t be present after node restarts. {ref}/get-repositories-metering-api.html[Endpoint documentation] [source,ts] @@ -7022,7 +7560,8 @@ All the nodes selective options are explained [here](https://www.elastic.co/guid [discrete] ==== hot_threads -Returns information about hot threads on each node in the cluster. +This API yields a breakdown of the hot threads on each selected node in the cluster. +The output is plain text with a breakdown of each node’s top hot threads. {ref}/cluster-nodes-hot-threads.html[Endpoint documentation] [source,ts] @@ -7050,7 +7589,7 @@ before the timeout expires, the request fails and returns an error. [discrete] ==== info -Returns information about nodes in the cluster. +Returns cluster nodes information. {ref}/cluster-nodes-info.html[Endpoint documentation] [source,ts] @@ -7070,7 +7609,7 @@ client.nodes.info({ ... }) [discrete] ==== reload_secure_settings -Reloads secure settings. +Reloads the keystore on nodes in the cluster. {ref}/secure-settings.html[Endpoint documentation] [source,ts] @@ -7089,7 +7628,7 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== stats -Returns statistical information about nodes in the cluster. +Returns cluster nodes statistics. {ref}/cluster-nodes-stats.html[Endpoint documentation] [source,ts] @@ -7117,7 +7656,7 @@ client.nodes.stats({ ... }) [discrete] ==== usage -Returns low-level information about REST actions usage on nodes. +Returns information on the usage of features. {ref}/cluster-nodes-usage.html[Endpoint documentation] [source,ts] @@ -7136,15 +7675,32 @@ A list of the following options: `_all`, `rest_actions`. If no response is received before the timeout expires, the request fails and returns an error. [discrete] -=== query_ruleset +=== query_rules [discrete] -==== delete +==== delete_rule +Deletes a query rule within a query ruleset. + +{ref}/delete-query-rule.html[Endpoint documentation] +[source,ts] +---- +client.queryRules.deleteRule({ ruleset_id, rule_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`ruleset_id` (string)*: The unique identifier of the query ruleset containing the rule to delete +** *`rule_id` (string)*: The unique identifier of the query rule within the specified ruleset to delete + +[discrete] +==== delete_ruleset Deletes a query ruleset. {ref}/delete-query-ruleset.html[Endpoint documentation] [source,ts] ---- -client.queryRuleset.delete({ ruleset_id }) +client.queryRules.deleteRuleset({ ruleset_id }) ---- [discrete] @@ -7154,13 +7710,30 @@ client.queryRuleset.delete({ ruleset_id }) ** *`ruleset_id` (string)*: The unique identifier of the query ruleset to delete [discrete] -==== get -Returns the details about a query ruleset. +==== get_rule +Returns the details about a query rule within a query ruleset + +{ref}/get-query-rule.html[Endpoint documentation] +[source,ts] +---- +client.queryRules.getRule({ ruleset_id, rule_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`ruleset_id` (string)*: The unique identifier of the query ruleset containing the rule to retrieve +** *`rule_id` (string)*: The unique identifier of the query rule within the specified ruleset to retrieve + +[discrete] +==== get_ruleset +Returns the details about a query ruleset {ref}/get-query-ruleset.html[Endpoint documentation] [source,ts] ---- -client.queryRuleset.get({ ruleset_id }) +client.queryRules.getRuleset({ ruleset_id }) ---- [discrete] @@ -7170,13 +7743,13 @@ client.queryRuleset.get({ ruleset_id }) ** *`ruleset_id` (string)*: The unique identifier of the query ruleset [discrete] -==== list -Lists query rulesets. +==== list_rulesets +Returns summarized information about existing query rulesets. {ref}/list-query-rulesets.html[Endpoint documentation] [source,ts] ---- -client.queryRuleset.list({ ... }) +client.queryRules.listRulesets({ ... }) ---- [discrete] @@ -7187,13 +7760,34 @@ client.queryRuleset.list({ ... }) ** *`size` (Optional, number)*: specifies a max number of results to get [discrete] -==== put +==== put_rule +Creates or updates a query rule within a query ruleset. + +{ref}/put-query-rule.html[Endpoint documentation] +[source,ts] +---- +client.queryRules.putRule({ ruleset_id, rule_id, type, criteria, actions }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`ruleset_id` (string)*: The unique identifier of the query ruleset containing the rule to be created or updated +** *`rule_id` (string)*: The unique identifier of the query rule within the specified ruleset to be created or updated +** *`type` (Enum("pinned"))* +** *`criteria` ({ type, metadata, values } | { type, metadata, values }[])* +** *`actions` ({ ids, docs })* +** *`priority` (Optional, number)* + +[discrete] +==== put_ruleset Creates or updates a query ruleset. {ref}/put-query-ruleset.html[Endpoint documentation] [source,ts] ---- -client.queryRuleset.put({ ruleset_id, rules }) +client.queryRules.putRuleset({ ruleset_id, rules }) ---- [discrete] @@ -7201,7 +7795,7 @@ client.queryRuleset.put({ ruleset_id, rules }) * *Request (object):* ** *`ruleset_id` (string)*: The unique identifier of the query ruleset to be created or updated -** *`rules` ({ rule_id, type, criteria, actions }[])* +** *`rules` ({ rule_id, type, criteria, actions, priority } | { rule_id, type, criteria, actions, priority }[])* [discrete] === rollup @@ -7257,7 +7851,7 @@ client.rollup.getRollupCaps({ ... }) [discrete] ==== get_rollup_index_caps -Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). +Returns the rollup capabilities of all jobs inside of a rollup index (for example, the index where rollup data is stored). {ref}/rollup-get-rollup-index-caps.html[Endpoint documentation] [source,ts] @@ -7315,7 +7909,7 @@ on a per-field basis and for each field you configure which metric should be col [discrete] ==== rollup_search -Enables searching rolled-up data using the standard query DSL. +Enables searching rolled-up data using the standard Query DSL. {ref}/rollup-search.html[Endpoint documentation] [source,ts] @@ -7329,7 +7923,7 @@ client.rollup.rollupSearch({ index }) * *Request (object):* ** *`index` (string | string[])*: Enables searching rolled-up data using the standard Query DSL. ** *`aggregations` (Optional, Record)*: Specifies aggregations. -** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specifies a DSL query. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specifies a DSL query. ** *`size` (Optional, number)*: Must be zero if set, as rollups work on pre-aggregated data. ** *`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 @@ -7406,7 +8000,7 @@ client.searchApplication.deleteBehavioralAnalytics({ name }) [discrete] ==== get -Returns the details about a search application. +Returns the details about a search application {ref}/get-search-application.html[Endpoint documentation] [source,ts] @@ -7512,7 +8106,7 @@ client.searchApplication.renderQuery() [discrete] ==== search -Perform a search against a search application +Perform a search against a search application. {ref}/search-application-search.html[Endpoint documentation] [source,ts] @@ -7611,9 +8205,30 @@ client.searchableSnapshots.stats({ ... }) [discrete] === security +[discrete] +==== activate_user_profile +Creates or updates a user profile on behalf of another user. + +{ref}/security-api-activate-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.activateUserProfile({ grant_type }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`grant_type` (Enum("password" | "access_token"))* +** *`access_token` (Optional, string)* +** *`password` (Optional, string)* +** *`username` (Optional, string)* + [discrete] ==== authenticate -Enables authentication as a user and retrieve information about the authenticated user. +Enables you to submit a request with a basic auth header to authenticate a user and retrieve information about the authenticated user. +A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user. +If the user cannot be authenticated, this API returns a 401 status code. {ref}/security-api-authenticate.html[Endpoint documentation] [source,ts] @@ -7622,6 +8237,42 @@ client.security.authenticate() ---- +[discrete] +==== bulk_delete_role +The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. +The bulk delete roles API cannot delete roles that are defined in roles files. + +{ref}/security-api-bulk-delete-role.html[Endpoint documentation] +[source,ts] +---- +client.security.bulkDeleteRole({ names }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`names` (string[])*: An array of role names to delete +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) 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` then do nothing with refreshes. + +[discrete] +==== bulk_put_role +The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. +The bulk create or update roles API cannot update roles that are defined in roles files. + +{ref}/security-api-bulk-put-role.html[Endpoint documentation] +[source,ts] +---- +client.security.bulkPutRole({ roles }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`roles` (Record)*: A dictionary of role name to RoleDescriptor objects to add or update +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) 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` then do nothing with refreshes. + [discrete] ==== bulk_update_api_keys Updates the attributes of multiple existing API keys. @@ -7658,7 +8309,8 @@ setting. [discrete] ==== clear_api_key_cache -Clear a subset or all entries from the API key cache. +Evicts a subset of all entries from the API key cache. +The cache is also automatically cleared on state changes of the security index. {ref}/security-api-clear-api-key-cache.html[Endpoint documentation] [source,ts] @@ -7744,6 +8396,9 @@ client.security.clearCachedServiceTokens({ namespace, service, name }) [discrete] ==== create_api_key Creates an API key for access without requiring basic authentication. +A successful request returns a JSON structure that contains the API key, its unique id, and its name. +If applicable, it also returns expiration information for the API key in milliseconds. +NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys. {ref}/security-api-create-api-key.html[Endpoint documentation] [source,ts] @@ -7757,7 +8412,7 @@ client.security.createApiKey({ ... }) * *Request (object):* ** *`expiration` (Optional, string | -1 | 0)*: Expiration time for the API key. By default, API keys never expire. ** *`name` (Optional, string)*: Specifies the name for this API key. -** *`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. +** *`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. ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) 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` then do nothing with refreshes. @@ -7774,7 +8429,7 @@ client.security.createCrossClusterApiKey() [discrete] ==== create_service_token -Creates a service account token for access without requiring basic authentication. +Creates a service accounts token for access without requiring basic authentication. {ref}/security-api-create-service-token.html[Endpoint documentation] [source,ts] @@ -7896,6 +8551,25 @@ client.security.disableUser({ username }) ** *`username` (string)*: The username of the user to disable ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) 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` then do nothing with refreshes. +[discrete] +==== disable_user_profile +Disables a user profile so it's not visible in user profile searches. + +{ref}/security-api-disable-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.disableUserProfile({ uid }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`uid` (string)*: Unique identifier for the user profile. +** *`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. + [discrete] ==== enable_user Enables users in the native realm. @@ -7913,9 +8587,28 @@ client.security.enableUser({ username }) ** *`username` (string)*: The username of the user to enable ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) 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` then do nothing with refreshes. +[discrete] +==== enable_user_profile +Enables a user profile so it's visible in user profile searches. + +{ref}/security-api-enable-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.enableUserProfile({ uid }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`uid` (string)*: Unique identifier for the user profile. +** *`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. + [discrete] ==== enroll_kibana -Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. +Enables a Kibana instance to configure itself for communication with a secured Elasticsearch cluster. {ref}/security-api-kibana-enrollment.html[Endpoint documentation] [source,ts] @@ -7926,7 +8619,7 @@ client.security.enrollKibana() [discrete] ==== enroll_node -Allows a new node to enroll to an existing cluster with security enabled. +Allows a new node to join an existing cluster with security features enabled. {ref}/security-api-node-enrollment.html[Endpoint documentation] [source,ts] @@ -7938,6 +8631,8 @@ client.security.enrollNode() [discrete] ==== get_api_key Retrieves information for one or more API keys. +NOTE: If you have only the `manage_own_api_key` privilege, this API returns only the API keys that you own. +If you have `read_security`, `manage_api_key` or greater privileges (including `manage_security`), this API returns all API keys regardless of ownership. {ref}/security-api-get-api-key.html[Endpoint documentation] [source,ts] @@ -7997,7 +8692,8 @@ client.security.getPrivileges({ ... }) [discrete] ==== get_role -Retrieves roles in the native realm. +The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. +The get roles API cannot retrieve roles that are defined in roles files. {ref}/security-api-get-role.html[Endpoint documentation] [source,ts] @@ -8029,7 +8725,7 @@ client.security.getRoleMapping({ ... }) [discrete] ==== get_service_accounts -Retrieves information about service accounts. +This API returns a list of service accounts that match the provided path parameter(s). {ref}/security-api-get-service-accounts.html[Endpoint documentation] [source,ts] @@ -8128,9 +8824,41 @@ client.security.getUserPrivileges({ ... }) ** *`priviledge` (Optional, string)*: The name of the privilege. If you do not specify this parameter, the API returns information about all privileges for the requested application. ** *`username` (Optional, string | null)* +[discrete] +==== get_user_profile +Retrieves a user's profile using the unique profile ID. + +{ref}/security-api-get-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.getUserProfile({ uid }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`uid` (string | string[])*: A unique identifier for the user profile. +** *`data` (Optional, string | string[])*: List of filters for the `data` field of the profile document. +To return all content use `data=*`. To return a subset of content +use `data=` to retrieve content nested under the specified ``. +By default returns no `data` content. + [discrete] ==== grant_api_key Creates an API key on behalf of another user. +This API is similar to Create API keys, however it creates the API key for a user that is different than the user that runs the API. +The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created. +It is not possible to use this API to create an API key without that user’s credentials. +The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user. +In this case, the API key will be created on behalf of the impersonated user. + +This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf. + +A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name. +If applicable, it also returns expiration information for the API key in milliseconds. + +By default, API keys never expire. You can specify expiration information when you create the API keys. {ref}/security-api-grant-api-key.html[Endpoint documentation] [source,ts] @@ -8170,12 +8898,35 @@ client.security.hasPrivileges({ ... }) * *Request (object):* ** *`user` (Optional, string)*: Username ** *`application` (Optional, { application, privileges, resources }[])* -** *`cluster` (Optional, Enum("all" | "cancel_task" | "create_snapshot" | "cross_cluster_replication" | "cross_cluster_search" | "delegate_pki" | "grant_api_key" | "manage" | "manage_api_key" | "manage_autoscaling" | "manage_behavioral_analytics" | "manage_ccr" | "manage_data_frame_transforms" | "manage_data_stream_global_retention" | "manage_enrich" | "manage_ilm" | "manage_index_templates" | "manage_inference" | "manage_ingest_pipelines" | "manage_logstash_pipelines" | "manage_ml" | "manage_oidc" | "manage_own_api_key" | "manage_pipeline" | "manage_rollup" | "manage_saml" | "manage_search_application" | "manage_search_query_rules" | "manage_search_synonyms" | "manage_security" | "manage_service_account" | "manage_slm" | "manage_token" | "manage_transform" | "manage_user_profile" | "manage_watcher" | "monitor" | "monitor_data_frame_transforms" | "monitor_data_stream_global_retention" | "monitor_enrich" | "monitor_inference" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_connector_secrets" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])*: A list of the cluster privileges that you want to check. +** *`cluster` (Optional, Enum("all" | "cancel_task" | "create_snapshot" | "cross_cluster_replication" | "cross_cluster_search" | "delegate_pki" | "grant_api_key" | "manage" | "manage_api_key" | "manage_autoscaling" | "manage_behavioral_analytics" | "manage_ccr" | "manage_data_frame_transforms" | "manage_data_stream_global_retention" | "manage_enrich" | "manage_ilm" | "manage_index_templates" | "manage_inference" | "manage_ingest_pipelines" | "manage_logstash_pipelines" | "manage_ml" | "manage_oidc" | "manage_own_api_key" | "manage_pipeline" | "manage_rollup" | "manage_saml" | "manage_search_application" | "manage_search_query_rules" | "manage_search_synonyms" | "manage_security" | "manage_service_account" | "manage_slm" | "manage_token" | "manage_transform" | "manage_user_profile" | "manage_watcher" | "monitor" | "monitor_data_frame_transforms" | "monitor_data_stream_global_retention" | "monitor_enrich" | "monitor_inference" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])*: A list of the cluster privileges that you want to check. ** *`index` (Optional, { names, privileges, allow_restricted_indices }[])* +[discrete] +==== has_privileges_user_profile +Determines whether the users associated with the specified profile IDs have all the requested privileges. + +{ref}/security-api-has-privileges-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.hasPrivilegesUserProfile({ uids, privileges }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`uids` (string[])*: A list of profile IDs. The privileges are checked for associated users of the profiles. +** *`privileges` ({ application, cluster, index })* + [discrete] ==== invalidate_api_key Invalidates one or more API keys. +The `manage_api_key` privilege allows deleting any API keys. +The `manage_own_api_key` only allows deleting API keys that are owned by the user. +In addition, with the `manage_own_api_key` privilege, an invalidation request must be issued in one of the three formats: +- Set the parameter `owner=true`. +- Or, set both `username` and `realm_name` to match the user’s identity. +- Or, if the request is issued by an API key, i.e. an API key invalidates itself, specify its ID in the `ids` field. {ref}/security-api-invalidate-api-key.html[Endpoint documentation] [source,ts] @@ -8270,7 +9021,8 @@ client.security.putPrivileges({ ... }) [discrete] ==== put_role -Adds and updates roles in the native realm. +The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. +The create or update roles API cannot update roles that are defined in roles files. {ref}/security-api-put-role.html[Endpoint documentation] [source,ts] @@ -8284,11 +9036,12 @@ client.security.putRole({ name }) * *Request (object):* ** *`name` (string)*: The name of the role. ** *`applications` (Optional, { application, privileges, resources }[])*: A list of application privilege entries. -** *`cluster` (Optional, Enum("all" | "cancel_task" | "create_snapshot" | "cross_cluster_replication" | "cross_cluster_search" | "delegate_pki" | "grant_api_key" | "manage" | "manage_api_key" | "manage_autoscaling" | "manage_behavioral_analytics" | "manage_ccr" | "manage_data_frame_transforms" | "manage_data_stream_global_retention" | "manage_enrich" | "manage_ilm" | "manage_index_templates" | "manage_inference" | "manage_ingest_pipelines" | "manage_logstash_pipelines" | "manage_ml" | "manage_oidc" | "manage_own_api_key" | "manage_pipeline" | "manage_rollup" | "manage_saml" | "manage_search_application" | "manage_search_query_rules" | "manage_search_synonyms" | "manage_security" | "manage_service_account" | "manage_slm" | "manage_token" | "manage_transform" | "manage_user_profile" | "manage_watcher" | "monitor" | "monitor_data_frame_transforms" | "monitor_data_stream_global_retention" | "monitor_enrich" | "monitor_inference" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_connector_secrets" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])*: A list of cluster privileges. These privileges define the cluster-level actions for users with this role. +** *`cluster` (Optional, Enum("all" | "cancel_task" | "create_snapshot" | "cross_cluster_replication" | "cross_cluster_search" | "delegate_pki" | "grant_api_key" | "manage" | "manage_api_key" | "manage_autoscaling" | "manage_behavioral_analytics" | "manage_ccr" | "manage_data_frame_transforms" | "manage_data_stream_global_retention" | "manage_enrich" | "manage_ilm" | "manage_index_templates" | "manage_inference" | "manage_ingest_pipelines" | "manage_logstash_pipelines" | "manage_ml" | "manage_oidc" | "manage_own_api_key" | "manage_pipeline" | "manage_rollup" | "manage_saml" | "manage_search_application" | "manage_search_query_rules" | "manage_search_synonyms" | "manage_security" | "manage_service_account" | "manage_slm" | "manage_token" | "manage_transform" | "manage_user_profile" | "manage_watcher" | "monitor" | "monitor_data_frame_transforms" | "monitor_data_stream_global_retention" | "monitor_enrich" | "monitor_inference" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])*: A list of cluster privileges. These privileges define the cluster-level actions for users with this role. ** *`global` (Optional, Record)*: An object defining global privileges. A global privilege is a form of cluster privilege that is request-aware. Support for global privileges is currently limited to the management of application privileges. ** *`indices` (Optional, { field_security, names, privileges, query, allow_restricted_indices }[])*: A list of indices permissions entries. ** *`metadata` (Optional, Record)*: Optional metadata. Within the metadata object, keys that begin with an underscore (`_`) are reserved for system use. ** *`run_as` (Optional, string[])*: A list of users that the owners of this role can impersonate. *Note*: in Serverless, the run-as feature is disabled. For API compatibility, you can still specify an empty `run_as` field, but a non-empty list will be rejected. +** *`description` (Optional, string)*: Optional description of the role descriptor ** *`transient_metadata` (Optional, Record)*: Indicates roles that might be incompatible with the current cluster license, specifically roles with document and field level security. When the cluster license doesn’t allow certain features for a given role, this parameter is updated dynamically to list the incompatible features. If `enabled` is `false`, the role is ignored, but is still listed in the response from the authenticate API. ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) 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` then do nothing with refreshes. @@ -8341,7 +9094,7 @@ client.security.putUser({ username }) [discrete] ==== query_api_keys -Retrieves information for API keys using a subset of query DSL +Retrieves information for API keys in a paginated manner. You can optionally filter the results with a query. {ref}/security-api-query-api-key.html[Endpoint documentation] [source,ts] @@ -8378,9 +9131,69 @@ An API key's actual permission is the intersection of its assigned role descript ** *`with_profile_uid` (Optional, boolean)*: Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists. ** *`typed_keys` (Optional, boolean)*: Determines whether aggregation names are prefixed by their respective types in the response. +[discrete] +==== query_role +Retrieves roles in a paginated manner. You can optionally filter the results with a query. + +{ref}/security-api-query-role.html[Endpoint documentation] +[source,ts] +---- +client.security.queryRole({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`query` (Optional, { bool, exists, ids, match, match_all, prefix, range, simple_query_string, term, terms, wildcard })*: A query to filter which roles to return. +If the query parameter is missing, it is equivalent to a `match_all` query. +The query supports a subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`, +`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`. +You can query the following information associated with roles: `name`, `description`, `metadata`, +`applications.application`, `applications.privileges`, `applications.resources`. +** *`from` (Optional, number)*: Starting document offset. +By default, you cannot page through more than 10,000 hits using the from and size parameters. +To page through more hits, use the `search_after` parameter. +** *`sort` (Optional, string | { _score, _doc, _geo_distance, _script } | string | { _score, _doc, _geo_distance, _script }[])*: All public fields of a role are eligible for sorting. +In addition, sort can also be applied to the `_doc` field to sort by index order. +** *`size` (Optional, number)*: The number of hits to return. +By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. +To page through more hits, use the `search_after` parameter. +** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])*: Search after definition + +[discrete] +==== query_user +Retrieves information for Users in a paginated manner. You can optionally filter the results with a query. + +{ref}/security-api-query-user.html[Endpoint documentation] +[source,ts] +---- +client.security.queryUser({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`query` (Optional, { ids, bool, exists, match, match_all, prefix, range, simple_query_string, term, terms, wildcard })*: A query to filter which users to return. +If the query parameter is missing, it is equivalent to a `match_all` query. +The query supports a subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`, +`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`. +You can query the following information associated with user: `username`, `roles`, `enabled` +** *`from` (Optional, number)*: Starting document offset. +By default, you cannot page through more than 10,000 hits using the from and size parameters. +To page through more hits, use the `search_after` parameter. +** *`sort` (Optional, string | { _score, _doc, _geo_distance, _script } | string | { _score, _doc, _geo_distance, _script }[])*: Fields eligible for sorting are: username, roles, enabled +In addition, sort can also be applied to the `_doc` field to sort by index order. +** *`size` (Optional, number)*: The number of hits to return. +By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. +To page through more hits, use the `search_after` parameter. +** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])*: Search after definition +** *`with_profile_uid` (Optional, boolean)*: If true will return the User Profile ID for the users in the query result, if any. + [discrete] ==== saml_authenticate -Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair +Submits a SAML Response message to Elasticsearch for consumption. {ref}/security-api-saml-authenticate.html[Endpoint documentation] [source,ts] @@ -8398,7 +9211,7 @@ client.security.samlAuthenticate({ content, ids }) [discrete] ==== saml_complete_logout -Verifies the logout response sent from the SAML IdP +Verifies the logout response sent from the SAML IdP. {ref}/security-api-saml-complete-logout.html[Endpoint documentation] [source,ts] @@ -8417,7 +9230,7 @@ client.security.samlCompleteLogout({ realm, ids }) [discrete] ==== saml_invalidate -Consumes a SAML LogoutRequest +Submits a SAML LogoutRequest message to Elasticsearch for consumption. {ref}/security-api-saml-invalidate.html[Endpoint documentation] [source,ts] @@ -8439,7 +9252,7 @@ The client application must not attempt to parse or process the string in any wa [discrete] ==== saml_logout -Invalidates an access token and a refresh token that were generated via the SAML Authenticate API +Submits a request to invalidate an access token and refresh token. {ref}/security-api-saml-logout.html[Endpoint documentation] [source,ts] @@ -8458,7 +9271,7 @@ Alternatively, the most recent refresh token that was received after refreshing [discrete] ==== saml_prepare_authentication -Creates a SAML authentication request +Creates a SAML authentication request () as a URL string, based on the configuration of the respective SAML realm in Elasticsearch. {ref}/security-api-saml-prepare-authentication.html[Endpoint documentation] [source,ts] @@ -8479,7 +9292,7 @@ If the Authentication Request is signed, this value is used as part of the signa [discrete] ==== saml_service_provider_metadata -Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider +Generate SAML metadata for a SAML 2.0 Service Provider. {ref}/security-api-saml-sp-metadata.html[Endpoint documentation] [source,ts] @@ -8493,9 +9306,47 @@ client.security.samlServiceProviderMetadata({ realm_name }) * *Request (object):* ** *`realm_name` (string)*: The name of the SAML realm in Elasticsearch. +[discrete] +==== suggest_user_profiles +Get suggestions for user profiles that match specified search criteria. + +{ref}/security-api-suggest-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.suggestUserProfiles({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (Optional, string)*: Query string used to match name-related fields in user profile documents. +Name-related fields are the user's `username`, `full_name`, and `email`. +** *`size` (Optional, number)*: Number of profiles to return. +** *`data` (Optional, string | string[])*: List of filters for the `data` field of the profile document. +To return all content use `data=*`. To return a subset of content +use `data=` to retrieve content nested under the specified ``. +By default returns no `data` content. +** *`hint` (Optional, { uids, labels })*: Extra search criteria to improve relevance of the suggestion result. +Profiles matching the spcified hint are ranked higher in the response. +Profiles not matching the hint don't exclude the profile from the response +as long as the profile matches the `name` field query. + [discrete] ==== update_api_key Updates attributes of an existing API key. +Users can only update API keys that they created or that were granted to them. +Use this API to update API keys created by the create API Key or grant API Key APIs. +If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead. +It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key. +This API supports updates to an API key’s access scope and metadata. +The access scope of an API key is derived from the `role_descriptors` you specify in the request, and a snapshot of the owner user’s permissions at the time of the request. +The snapshot of the owner’s permissions is updated automatically on every call. +If you don’t specify `role_descriptors` in the request, a call to this API might still change the API key’s access scope. +This change can occur if the owner user’s permissions have changed since the API key was created or last modified. +To update another user’s API key, use the `run_as` feature to submit a request on behalf of another user. +IMPORTANT: It’s not possible to use an API key as the authentication credential for this API. +To update an API key, the owner user’s credentials are required. {ref}/security-api-update-api-key.html[Endpoint documentation] [source,ts] @@ -8508,7 +9359,7 @@ client.security.updateApiKey({ id }) * *Request (object):* ** *`id` (string)*: The ID of the API key to update. -** *`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. +** *`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. ** *`expiration` (Optional, string | -1 | 0)*: Expiration time for the API key. @@ -8534,6 +9385,117 @@ client.security.updateSettings() ---- +[discrete] +==== update_user_profile_data +Updates specific data for the user profile that's associated with the specified unique ID. + +{ref}/security-api-update-user-profile-data.html[Endpoint documentation] +[source,ts] +---- +client.security.updateUserProfileData({ uid }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`uid` (string)*: A unique identifier for the user profile. +** *`labels` (Optional, Record)*: Searchable data that you want to associate with the user profile. This +field supports a nested data structure. +** *`data` (Optional, Record)*: Non-searchable data that you want to associate with the user profile. +This field supports a nested data structure. +** *`if_seq_no` (Optional, number)*: Only perform the operation if the document has this sequence number. +** *`if_primary_term` (Optional, number)*: Only perform the operation if the document has this primary term. +** *`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. + +[discrete] +=== shutdown +[discrete] +==== delete_node +Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +https://www.elastic.co/guide/en/elasticsearch/reference/current[Endpoint documentation] +[source,ts] +---- +client.shutdown.deleteNode({ node_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`node_id` (string)*: The node id of node to be removed from the shutdown state +** *`master_timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: 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, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + +[discrete] +==== get_node +Retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +https://www.elastic.co/guide/en/elasticsearch/reference/current[Endpoint documentation] +[source,ts] +---- +client.shutdown.getNode({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`node_id` (Optional, string | string[])*: Which node for which to retrieve the shutdown status +** *`master_timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: 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, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + +[discrete] +==== put_node +Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +https://www.elastic.co/guide/en/elasticsearch/reference/current[Endpoint documentation] +[source,ts] +---- +client.shutdown.putNode({ node_id, type, reason }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`node_id` (string)*: The node id of node to be shut down +** *`type` (Enum("restart" | "remove" | "replace"))*: Valid values are restart, remove, or replace. +Use restart when you need to temporarily shut down a node to perform an upgrade, make configuration changes, or perform other maintenance. +Because the node is expected to rejoin the cluster, data is not migrated off of the node. +Use remove when you need to permanently remove a node from the cluster. +The node is not marked ready for shutdown until data is migrated off of the node Use replace to do a 1:1 replacement of a node with another node. +Certain allocation decisions will be ignored (such as disk watermarks) in the interest of true replacement of the source node with the target node. +During a replace-type shutdown, rollover and index creation may result in unassigned shards, and shrink may fail until the replacement is complete. +** *`reason` (string)*: A human-readable reason that the node is being shut down. +This field provides information for other cluster operators; it does not affect the shut down process. +** *`allocation_delay` (Optional, string)*: Only valid if type is restart. +Controls how long Elasticsearch will wait for the node to restart and join the cluster before reassigning its shards to other nodes. +This works the same as delaying allocation with the index.unassigned.node_left.delayed_timeout setting. +If you specify both a restart allocation delay and an index-level allocation delay, the longer of the two is used. +** *`target_node_name` (Optional, string)*: Only valid if type is replace. +Specifies the name of the node that is replacing the node being shut down. +Shards from the shut down node are only allowed to be allocated to the target node, and no other data will be allocated to the target node. +During relocation of data certain allocation rules are ignored, such as disk watermarks or user attribute filtering rules. +** *`master_timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: 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, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + +[discrete] +=== simulate +[discrete] +==== ingest +Simulates running ingest with example documents. + +{ref}/simulate-ingest-api.html[Endpoint documentation] +[source,ts] +---- +client.simulate.ingest() +---- + + [discrete] === slm [discrete] @@ -8666,7 +9628,7 @@ client.slm.stop() === snapshot [discrete] ==== cleanup_repository -Removes stale data from repository. +Triggers the review of a snapshot repository’s contents and deletes any stale data not referenced by existing snapshots. {ref}/clean-up-snapshot-repo-api.html[Endpoint documentation] [source,ts] @@ -9003,7 +9965,7 @@ client.sql.query({ ... }) 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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Elasticsearch query DSL for additional filtering. +** *`filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, 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. @@ -9034,7 +9996,7 @@ client.sql.translate({ query }) * *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, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Elasticsearch query DSL for additional filtering. +** *`filter` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Elasticsearch query DSL for additional filtering. ** *`time_zone` (Optional, string)*: ISO-8601 time zone ID for the search. [discrete] @@ -9139,7 +10101,7 @@ client.synonyms.getSynonymsSets({ ... }) [discrete] ==== put_synonym -Creates or updates a synonyms set +Creates or updates a synonym set. {ref}/put-synonyms-set.html[Endpoint documentation] [source,ts] @@ -9215,7 +10177,7 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== list -Returns a list of tasks. +The task management API returns information about tasks currently executing on one or more nodes in the cluster. {ref}/tasks.html[Endpoint documentation] [source,ts] @@ -9238,6 +10200,28 @@ client.tasks.list({ ... }) [discrete] === text_structure +[discrete] +==== find_field_structure +Finds the structure of a text field in an index. + +{ref}/find-field-structure.html[Endpoint documentation] +[source,ts] +---- +client.textStructure.findFieldStructure() +---- + + +[discrete] +==== find_message_structure +Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch. + +{ref}/find-message-structure.html[Endpoint documentation] +[source,ts] +---- +client.textStructure.findMessageStructure() +---- + + [discrete] ==== find_structure Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. @@ -9291,7 +10275,7 @@ client.textStructure.testGrokPattern({ grok_pattern, text }) === transform [discrete] ==== delete_transform -Deletes an existing transform. +Deletes a transform. {ref}/delete-transform.html[Endpoint documentation] [source,ts] @@ -9310,6 +10294,15 @@ deleted regardless of its current state. index will not be deleted ** *`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_node_stats +Retrieves transform usage information for transform nodes. +[source,ts] +---- +client.transform.getNodeStats() +---- + + [discrete] ==== get_transform Retrieves configuration information for transforms. @@ -9376,6 +10369,10 @@ there are no matches or only partial matches. ==== preview_transform Previews a transform. +It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also +generates a list of mappings and settings for the destination index. These values are determined based on the field +types of the source index and the transform aggregations. + {ref}/preview-transform.html[Endpoint documentation] [source,ts] ---- @@ -9409,7 +10406,27 @@ timeout expires, the request fails and returns an error. [discrete] ==== put_transform -Instantiates a transform. +Creates a transform. + +A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as +a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a +unique row per entity. + +You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If +you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in +the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values +in the latest object. + +You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and +`view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the +transform remembers which roles the user that created it had at the time of creation and uses those same roles. If +those roles do not have the required privileges on the source and destination indices, the transform fails when it +attempts unauthorized operations. + +NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any +`.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do +not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not +give users any privileges on `.data-frame-internal*` indices. {ref}/put-transform.html[Endpoint documentation] [source,ts] @@ -9446,7 +10463,9 @@ the exception of privilege checks. [discrete] ==== reset_transform -Resets an existing transform. +Resets a transform. +Before you can reset it, you must stop it; alternatively, use the `force` query parameter. +If the destination index was created by the transform, it is deleted. {ref}/reset-transform.html[Endpoint documentation] [source,ts] @@ -9467,6 +10486,11 @@ must be stopped before it can be reset. ==== schedule_now_transform Schedules now a transform. +If you _schedule_now a transform, it will process the new data instantly, +without waiting for the configured frequency interval. After _schedule_now API is called, +the transform will be processed again at now + frequency unless _schedule_now API +is called again in the meantime. + {ref}/schedule-now-transform.html[Endpoint documentation] [source,ts] ---- @@ -9482,7 +10506,22 @@ client.transform.scheduleNowTransform({ transform_id }) [discrete] ==== start_transform -Starts one or more transforms. +Starts a transform. + +When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is +set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping +definitions for the destination index from the source indices and the transform aggregations. If fields in the +destination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations), +the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce +mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you +start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings +in a pivot transform. + +When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you +created the transform, they occur when you start the transform—​with the exception of privilege checks. When +Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the +time of creation and uses those same roles. If those roles do not have the required privileges on the source and +destination indices, the transform fails when it attempts unauthorized operations. {ref}/start-transform.html[Endpoint documentation] [source,ts] @@ -9535,6 +10574,12 @@ immediately and the indexer is stopped asynchronously in the background. ==== update_transform Updates certain properties of a transform. +All updated properties except `description` do not take effect until after the transform starts the next checkpoint, +thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata` +privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When +Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the +time of update and runs with those privileges. + {ref}/update-transform.html[Endpoint documentation] [source,ts] ---- @@ -9567,6 +10612,11 @@ timeout expires, the request fails and returns an error. [discrete] ==== upgrade_transforms Upgrades all transforms. +This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It +also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not +affect the source and destination indices. The upgrade also does not affect the roles that transforms use when +Elasticsearch security features are enabled; the role used to read source data and write to the destination index +remains unchanged. {ref}/upgrade-transforms.html[Endpoint documentation] [source,ts] @@ -9651,7 +10701,8 @@ client.watcher.deleteWatch({ id }) [discrete] ==== execute_watch -Forces the execution of a stored watch. +This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes. +For testing and debugging purposes, you also have fine-grained control on how the watch runs. You can execute the watch without executing all of its actions or alternatively by simulating them. You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after execution. {ref}/watcher-api-execute-watch.html[Endpoint documentation] [source,ts] @@ -9743,7 +10794,7 @@ client.watcher.queryWatches({ ... }) * *Request (object):* ** *`from` (Optional, number)*: The offset from the first result to fetch. Needs to be non-negative. ** *`size` (Optional, number)*: The number of hits to return. Needs to be non-negative. -** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Optional, query filter watches to be returned. +** *`query` (Optional, { bool, boosting, common, combined_fields, 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, knn, 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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Optional, query filter watches to be returned. ** *`sort` (Optional, string | { _score, _doc, _geo_distance, _script } | string | { _score, _doc, _geo_distance, _script }[])*: Optional sort definition. ** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])*: Optional search After to do pagination using last hit’s sort values. @@ -9801,7 +10852,7 @@ client.watcher.updateSettings() === xpack [discrete] ==== info -Retrieves information about the installed X-Pack features. +Provides general information about the installed X-Pack features. {ref}/info-api.html[Endpoint documentation] [source,ts] @@ -9819,7 +10870,7 @@ client.xpack.info({ ... }) [discrete] ==== usage -Retrieves usage information about the installed X-Pack features. +This API provides information about which features are currently enabled and available under the current license and some usage statistics. {ref}/usage-api.html[Endpoint documentation] [source,ts] diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index e684cebfc..4a8cef916 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,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. + * Deletes an async search by identifier. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege. * @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 @@ -66,11 +67,17 @@ export default class AsyncSearch { const method = 'DELETE' const path = `/_async_search/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'async_search.delete', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves the results of a previously submitted async search request given its ID. + * Retrieves the results of a previously submitted async search request given its identifier. If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it. * @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> @@ -92,11 +99,17 @@ export default class AsyncSearch { const method = 'GET' const path = `/_async_search/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'async_search.get', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves the status of a previously submitted async search request given its ID. + * Get async search status Retrieves the status of a previously submitted async search request given its identifier, without retrieving search results. If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role. * @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 @@ -118,11 +131,17 @@ export default class AsyncSearch { const method = 'GET' const path = `/_async_search/status/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'async_search.status', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Executes a search request asynchronously. + * Runs a search request asynchronously. When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested. Warning: Async search does not support scroll nor search requests that only include the suggest section. By default, Elasticsearch doesn’t allow you to store an async search response larger than 10Mb and an attempt to do this results in an error. The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting. * @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> @@ -170,6 +189,12 @@ export default class AsyncSearch { method = 'POST' path = '/_async_search' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'async_search.submit', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/autoscaling.ts b/src/api/api/autoscaling.ts index 941f81083..04a2ab060 100644 --- a/src/api/api/autoscaling.ts +++ b/src/api/api/autoscaling.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Autoscaling { const method = 'DELETE' const path = `/_autoscaling/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'autoscaling.delete_autoscaling_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -93,7 +100,10 @@ export default class Autoscaling { const method = 'GET' const path = '/_autoscaling/capacity' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'autoscaling.get_autoscaling_capacity' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -119,7 +129,13 @@ export default class Autoscaling { const method = 'GET' const path = `/_autoscaling/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'autoscaling.get_autoscaling_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -150,6 +166,12 @@ export default class Autoscaling { const method = 'PUT' const path = `/_autoscaling/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'autoscaling.put_autoscaling_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/bulk.ts b/src/api/api/bulk.ts index f84ea175f..fe5fb81a7 100644 --- a/src/api/api/bulk.ts +++ b/src/api/api/bulk.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Allows to perform multiple index/update/delete operations in a single request. + * Performs multiple indexing or delete operations in a single API call. This reduces overhead and can greatly increase indexing speed. * @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 @@ -72,5 +73,11 @@ export default async function BulkApi +export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> +export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise +export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_capabilities' + const meta: TransportRequestMetadata = { + name: 'capabilities' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) +} diff --git a/src/api/api/cat.ts b/src/api/api/cat.ts index af8b64da8..8d9a04a55 100644 --- a/src/api/api/cat.ts +++ b/src/api/api/cat.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Cat { } /** - * Shows information about currently configured aliases to indices including filter and routing infos. + * Retrieves the cluster’s index aliases, including filter and routing information. The API does not return data stream aliases. IMPORTANT: cat APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API. * @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 @@ -74,11 +75,17 @@ export default class Cat { method = 'GET' path = '/_cat/aliases' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.aliases', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. + * Provides a snapshot of the number of shards allocated to each data node and their disk space. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html | Elasticsearch API documentation} */ async allocation (this: That, params?: T.CatAllocationRequest | TB.CatAllocationRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -108,11 +115,17 @@ export default class Cat { method = 'GET' path = '/_cat/allocation' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.allocation', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about existing component_templates templates. + * Returns information about component templates in a cluster. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get component template API. * @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 @@ -142,11 +155,17 @@ export default class Cat { method = 'GET' path = '/_cat/component_templates' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.component_templates', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Provides quick access to the document count of the entire cluster, or individual indices. + * Provides quick access to a document count for a data stream, an index, or an entire cluster. NOTE: The document count only includes live documents, not deleted documents which have not yet been removed by the merge process. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the count API. * @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 @@ -176,11 +195,17 @@ export default class Cat { method = 'GET' path = '/_cat/count' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.count', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Shows how much heap memory is currently being used by fielddata on every data node in the cluster. + * Returns the amount of heap memory currently used by the field data cache on every data node in the cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes stats API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html | Elasticsearch API documentation} */ async fielddata (this: That, params?: T.CatFielddataRequest | TB.CatFielddataRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -210,11 +235,17 @@ export default class Cat { method = 'GET' path = '/_cat/fielddata' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.fielddata', + pathParts: { + fields: params.fields + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns a concise representation of the cluster health. + * Returns the health status of a cluster, similar to the cluster health API. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the cluster health API. This API is often used to check malfunctioning clusters. To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats: `HH:MM:SS`, which is human-readable but includes no date information; `Unix epoch time`, which is machine-sortable and includes date information. The latter format is useful for cluster recoveries that take multiple days. You can use the cat health API to verify cluster health across multiple nodes. You also can use the API to track the recovery of a large cluster over a longer period of time. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html | Elasticsearch API documentation} */ async health (this: That, params?: T.CatHealthRequest | TB.CatHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -237,7 +268,10 @@ export default class Cat { const method = 'GET' const path = '/_cat/health' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.health' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -264,11 +298,14 @@ export default class Cat { const method = 'GET' const path = '/_cat' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.help' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about indices: number of primaries and replicas, document counts, disk size, ... + * Returns high-level information about indices in a cluster, including backing indices for data streams. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index API. Use the cat indices API to get the following information for each index in a cluster: shard count; document count; deleted document count; primary store size; total store size of all shards, including shard replicas. These metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents. To get an accurate count of Elasticsearch documents, use the cat count or count APIs. * @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 @@ -298,11 +335,17 @@ export default class Cat { method = 'GET' path = '/_cat/indices' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.indices', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about the master node. + * Returns information about the master node, including the ID, bound IP address, and name. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html | Elasticsearch API documentation} */ async master (this: That, params?: T.CatMasterRequest | TB.CatMasterRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -325,11 +368,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/master' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.master' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Gets configuration and usage information about data frame analytics jobs. + * Returns configuration and usage information about data frame analytics jobs. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get data frame analytics jobs statistics API. * @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 @@ -359,11 +405,17 @@ export default class Cat { method = 'GET' path = '/_cat/ml/data_frame/analytics' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.ml_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Gets configuration and usage information about datafeeds. + * Returns configuration and usage information about datafeeds. This API returns a maximum of 10,000 datafeeds. If the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get datafeed statistics API. * @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 @@ -393,11 +445,17 @@ export default class Cat { method = 'GET' path = '/_cat/ml/datafeeds' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.ml_datafeeds', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Gets configuration and usage information about anomaly detection jobs. + * Returns configuration and usage information for anomaly detection jobs. This API returns a maximum of 10,000 jobs. If the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get anomaly detection job statistics API. * @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 @@ -427,11 +485,17 @@ export default class Cat { method = 'GET' path = '/_cat/ml/anomaly_detectors' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.ml_jobs', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Gets configuration and usage information about inference trained models. + * Returns configuration and usage information about inference trained models. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get trained models statistics API. * @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 @@ -461,11 +525,17 @@ export default class Cat { method = 'GET' path = '/_cat/ml/trained_models' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.ml_trained_models', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about custom node attributes. + * Returns information about custom node attributes. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html | Elasticsearch API documentation} */ async nodeattrs (this: That, params?: T.CatNodeattrsRequest | TB.CatNodeattrsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -488,11 +558,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/nodeattrs' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.nodeattrs' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns basic statistics about performance of cluster nodes. + * Returns information about the nodes in a cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html | Elasticsearch API documentation} */ async nodes (this: That, params?: T.CatNodesRequest | TB.CatNodesRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -515,11 +588,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/nodes' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.nodes' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns a concise representation of the cluster pending tasks. + * Returns cluster-level changes that have not yet been executed. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the pending cluster tasks API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html | Elasticsearch API documentation} */ async pendingTasks (this: That, params?: T.CatPendingTasksRequest | TB.CatPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -542,11 +618,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/pending_tasks' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.pending_tasks' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about installed plugins across nodes node. + * Returns a list of plugins running on each node of a cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html | Elasticsearch API documentation} */ async plugins (this: That, params?: T.CatPluginsRequest | TB.CatPluginsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -569,11 +648,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/plugins' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.plugins' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about index shard recoveries, both on-going completed. + * Returns information about ongoing and completed shard recoveries. Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or syncing a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing. For data streams, the API returns information about the stream’s backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html | Elasticsearch API documentation} */ async recovery (this: That, params?: T.CatRecoveryRequest | TB.CatRecoveryRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -603,11 +685,17 @@ export default class Cat { method = 'GET' path = '/_cat/recovery' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.recovery', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about snapshot repositories registered in the cluster. + * Returns the snapshot repositories for a cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot repository API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html | Elasticsearch API documentation} */ async repositories (this: That, params?: T.CatRepositoriesRequest | TB.CatRepositoriesRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -630,11 +718,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/repositories' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.repositories' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Provides low-level information about the segments in the shards of an index. + * Returns low-level information about the Lucene segments in index shards. For data streams, the API returns information about the backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html | Elasticsearch API documentation} */ async segments (this: That, params?: T.CatSegmentsRequest | TB.CatSegmentsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -664,11 +755,17 @@ export default class Cat { method = 'GET' path = '/_cat/segments' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.segments', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Provides a detailed view of shard allocation on nodes. + * Returns information about the shards in a cluster. For data streams, the API returns information about the backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html | Elasticsearch API documentation} */ async shards (this: That, params?: T.CatShardsRequest | TB.CatShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -698,11 +795,17 @@ export default class Cat { method = 'GET' path = '/_cat/shards' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.shards', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns all snapshots in a specific repository. + * Returns information about the snapshots stored in one or more repositories. A snapshot is a backup of an index or running Elasticsearch cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html | Elasticsearch API documentation} */ async snapshots (this: That, params?: T.CatSnapshotsRequest | TB.CatSnapshotsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -732,11 +835,17 @@ export default class Cat { method = 'GET' path = '/_cat/snapshots' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.snapshots', + pathParts: { + repository: params.repository + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about the tasks currently executing on one or more nodes in the cluster. + * Returns information about tasks currently executing in the cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html | Elasticsearch API documentation} */ async tasks (this: That, params?: T.CatTasksRequest | TB.CatTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -759,11 +868,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/tasks' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.tasks' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about existing templates. + * Returns information about index templates in a cluster. You can use index templates to apply index settings and field mappings to new indices at creation. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index template API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html | Elasticsearch API documentation} */ async templates (this: That, params?: T.CatTemplatesRequest | TB.CatTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -793,11 +905,17 @@ export default class Cat { method = 'GET' path = '/_cat/templates' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.templates', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools. + * Returns thread pool statistics for each node in a cluster. Returned information includes all built-in thread pools and custom thread pools. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html | Elasticsearch API documentation} */ async threadPool (this: That, params?: T.CatThreadPoolRequest | TB.CatThreadPoolRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -827,11 +945,17 @@ export default class Cat { method = 'GET' path = '/_cat/thread_pool' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.thread_pool', + pathParts: { + thread_pool_patterns: params.thread_pool_patterns + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Gets configuration and usage information about transforms. + * Returns configuration and usage information about transforms. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get transform statistics API. * @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 @@ -861,6 +985,12 @@ export default class Cat { method = 'GET' path = '/_cat/transforms' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cat.transforms', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/ccr.ts b/src/api/api/ccr.ts index d2f58a616..ec3db24c8 100644 --- a/src/api/api/ccr.ts +++ b/src/api/api/ccr.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Ccr { const method = 'DELETE' const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.delete_auto_follow_pattern', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -104,7 +111,13 @@ export default class Ccr { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_ccr/follow` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.follow', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -130,7 +143,13 @@ export default class Ccr { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_ccr/info` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.follow_info', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -156,7 +175,13 @@ export default class Ccr { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_ccr/stats` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.follow_stats', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -194,7 +219,13 @@ export default class Ccr { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_ccr/forget_follower` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.forget_follower', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -228,7 +259,13 @@ export default class Ccr { method = 'GET' path = '/_ccr/auto_follow' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.get_auto_follow_pattern', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -254,7 +291,13 @@ export default class Ccr { const method = 'POST' const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}/pause` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.pause_auto_follow_pattern', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -280,7 +323,13 @@ export default class Ccr { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_ccr/pause_follow` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.pause_follow', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -318,7 +367,13 @@ export default class Ccr { const method = 'PUT' const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.put_auto_follow_pattern', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -344,7 +399,13 @@ export default class Ccr { const method = 'POST' const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}/resume` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.resume_auto_follow_pattern', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -382,7 +443,13 @@ export default class Ccr { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_ccr/resume_follow` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.resume_follow', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -409,7 +476,10 @@ export default class Ccr { const method = 'GET' const path = '/_ccr/stats' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.stats' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -435,6 +505,12 @@ export default class Ccr { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_ccr/unfollow` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ccr.unfollow', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/clear_scroll.ts b/src/api/api/clear_scroll.ts index 99eae7286..7c4848d45 100644 --- a/src/api/api/clear_scroll.ts +++ b/src/api/api/clear_scroll.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Explicitly clears the search context for a scroll. + * Clears the search context and results for a scrolling search. * @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 @@ -73,5 +74,11 @@ export default async function ClearScrollApi (this: That, params?: T.ClearScroll const method = 'DELETE' const path = '/_search/scroll' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'clear_scroll', + pathParts: { + scroll_id: params.scroll_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/close_point_in_time.ts b/src/api/api/close_point_in_time.ts index 380689069..c4c779e5e 100644 --- a/src/api/api/close_point_in_time.ts +++ b/src/api/api/close_point_in_time.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Close a point in time + * Closes a point-in-time. * @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 @@ -72,5 +73,8 @@ export default async function ClosePointInTimeApi (this: That, params: T.ClosePo const method = 'DELETE' const path = '/_pit' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'close_point_in_time' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/cluster.ts b/src/api/api/cluster.ts index 1c1b9c8d1..55025b0b0 100644 --- a/src/api/api/cluster.ts +++ b/src/api/api/cluster.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -79,11 +80,14 @@ export default class Cluster { const method = body != null ? 'POST' : 'GET' const path = '/_cluster/allocation/explain' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.allocation_explain' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes a component template + * Deletes component templates. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. * @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 @@ -105,7 +109,13 @@ export default class Cluster { const method = 'DELETE' const path = `/_component_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.delete_component_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -132,7 +142,10 @@ export default class Cluster { const method = 'DELETE' const path = '/_cluster/voting_config_exclusions' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.delete_voting_config_exclusions' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -158,11 +171,17 @@ export default class Cluster { const method = 'HEAD' const path = `/_component_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.exists_component_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns one or more component templates + * Retrieves information about component templates. * @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 @@ -192,11 +211,17 @@ export default class Cluster { method = 'GET' path = '/_component_template' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.get_component_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns cluster settings. + * Returns cluster-wide settings. By default, it returns only settings that have been explicitly defined. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html | Elasticsearch API documentation} */ async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -219,11 +244,14 @@ export default class Cluster { const method = 'GET' const path = '/_cluster/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.get_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns basic information about the health of the cluster. + * The cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the stream’s backing indices. The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html | Elasticsearch API documentation} */ async health (this: That, params?: T.ClusterHealthRequest | TB.ClusterHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -253,7 +281,13 @@ export default class Cluster { method = 'GET' path = '/_cluster/health' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.health', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -279,11 +313,17 @@ export default class Cluster { const method = 'GET' const path = `/_info/${encodeURIComponent(params.target.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.info', + pathParts: { + target: params.target + } + } + return await this.transport.request({ path, method, querystring, body, meta }, 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. + * Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed. NOTE: This API returns a list of any pending updates to the cluster state. These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests. However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html | Elasticsearch API documentation} */ async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -306,7 +346,10 @@ export default class Cluster { const method = 'GET' const path = '/_cluster/pending_tasks' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.pending_tasks' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -333,11 +376,14 @@ export default class Cluster { const method = 'POST' const path = '/_cluster/voting_config_exclusions' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.post_voting_config_exclusions' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates or updates a component template + * Creates or updates a component template. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. An index template can be composed of multiple component templates. To use a component template, specify it in an index template’s `composed_of` list. Component templates are only applied to new data streams and indices as part of a matching index template. Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. Component templates are only used during index creation. For data streams, this includes data stream creation and the creation of a stream’s backing indices. Changes to component templates do not affect existing indices, including a stream’s backing indices. You can use C-style `/* *\/` block comments in component templates. You can include comments anywhere in the request body except before the opening curly bracket. * @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 @@ -371,7 +417,13 @@ export default class Cluster { const method = 'PUT' const path = `/_component_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.put_component_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -410,11 +462,14 @@ export default class Cluster { const method = 'PUT' const path = '/_cluster/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.put_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns the information about configured remote clusters. + * The cluster remote info API allows you to retrieve all of the configured remote cluster information. It returns connection and endpoint information keyed by the configured remote cluster alias. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html | Elasticsearch API documentation} */ async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest | TB.ClusterRemoteInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -437,7 +492,10 @@ export default class Cluster { const method = 'GET' const path = '/_remote/info' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.remote_info' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -476,7 +534,10 @@ export default class Cluster { const method = 'POST' const path = '/_cluster/reroute' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.reroute' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -513,11 +574,18 @@ export default class Cluster { method = 'GET' path = '/_cluster/state' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.state', + pathParts: { + metric: params.metric, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns high-level overview of cluster statistics. + * Returns cluster statistics. It returns basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html | Elasticsearch API documentation} */ async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -547,6 +615,12 @@ export default class Cluster { method = 'GET' path = '/_cluster/stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'cluster.stats', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/count.ts b/src/api/api/count.ts index 0d01dbb57..32e09ad9b 100644 --- a/src/api/api/count.ts +++ b/src/api/api/count.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -80,5 +81,11 @@ export default async function CountApi (this: That, params?: T.CountRequest | TB method = body != null ? 'POST' : 'GET' path = '/_count' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'count', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/create.ts b/src/api/api/create.ts index 622f8eb63..29fedfbc0 100644 --- a/src/api/api/create.ts +++ b/src/api/api/create.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' 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. + * Adds a JSON document to the specified data stream or index and makes it searchable. If the target is an index and the document already exists, the request updates the document and increments its version. * @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 @@ -65,5 +66,12 @@ export default async function CreateApi (this: That, params const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_create/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'create', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/dangling_indices.ts b/src/api/api/dangling_indices.ts index 069734428..e042d801a 100644 --- a/src/api/api/dangling_indices.ts +++ b/src/api/api/dangling_indices.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class DanglingIndices { const method = 'DELETE' const path = `/_dangling/${encodeURIComponent(params.index_uuid.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'dangling_indices.delete_dangling_index', + pathParts: { + index_uuid: params.index_uuid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,13 @@ export default class DanglingIndices { const method = 'POST' const path = `/_dangling/${encodeURIComponent(params.index_uuid.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'dangling_indices.import_dangling_index', + pathParts: { + index_uuid: params.index_uuid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -119,6 +132,9 @@ export default class DanglingIndices { const method = 'GET' const path = '/_dangling' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'dangling_indices.list_dangling_indices' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/delete.ts b/src/api/api/delete.ts index f834f7283..fd9bb85ee 100644 --- a/src/api/api/delete.ts +++ b/src/api/api/delete.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Removes a document from the index. + * Removes a JSON document from the specified index. * @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 @@ -60,5 +61,12 @@ export default async function DeleteApi (this: That, params: T.DeleteRequest | T const method = 'DELETE' const path = `/${encodeURIComponent(params.index.toString())}/_doc/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'delete', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_by_query.ts b/src/api/api/delete_by_query.ts index fc62679cd..d7dc4bd44 100644 --- a/src/api/api/delete_by_query.ts +++ b/src/api/api/delete_by_query.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Deletes documents matching the provided query. + * Deletes documents that match the specified query. * @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 @@ -72,5 +73,11 @@ export default async function DeleteByQueryApi (this: That, params: T.DeleteByQu const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_delete_by_query` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'delete_by_query', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_by_query_rethrottle.ts b/src/api/api/delete_by_query_rethrottle.ts index bb57bea1d..d7847a1ba 100644 --- a/src/api/api/delete_by_query_rethrottle.ts +++ b/src/api/api/delete_by_query_rethrottle.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,11 @@ export default async function DeleteByQueryRethrottleApi (this: That, params: T. const method = 'POST' const path = `/_delete_by_query/${encodeURIComponent(params.task_id.toString())}/_rethrottle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'delete_by_query_rethrottle', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_script.ts b/src/api/api/delete_script.ts index 5c849219f..2f63e01e1 100644 --- a/src/api/api/delete_script.ts +++ b/src/api/api/delete_script.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Deletes a script. + * Deletes a stored script or search template. * @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 @@ -60,5 +61,11 @@ export default async function DeleteScriptApi (this: That, params: T.DeleteScrip const method = 'DELETE' const path = `/_scripts/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'delete_script', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/enrich.ts b/src/api/api/enrich.ts index f2f0f682f..b25c42ede 100644 --- a/src/api/api/enrich.ts +++ b/src/api/api/enrich.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Enrich { const method = 'DELETE' const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.delete_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,11 +99,17 @@ export default class Enrich { const method = 'PUT' const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}/_execute` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.execute_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Gets information about an enrich policy. + * Returns information about an enrich policy. * @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 @@ -126,11 +139,17 @@ export default class Enrich { method = 'GET' path = '/_enrich/policy' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.get_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates a new enrich policy. + * Creates an enrich policy. * @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 @@ -164,11 +183,17 @@ export default class Enrich { const method = 'PUT' const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.put_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Gets enrich coordinator statistics and information about enrich policies that are currently executing. + * Returns enrich coordinator statistics and information about enrich policies that are currently executing. * @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 @@ -191,6 +216,9 @@ export default class Enrich { const method = 'GET' const path = '/_enrich/_stats' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.stats' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/eql.ts b/src/api/api/eql.ts index 3846df925..0e0ddd859 100644 --- a/src/api/api/eql.ts +++ b/src/api/api/eql.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Eql { } /** - * 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. + * Deletes an async EQL search or a stored synchronous EQL search. The API also deletes results for the search. * @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 @@ -66,11 +67,17 @@ export default class Eql { const method = 'DELETE' const path = `/_eql/search/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'eql.delete', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns async results from previously executed Event Query Language (EQL) search + * Returns the current status and available results for an async EQL search or a stored synchronous 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> @@ -92,11 +99,17 @@ export default class Eql { const method = 'GET' const path = `/_eql/search/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'eql.get', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns the status of a previously submitted async or stored Event Query Language (EQL) search + * Returns the current status for an async EQL search or a stored synchronous EQL search without returning results. * @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 @@ -118,7 +131,13 @@ export default class Eql { const method = 'GET' const path = `/_eql/search/status/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'eql.get_status', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -156,6 +175,12 @@ export default class Eql { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_eql/search` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'eql.search', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/esql.ts b/src/api/api/esql.ts index 4d211a14c..da1570d79 100644 --- a/src/api/api/esql.ts +++ b/src/api/api/esql.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,68 @@ export default class Esql { } /** - * Executes an ESQL request + * Executes an ESQL request asynchronously + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html | Elasticsearch API documentation} + */ + async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async asyncQuery (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_query/async' + const meta: TransportRequestMetadata = { + name: 'esql.async_query' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Retrieves the results of a previously submitted async query request given its ID. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html | Elasticsearch API documentation} + */ + async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_query/async/${encodeURIComponent(params.id.toString())}` + const meta: TransportRequestMetadata = { + name: 'esql.async_query_get', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Executes an ES|QL request * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-rest.html | Elasticsearch API documentation} */ async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -52,7 +114,7 @@ export default class Esql { async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] - const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'query'] + const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body @@ -78,6 +140,9 @@ export default class Esql { const method = 'POST' const path = '/_query' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'esql.query' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/exists.ts b/src/api/api/exists.ts index a0448c0aa..4acd561d9 100644 --- a/src/api/api/exists.ts +++ b/src/api/api/exists.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Returns information about whether a document exists in an index. + * Checks if a document in an index exists. * @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 @@ -60,5 +61,12 @@ export default async function ExistsApi (this: That, params: T.ExistsRequest | T const method = 'HEAD' const path = `/${encodeURIComponent(params.index.toString())}/_doc/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'exists', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/exists_source.ts b/src/api/api/exists_source.ts index ba264a376..714e62fa7 100644 --- a/src/api/api/exists_source.ts +++ b/src/api/api/exists_source.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Returns information about whether a document source exists in an index. + * Checks if a document's `_source` is stored. * @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 @@ -60,5 +61,12 @@ export default async function ExistsSourceApi (this: That, params: T.ExistsSourc const method = 'HEAD' const path = `/${encodeURIComponent(params.index.toString())}/_source/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'exists_source', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/explain.ts b/src/api/api/explain.ts index 6e910ffb2..13a744093 100644 --- a/src/api/api/explain.ts +++ b/src/api/api/explain.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document 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> @@ -72,5 +73,12 @@ export default async function ExplainApi (this: That, param 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) + const meta: TransportRequestMetadata = { + name: 'explain', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/features.ts b/src/api/api/features.ts index 5bffb723c..6ec8b7c75 100644 --- a/src/api/api/features.ts +++ b/src/api/api/features.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -67,7 +68,10 @@ export default class Features { const method = 'GET' const path = '/_features' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'features.get_features' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -94,6 +98,9 @@ export default class Features { const method = 'POST' const path = '/_features/_reset' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'features.reset_features' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/field_caps.ts b/src/api/api/field_caps.ts index ec0a5b086..7a2c5bc12 100644 --- a/src/api/api/field_caps.ts +++ b/src/api/api/field_caps.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Returns the information about the capabilities of fields among multiple indices. + * The field capabilities API returns the information about the capabilities of fields among multiple indices. The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type of keyword is returned as any other field that belongs to the `keyword` family. * @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 @@ -80,5 +81,11 @@ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequ method = body != null ? 'POST' : 'GET' path = '/_field_caps' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'field_caps', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/fleet.ts b/src/api/api/fleet.ts index 965a926bb..4fe0b0ed8 100644 --- a/src/api/api/fleet.ts +++ b/src/api/api/fleet.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -65,7 +66,13 @@ export default class Fleet { const method = 'DELETE' const path = `/_fleet/secret/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.delete_secret', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -90,7 +97,13 @@ export default class Fleet { const method = 'GET' const path = `/_fleet/secret/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.get_secret', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -116,11 +129,17 @@ export default class Fleet { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_fleet/global_checkpoints` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.global_checkpoints', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. + * Executes several [fleet searches](https://www.elastic.co/guide/en/elasticsearch/reference/current/fleet-search.html) with a single API request. The API follows the same structure as the [multi search](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html) API. However, similar to the fleet search API, it supports the wait_for_checkpoints parameter. */ async msearch (this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> async msearch (this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> @@ -153,7 +172,13 @@ export default class Fleet { method = body != null ? 'POST' : 'GET' path = '/_fleet/_fleet_msearch' } - return await this.transport.request({ path, method, querystring, bulkBody: body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.msearch', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } /** @@ -178,11 +203,14 @@ export default class Fleet { const method = 'POST' const path = '/_fleet/secret' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.post_secret' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. + * The purpose of the fleet search api is to provide a search api where the search will only be executed after provided checkpoint has been processed and is visible for searches inside of Elasticsearch. */ async search (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> async search (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> @@ -215,6 +243,12 @@ export default class Fleet { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_fleet/_fleet_search` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.search', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/get.ts b/src/api/api/get.ts index 96f31255e..0d742a15f 100644 --- a/src/api/api/get.ts +++ b/src/api/api/get.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,12 @@ export default async function GetApi (this: That, params: T const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_doc/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script.ts b/src/api/api/get_script.ts index b2c4a03d1..f0c396efb 100644 --- a/src/api/api/get_script.ts +++ b/src/api/api/get_script.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Returns a script. + * Retrieves a stored script or search template. * @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 @@ -60,5 +61,11 @@ export default async function GetScriptApi (this: That, params: T.GetScriptReque const method = 'GET' const path = `/_scripts/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get_script', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script_context.ts b/src/api/api/get_script_context.ts index 78ceed3b3..f242c6870 100644 --- a/src/api/api/get_script_context.ts +++ b/src/api/api/get_script_context.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -61,5 +62,8 @@ export default async function GetScriptContextApi (this: That, params?: T.GetScr const method = 'GET' const path = '/_script_context' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get_script_context' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script_languages.ts b/src/api/api/get_script_languages.ts index 600baac46..1487bedf3 100644 --- a/src/api/api/get_script_languages.ts +++ b/src/api/api/get_script_languages.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -61,5 +62,8 @@ export default async function GetScriptLanguagesApi (this: That, params?: T.GetS const method = 'GET' const path = '/_script_language' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get_script_languages' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_source.ts b/src/api/api/get_source.ts index 7f92d9b74..517452614 100644 --- a/src/api/api/get_source.ts +++ b/src/api/api/get_source.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,12 @@ export default async function GetSourceApi (this: That, par const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_source/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get_source', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/graph.ts b/src/api/api/graph.ts index 666a40940..01d14aa5d 100644 --- a/src/api/api/graph.ts +++ b/src/api/api/graph.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Graph { } /** - * Explore extracted and summarized information about the documents and terms in an index. + * Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index. * @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 @@ -78,6 +79,12 @@ export default class Graph { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_graph/explore` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'graph.explore', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/health_report.ts b/src/api/api/health_report.ts index 4ad9a19c3..58e098339 100644 --- a/src/api/api/health_report.ts +++ b/src/api/api/health_report.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -68,5 +69,11 @@ export default async function HealthReportApi (this: That, params?: T.HealthRepo method = 'GET' path = '/_health_report' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'health_report', + pathParts: { + feature: params.feature + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ilm.ts b/src/api/api/ilm.ts index 23de35220..48c35c9fb 100644 --- a/src/api/api/ilm.ts +++ b/src/api/api/ilm.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Ilm { } /** - * Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + * Deletes the specified lifecycle policy definition. You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-delete-lifecycle.html | Elasticsearch API documentation} */ async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest | TB.IlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -66,11 +67,17 @@ export default class Ilm { const method = 'DELETE' const path = `/_ilm/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.delete_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. + * Retrieves information about the index’s current lifecycle state, such as the currently executing phase, action, and step. Shows when the index entered each one, the definition of the running phase, and information about any failures. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-explain-lifecycle.html | Elasticsearch API documentation} */ async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest | TB.IlmExplainLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -92,11 +99,17 @@ export default class Ilm { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_ilm/explain` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.explain_lifecycle', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns the specified policy definition. Includes the policy version and last modified date. + * Retrieves a lifecycle policy. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-get-lifecycle.html | Elasticsearch API documentation} */ async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest | TB.IlmGetLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -126,7 +139,13 @@ export default class Ilm { method = 'GET' path = '/_ilm/policy' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.get_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -153,11 +172,14 @@ export default class Ilm { const method = 'GET' const path = '/_ilm/status' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.get_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + * Switches the indices, ILM policies, and legacy, composable and component templates from using custom node attributes and attribute-based allocation filters to using data tiers, and optionally deletes one legacy index template.+ Using node roles enables ILM to automatically move the indices between data tiers. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-migrate-to-data-tiers.html | Elasticsearch API documentation} */ async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest | TB.IlmMigrateToDataTiersRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -192,7 +214,10 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/migrate_to_data_tiers' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.migrate_to_data_tiers' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -230,11 +255,17 @@ export default class Ilm { const method = 'POST' const path = `/_ilm/move/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.move_to_step', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates a lifecycle policy + * Creates a lifecycle policy. If the specified policy exists, the policy is replaced and the policy version is incremented. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-put-lifecycle.html | Elasticsearch API documentation} */ async putLifecycle (this: That, params: T.IlmPutLifecycleRequest | TB.IlmPutLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -268,7 +299,13 @@ export default class Ilm { const method = 'PUT' const path = `/_ilm/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.put_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -294,7 +331,13 @@ export default class Ilm { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_ilm/remove` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.remove_policy', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -320,7 +363,13 @@ export default class Ilm { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_ilm/retry` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.retry', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -347,7 +396,10 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/start' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.start' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -374,6 +426,9 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/stop' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.stop' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/index.ts b/src/api/api/index.ts index b156d47c6..35508c4f9 100644 --- a/src/api/api/index.ts +++ b/src/api/api/index.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Creates or updates a document in an index. + * Adds a JSON document to the specified data stream or index and makes it searchable. If the target is an index and the document already exists, the request updates the document and increments its version. * @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 @@ -72,5 +73,12 @@ export default async function IndexApi (this: That, params: method = 'POST' path = `/${encodeURIComponent(params.index.toString())}/_doc` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'index', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index 3b90bc00f..7fad7c65c 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,11 +67,18 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_block/${encodeURIComponent(params.block.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.add_block', + pathParts: { + index: params.index, + block: params.block + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Performs the analysis process on a text and return the tokens breakdown of the text. + * Performs analysis on a text string and returns the resulting tokens. * @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 @@ -112,11 +120,17 @@ export default class Indices { method = body != null ? 'POST' : 'GET' path = '/_analyze' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.analyze', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Clears all or specific caches for one or more indices. + * Clears the caches of one or more indices. For data streams, the API clears the caches of the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html | Elasticsearch API documentation} */ async clearCache (this: That, params?: T.IndicesClearCacheRequest | TB.IndicesClearCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -146,11 +160,17 @@ export default class Indices { method = 'POST' path = '/_cache/clear' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.clear_cache', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Clones an index + * Clones an existing index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html | Elasticsearch API documentation} */ async clone (this: That, params: T.IndicesCloneRequest | TB.IndicesCloneRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -184,7 +204,14 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_clone/${encodeURIComponent(params.target.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.clone', + pathParts: { + index: params.index, + target: params.target + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -210,11 +237,17 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_close` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.close', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates an index with optional settings and mappings. + * Creates a new index. * @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 @@ -248,11 +281,17 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.create', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates a data stream + * Create a data stream. Creates a data stream. You must have a matching index template with data stream enabled. * @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 @@ -274,11 +313,17 @@ export default class Indices { const method = 'PUT' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.create_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Provides statistics on operations happening in a data stream. + * Get data stream stats. Retrieves statistics for one or more data streams. * @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 @@ -308,11 +353,17 @@ export default class Indices { method = 'GET' path = '/_data_stream/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.data_streams_stats', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes an index. + * Deletes one or more indices. * @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 @@ -334,11 +385,17 @@ export default class Indices { const method = 'DELETE' const path = `/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes an alias. + * Removes a data stream or index from an alias. * @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 @@ -367,11 +424,18 @@ export default class Indices { method = 'DELETE' path = `/${encodeURIComponent(params.index.toString())}/_aliases/${encodeURIComponent(params.name.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_alias', + pathParts: { + index: params.index, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes the data stream lifecycle of the selected data streams. + * Delete data stream lifecycles. Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle. * @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 @@ -393,11 +457,17 @@ export default class Indices { const method = 'DELETE' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_data_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes a data stream. + * Delete data streams. Deletes one or more data streams and their backing indices. * @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 @@ -419,11 +489,17 @@ export default class Indices { const method = 'DELETE' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes an index template. + * Delete an index template. The provided may contain multiple template names separated by a comma. If multiple template names are specified then there is no wildcard support and the provided names should match completely with existing templates. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template.html | Elasticsearch API documentation} */ async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest | TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -445,11 +521,17 @@ export default class Indices { const method = 'DELETE' const path = `/_index_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes an index template. + * Deletes a legacy index template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template-v1.html | Elasticsearch API documentation} */ async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -471,11 +553,17 @@ export default class Indices { const method = 'DELETE' const path = `/_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Analyzes the disk usage of each field of an index or data stream + * Analyzes the disk usage of each field of an index or data stream. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-disk-usage.html | Elasticsearch API documentation} */ async diskUsage (this: That, params: T.IndicesDiskUsageRequest | TB.IndicesDiskUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -497,11 +585,17 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_disk_usage` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.disk_usage', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Downsample an index + * Aggregates a time series (TSDS) index and stores pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-downsample-data-stream.html | Elasticsearch API documentation} */ async downsample (this: That, params: T.IndicesDownsampleRequest | TB.IndicesDownsampleRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -528,11 +622,18 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_downsample/${encodeURIComponent(params.target_index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.downsample', + pathParts: { + index: params.index, + target_index: params.target_index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about whether a particular index exists. + * Checks if a data stream, index, or alias exists. * @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 @@ -554,11 +655,17 @@ export default class Indices { const method = 'HEAD' const path = `/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.exists', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about whether a particular alias exists. + * Checks if an alias exists. * @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 @@ -587,7 +694,14 @@ export default class Indices { method = 'HEAD' path = `/_alias/${encodeURIComponent(params.name.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.exists_alias', + pathParts: { + name: params.name, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -613,11 +727,17 @@ export default class Indices { const method = 'HEAD' const path = `/_index_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.exists_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about whether a particular index template exists. + * Check existence of index templates. Returns information about whether a particular index template exists. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-template-exists-v1.html | Elasticsearch API documentation} */ async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -639,7 +759,13 @@ export default class Indices { const method = 'HEAD' const path = `/_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.exists_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -665,11 +791,17 @@ export default class Indices { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_lifecycle/explain` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.explain_data_lifecycle', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns the field usage stats for each field of an index + * Returns field usage information for each shard and field of an index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/field-usage-stats.html | Elasticsearch API documentation} */ async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -691,11 +823,17 @@ export default class Indices { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_field_usage_stats` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.field_usage_stats', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Performs the flush operation on one or more indices. + * Flushes one or more data streams or indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html | Elasticsearch API documentation} */ async flush (this: That, params?: T.IndicesFlushRequest | TB.IndicesFlushRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -725,7 +863,13 @@ export default class Indices { method = body != null ? 'POST' : 'GET' path = '/_flush' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.flush', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -759,11 +903,17 @@ export default class Indices { method = 'POST' path = '/_forcemerge' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.forcemerge', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about one or more indices. + * Returns information about one or more indices. For data streams, the API returns information about the stream’s backing indices. * @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 @@ -785,11 +935,17 @@ export default class Indices { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns an alias. + * Retrieves information for one or more aliases. * @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 @@ -825,11 +981,18 @@ export default class Indices { method = 'GET' path = '/_alias' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_alias', + pathParts: { + name: params.name, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns the data stream lifecycle of the selected data streams. + * Get data stream lifecycles. Retrieves the data stream lifecycle configuration of one or more 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 @@ -851,11 +1014,17 @@ export default class Indices { const method = 'GET' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_data_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns data streams. + * Get data streams. Retrieves information about one or more data streams. * @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 @@ -885,11 +1054,17 @@ export default class Indices { method = 'GET' path = '/_data_stream' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns mapping for one or more fields. + * Retrieves mapping definitions for one or more fields. For data streams, the API retrieves field mappings for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html | Elasticsearch API documentation} */ async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest | TB.IndicesGetFieldMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -918,11 +1093,18 @@ export default class Indices { method = 'GET' path = `/_mapping/field/${encodeURIComponent(params.fields.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_field_mapping', + pathParts: { + fields: params.fields, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns an index template. + * Get index templates. Returns information about one or more index templates. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template.html | Elasticsearch API documentation} */ async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest | TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -952,11 +1134,17 @@ export default class Indices { method = 'GET' path = '/_index_template' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns mappings for one or more indices. + * Retrieves mapping definitions for one or more indices. For data streams, the API retrieves mappings for the stream’s backing indices. * @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 @@ -986,11 +1174,17 @@ export default class Indices { method = 'GET' path = '/_mapping' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_mapping', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns settings for one or more indices. + * Returns setting information for one or more indices. For data streams, returns setting information for the stream’s backing indices. * @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 @@ -1026,11 +1220,18 @@ export default class Indices { method = 'GET' path = '/_settings' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_settings', + pathParts: { + index: params.index, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns an index template. + * Get index templates. Retrieves information about one or more index templates. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template-v1.html | Elasticsearch API documentation} */ async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1060,11 +1261,17 @@ export default class Indices { method = 'GET' path = '/_template' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Migrates an alias to a data stream + * Convert an index alias to a data stream. Converts an index alias to a data stream. You must have a matching index template that is data stream enabled. The alias must meet the following criteria: The alias must have a write index; All indices for the alias must have a `@timestamp` field mapping of a `date` or `date_nanos` field type; The alias must not have any filters; The alias must not use custom routing. If successful, the request removes the alias and creates a data stream with the same name. The indices for the alias become hidden backing indices for the stream. The write index for the alias becomes the write index for the stream. * @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 @@ -1086,11 +1293,17 @@ export default class Indices { const method = 'POST' const path = `/_data_stream/_migrate/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.migrate_to_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Modifies a data stream + * Update data streams. Performs one or more data stream modification actions in a single atomic operation. * @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 @@ -1124,11 +1337,14 @@ export default class Indices { const method = 'POST' const path = '/_data_stream/_modify' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.modify_data_stream' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Opens an index. + * Opens a closed index. For data streams, the API opens any closed backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html | Elasticsearch API documentation} */ async open (this: That, params: T.IndicesOpenRequest | TB.IndicesOpenRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1150,7 +1366,13 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_open` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.open', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1176,11 +1398,17 @@ export default class Indices { const method = 'POST' const path = `/_data_stream/_promote/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.promote_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates or updates an alias. + * Adds a data stream or index to an alias. * @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 @@ -1221,11 +1449,18 @@ export default class Indices { method = 'PUT' path = `/${encodeURIComponent(params.index.toString())}/_aliases/${encodeURIComponent(params.name.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_alias', + pathParts: { + index: params.index, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates the data stream lifecycle of the selected data streams. + * Update data stream lifecycles. Update the data stream lifecycle of the specified 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 @@ -1259,11 +1494,17 @@ export default class Indices { const method = 'PUT' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_data_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates or updates an index template. + * Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html | Elasticsearch API documentation} */ async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1297,11 +1538,17 @@ export default class Indices { const method = 'PUT' const path = `/_index_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates the index mappings. + * Adds new fields to an existing data stream or index. You can also use this API to change the search settings of existing fields. For data streams, these changes are applied to all backing indices by default. * @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 @@ -1335,11 +1582,17 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_mapping` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_mapping', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates the index settings. + * Changes a dynamic index setting in real time. For data streams, index setting changes are applied to all backing indices by default. * @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 @@ -1373,11 +1626,17 @@ export default class Indices { method = 'PUT' path = '/_settings' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_settings', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates or updates an index template. + * Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates-v1.html | Elasticsearch API documentation} */ async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1411,11 +1670,17 @@ export default class Indices { const method = 'PUT' const path = `/_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about ongoing index shard recoveries. + * Returns information about ongoing and completed shard recoveries for one or more indices. For data streams, the API returns information for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html | Elasticsearch API documentation} */ async recovery (this: That, params?: T.IndicesRecoveryRequest | TB.IndicesRecoveryRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1445,11 +1710,17 @@ export default class Indices { method = 'GET' path = '/_recovery' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.recovery', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Performs the refresh operation in one or more indices. + * A refresh makes recent operations performed on one or more indices available for search. For data streams, the API runs the refresh operation on the stream’s backing 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 @@ -1479,7 +1750,13 @@ export default class Indices { method = body != null ? 'POST' : 'GET' path = '/_refresh' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.refresh', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1505,11 +1782,17 @@ export default class Indices { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_reload_search_analyzers` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.reload_search_analyzers', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. + * Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. Multiple patterns and remote clusters are supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-cluster-api.html | Elasticsearch API documentation} */ async resolveCluster (this: That, params: T.IndicesResolveClusterRequest | TB.IndicesResolveClusterRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1531,11 +1814,17 @@ export default class Indices { const method = 'GET' const path = `/_resolve/cluster/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.resolve_cluster', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about any matching indices, aliases, and data streams + * Resolves the specified name(s) and/or index patterns for indices, aliases, and data streams. Multiple patterns and remote clusters are supported. * @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 @@ -1557,11 +1846,17 @@ export default class Indices { const method = 'GET' const path = `/_resolve/index/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.resolve_index', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates an alias to point to a new index when the existing index is considered to be too large or too old. + * Creates a new index for a data stream or index alias. * @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 @@ -1602,11 +1897,18 @@ export default class Indices { method = 'POST' path = `/${encodeURIComponent(params.alias.toString())}/_rollover` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.rollover', + pathParts: { + alias: params.alias, + new_index: params.new_index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Provides low-level information about segments in a Lucene index. + * Returns low-level information about the Lucene segments in index shards. For data streams, the API returns information about the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html | Elasticsearch API documentation} */ async segments (this: That, params?: T.IndicesSegmentsRequest | TB.IndicesSegmentsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1636,11 +1938,17 @@ export default class Indices { method = 'GET' path = '/_segments' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.segments', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Provides store information for shard copies of indices. + * Retrieves store information about replica shards in one or more indices. For data streams, the API retrieves store information for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html | Elasticsearch API documentation} */ async shardStores (this: That, params?: T.IndicesShardStoresRequest | TB.IndicesShardStoresRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1670,11 +1978,17 @@ export default class Indices { method = 'GET' path = '/_shard_stores' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.shard_stores', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Allow to shrink an existing index into a new index with fewer primary shards. + * Shrinks an existing index into a new index with fewer primary shards. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html | Elasticsearch API documentation} */ async shrink (this: That, params: T.IndicesShrinkRequest | TB.IndicesShrinkRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1708,11 +2022,18 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_shrink/${encodeURIComponent(params.target.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.shrink', + pathParts: { + index: params.index, + target: params.target + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Simulate matching the given index name against the index templates in the system + * Simulate an index. Returns the index configuration that would be applied to the specified index from an existing index template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-index.html | Elasticsearch API documentation} */ async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1734,11 +2055,17 @@ export default class Indices { const method = 'POST' const path = `/_index_template/_simulate_index/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.simulate_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Simulate resolving the given template name or body + * Simulate an index template. Returns the index configuration that would be applied by a particular index template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-template.html | Elasticsearch API documentation} */ async simulateTemplate (this: That, params?: T.IndicesSimulateTemplateRequest | TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1780,11 +2107,17 @@ export default class Indices { method = 'POST' path = '/_index_template/_simulate' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.simulate_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Allows you to split an existing index into a new index with more primary shards. + * Splits an existing index into a new index with more primary shards. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html | Elasticsearch API documentation} */ async split (this: That, params: T.IndicesSplitRequest | TB.IndicesSplitRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1818,11 +2151,18 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_split/${encodeURIComponent(params.target.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.split', + pathParts: { + index: params.index, + target: params.target + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Provides statistics on operations happening in an index. + * Returns statistics for one or more indices. For data streams, the API retrieves statistics for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html | Elasticsearch API documentation} */ async stats (this: That, params?: T.IndicesStatsRequest | TB.IndicesStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1858,11 +2198,18 @@ export default class Indices { method = 'GET' path = '/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.stats', + pathParts: { + metric: params.metric, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. + * Unfreezes an index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/unfreeze-index-api.html | Elasticsearch API documentation} */ async unfreeze (this: That, params: T.IndicesUnfreezeRequest | TB.IndicesUnfreezeRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1884,11 +2231,17 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_unfreeze` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.unfreeze', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates index aliases. + * Adds a data stream or index to an alias. * @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 @@ -1923,11 +2276,14 @@ export default class Indices { const method = 'POST' const path = '/_aliases' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.update_aliases' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Allows a user to validate a potentially expensive query without executing it. + * Validates a potentially expensive query without executing it. * @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 @@ -1969,6 +2325,12 @@ export default class Indices { method = body != null ? 'POST' : 'GET' path = '/_validate/query' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.validate_query', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/inference.ts b/src/api/api/inference.ts index 16dc527a1..ad69cb84a 100644 --- a/src/api/api/inference.ts +++ b/src/api/api/inference.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -73,7 +74,14 @@ export default class Inference { method = 'DELETE' path = `/_inference/${encodeURIComponent(params.inference_id.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'inference.delete', + pathParts: { + task_type: params.task_type, + inference_id: params.inference_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -110,11 +118,18 @@ export default class Inference { method = 'GET' path = '/_inference' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'inference.get', + pathParts: { + task_type: params.task_type, + inference_id: params.inference_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Perform inference + * Perform inference on the service * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html | Elasticsearch API documentation} */ async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -155,11 +170,18 @@ export default class Inference { method = 'POST' path = `/_inference/${encodeURIComponent(params.inference_id.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'inference.inference', + pathParts: { + task_type: params.task_type, + inference_id: params.inference_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Configure an inference endpoint for use in the Inference API + * Create an inference endpoint * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html | Elasticsearch API documentation} */ async put (this: That, params: T.InferencePutRequest | TB.InferencePutRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -193,6 +215,13 @@ export default class Inference { method = 'PUT' path = `/_inference/${encodeURIComponent(params.inference_id.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'inference.put', + pathParts: { + task_type: params.task_type, + inference_id: params.inference_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/info.ts b/src/api/api/info.ts index 3eca9959e..a6ac8226d 100644 --- a/src/api/api/info.ts +++ b/src/api/api/info.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -61,5 +62,8 @@ export default async function InfoApi (this: That, params?: T.InfoRequest | TB.I const method = 'GET' const path = '/' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'info' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ingest.ts b/src/api/api/ingest.ts index 2a877cc79..b332c6279 100644 --- a/src/api/api/ingest.ts +++ b/src/api/api/ingest.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,39 @@ export default class Ingest { } /** - * Deletes a pipeline. + * Deletes a geoip database configuration + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html | Elasticsearch API documentation} + */ + async deleteGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async deleteGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async deleteGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_ingest/geoip/database/${encodeURIComponent(params.id.toString())}` + const meta: TransportRequestMetadata = { + name: 'ingest.delete_geoip_database', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Deletes one or more existing ingest pipeline. * @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 @@ -66,11 +99,17 @@ export default class Ingest { const method = 'DELETE' const path = `/_ingest/pipeline/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.delete_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns statistical information about geoip databases + * Gets download statistics for GeoIP2 databases used with the geoip processor. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-processor.html | Elasticsearch API documentation} */ async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest | TB.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -93,11 +132,53 @@ export default class Ingest { const method = 'GET' const path = '/_ingest/geoip/stats' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.geo_ip_stats' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns a pipeline. + * Returns geoip database configuration. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html | Elasticsearch API documentation} + */ + async getGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async getGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async getGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async getGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + let method = '' + let path = '' + if (params.id != null) { + method = 'GET' + path = `/_ingest/geoip/database/${encodeURIComponent(params.id.toString())}` + } else { + method = 'GET' + path = '/_ingest/geoip/database' + } + const meta: TransportRequestMetadata = { + name: 'ingest.get_geoip_database', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Returns information about one or more ingest pipelines. This API returns a local reference of the pipeline. * @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 @@ -127,11 +208,17 @@ export default class Ingest { method = 'GET' path = '/_ingest/pipeline' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.get_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns a list of the built-in patterns. + * Extracts structured fields out of a single text field within a document. You choose which field to extract matched fields from, as well as the grok pattern you expect will match. A grok pattern is like a regular expression that supports aliased expressions that can be reused. * @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 @@ -154,11 +241,46 @@ export default class Ingest { const method = 'GET' const path = '/_ingest/processor/grok' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.processor_grok' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates or updates a pipeline. + * Puts the configuration for a geoip database to be downloaded + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html | Elasticsearch API documentation} + */ + async putGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async putGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async putGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async putGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_ingest/geoip/database/${encodeURIComponent(params.id.toString())}` + const meta: TransportRequestMetadata = { + name: 'ingest.put_geoip_database', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Creates or updates an ingest pipeline. Changes made using this API take effect immediately. * @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 @@ -192,11 +314,17 @@ export default class Ingest { const method = 'PUT' const path = `/_ingest/pipeline/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.put_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Allows to simulate a pipeline with example documents. + * Executes an ingest pipeline against a set of provided documents. * @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 @@ -238,6 +366,12 @@ export default class Ingest { method = body != null ? 'POST' : 'GET' path = '/_ingest/pipeline/_simulate' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.simulate', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/knn_search.ts b/src/api/api/knn_search.ts index 460826e43..fe30ca47a 100644 --- a/src/api/api/knn_search.ts +++ b/src/api/api/knn_search.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function KnnSearchApi (this: That, par const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_knn_search` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'knn_search', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/license.ts b/src/api/api/license.ts index f1301d25f..9952f9f29 100644 --- a/src/api/api/license.ts +++ b/src/api/api/license.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -67,11 +68,14 @@ export default class License { const method = 'DELETE' const path = '/_license' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.delete' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves licensing information for the cluster + * This API returns information about the type of license, when it was issued, and when it expires, for example. For more information about the different types of licenses, see https://www.elastic.co/subscriptions. * @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 @@ -94,7 +98,10 @@ export default class License { const method = 'GET' const path = '/_license' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.get' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -121,7 +128,10 @@ export default class License { const method = 'GET' const path = '/_license/basic_status' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.get_basic_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -148,7 +158,10 @@ export default class License { const method = 'GET' const path = '/_license/trial_status' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.get_trial_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -187,11 +200,14 @@ export default class License { const method = 'PUT' const path = '/_license' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.post' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Starts an indefinite basic license. + * The start basic API enables you to initiate an indefinite basic license, which gives access to all the basic features. If the basic license does not support all of the features that are available with your current license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true. To check the status of your basic license, use the following API: [Get basic status](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-basic-status.html). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html | Elasticsearch API documentation} */ async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest | TB.LicensePostStartBasicRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -214,11 +230,14 @@ export default class License { const method = 'POST' const path = '/_license/start_basic' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.post_start_basic' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * starts a limited time trial license. + * The start trial API enables you to start a 30-day trial, which gives access to all subscription features. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html | Elasticsearch API documentation} */ async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest | TB.LicensePostStartTrialRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -241,6 +260,9 @@ export default class License { const method = 'POST' const path = '/_license/start_trial' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.post_start_trial' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/logstash.ts b/src/api/api/logstash.ts index 9367e308a..f92f8c5c3 100644 --- a/src/api/api/logstash.ts +++ b/src/api/api/logstash.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Logstash { } /** - * Deletes Logstash Pipelines used by Central Management + * Deletes a pipeline used for Logstash Central Management. * @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 @@ -66,11 +67,17 @@ export default class Logstash { const method = 'DELETE' const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'logstash.delete_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves Logstash Pipelines used by Central Management + * Retrieves pipelines used for Logstash Central Management. * @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 @@ -100,11 +107,17 @@ export default class Logstash { method = 'GET' path = '/_logstash/pipeline' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'logstash.get_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Adds and updates Logstash Pipelines used for Central Management + * Creates or updates a pipeline used for Logstash Central Management. * @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 @@ -131,6 +144,12 @@ export default class Logstash { const method = 'PUT' const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'logstash.put_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/mget.ts b/src/api/api/mget.ts index bf6717a24..75ffcaef0 100644 --- a/src/api/api/mget.ts +++ b/src/api/api/mget.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -80,5 +81,11 @@ export default async function MgetApi (this: That, params?: method = body != null ? 'POST' : 'GET' path = '/_mget' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'mget', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/migration.ts b/src/api/api/migration.ts index 52b361a5a..48bb46c23 100644 --- a/src/api/api/migration.ts +++ b/src/api/api/migration.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -74,7 +75,13 @@ export default class Migration { method = 'GET' path = '/_migration/deprecations' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'migration.deprecations', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -101,7 +108,10 @@ export default class Migration { const method = 'GET' const path = '/_migration/system_features' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'migration.get_feature_upgrade_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -128,6 +138,9 @@ export default class Migration { const method = 'POST' const path = '/_migration/system_features' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'migration.post_feature_upgrade' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index 2646643a9..e0805125a 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Ml { } /** - * Clear the cached results from a trained model deployment + * Clears a trained model deployment cache on all nodes where the trained model is assigned. A trained model deployment may have an inference cache enabled. As requests are handled by each allocated node, their responses may be cached on that individual node. Calling this API clears the caches without restarting the deployment. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-trained-model-deployment-cache.html | Elasticsearch API documentation} */ async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -66,11 +67,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/cache/_clear` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.clear_trained_model_deployment_cache', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + * Close anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results. When you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data. If you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request. When a datafeed that has a specified end date stops, it automatically closes its associated job. * @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 @@ -104,11 +111,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_close` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.close_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes a calendar. + * Removes all scheduled events from a calendar, then deletes it. * @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 @@ -130,7 +143,13 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_calendar', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -156,7 +175,14 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/events/${encodeURIComponent(params.event_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_calendar_event', + pathParts: { + calendar_id: params.calendar_id, + event_id: params.event_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -182,11 +208,18 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/jobs/${encodeURIComponent(params.job_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_calendar_job', + pathParts: { + calendar_id: params.calendar_id, + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes an existing data frame analytics job. + * Deletes a data frame analytics job. * @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 @@ -208,7 +241,13 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -234,11 +273,17 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes expired and unused machine learning data. + * Deletes expired and unused machine learning data. Deletes all job results, model snapshots and forecast data that have exceeded their retention days period. Machine learning state documents that are not associated with any job are also deleted. You can limit the request to a single or set of anomaly detection jobs by using a job identifier, a group name, a comma-separated list of jobs, or a wildcard expression. You can delete expired data for all anomaly detection jobs by using _all, by specifying * as the , or by omitting the . * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-expired-data.html | Elasticsearch API documentation} */ async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest | TB.MlDeleteExpiredDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -280,11 +325,17 @@ export default class Ml { method = 'DELETE' path = '/_ml/_delete_expired_data' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_expired_data', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes a filter. + * Deletes a filter. If an anomaly detection job references the filter, you cannot delete the filter. You must update or delete the job before you can delete the filter. * @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 @@ -306,11 +357,17 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/filters/${encodeURIComponent(params.filter_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_filter', + pathParts: { + filter_id: params.filter_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes forecasts from a machine learning job. + * Deletes forecasts from a machine learning job. By default, forecasts are retained for 14 days. You can specify a different retention period with the `expires_in` parameter in the forecast jobs API. The delete forecast API enables you to delete one or more forecasts before they expire. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-forecast.html | Elasticsearch API documentation} */ async deleteForecast (this: That, params: T.MlDeleteForecastRequest | TB.MlDeleteForecastRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -339,11 +396,18 @@ export default class Ml { method = 'DELETE' path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_forecast` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_forecast', + pathParts: { + job_id: params.job_id, + forecast_id: params.forecast_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes an existing anomaly detection job. + * Delete an anomaly detection job. All job configuration, model state and results are deleted. It is not currently possible to delete multiple jobs using wildcards or a comma separated list. If you delete a job that has a datafeed, the request first tries to delete the datafeed. This behavior is equivalent to calling the delete datafeed API with the same timeout and force parameters as the delete job request. * @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 @@ -365,11 +429,17 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes an existing model snapshot. + * Deletes an existing model snapshot. You cannot delete the active model snapshot. To delete that snapshot, first revert to a different one. To identify the active model snapshot, refer to the `model_snapshot_id` in the results from the get jobs API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-snapshot.html | Elasticsearch API documentation} */ async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest | TB.MlDeleteModelSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -391,7 +461,14 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_model_snapshot', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -417,11 +494,17 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_trained_model', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Deletes a model alias that refers to the trained model + * Deletes a trained model alias. This API deletes an existing model alias that refers to a trained model. If the model alias is missing or refers to a model other than the one identified by the `model_id`, this API returns an error. * @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 @@ -443,11 +526,18 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/model_aliases/${encodeURIComponent(params.model_alias.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_trained_model_alias', + pathParts: { + model_alias: params.model_alias, + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Estimates the model memory + * Makes an estimation of the memory usage for an anomaly detection job model. It is based on analysis configuration details for the job and cardinality estimates for the fields it references. * @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 @@ -482,11 +572,14 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_estimate_model_memory' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.estimate_model_memory' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Evaluates the data frame analytics for an annotated index. + * Evaluates the data frame analytics for an annotated index. The API packages together commonly used evaluation metrics for various types of machine learning features. This has been designed for use on indexes created by data frame analytics. Evaluation requires both a ground truth field and an analytics result field to be present. * @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 @@ -520,11 +613,14 @@ export default class Ml { const method = 'POST' const path = '/_ml/data_frame/_evaluate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.evaluate_data_frame' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Explains a data frame analytics config. + * Explains a data frame analytics config. This API provides explanations for a data frame analytics config that either exists already or one that has not been created yet. The following explanations are provided: * which fields are included or not in the analysis and why, * how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on. If you have object fields or fields that are excluded via source filtering, they are not included in the explanation. * @see {@link http://www.elastic.co/guide/en/elasticsearch/reference/master/explain-dfanalytics.html | Elasticsearch API documentation} */ async explainDataFrameAnalytics (this: That, params?: T.MlExplainDataFrameAnalyticsRequest | TB.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -566,11 +662,17 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = '/_ml/data_frame/analytics/_explain' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.explain_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Forces any buffered data to be processed by the job. + * Forces any buffered data to be processed by the job. The flush jobs API is only applicable when sending data for analysis using the post data API. Depending on the content of the buffer, then it might additionally calculate new results. Both flush and close operations are similar, however the flush is more efficient if you are expecting to send more data for analysis. When flushing, the job remains open and is available to continue analyzing data. A close operation additionally prunes and persists the model state to disk and the job must be opened again before analyzing further data. * @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 @@ -604,11 +706,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_flush` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.flush_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Predicts the future behavior of a time series by using its historical behavior. + * Predicts the future behavior of a time series by using its historical behavior. Forecasts are not supported for jobs that perform population analysis; an error occurs if you try to create a forecast for a job that has an `over_field_name` in its configuration. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-forecast.html | Elasticsearch API documentation} */ async forecast (this: That, params: T.MlForecastRequest | TB.MlForecastRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -642,11 +750,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_forecast` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.forecast', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves anomaly detection job results for one or more buckets. + * Retrieves anomaly detection job results for one or more buckets. The API presents a chronological view of the records, grouped by bucket. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-bucket.html | Elasticsearch API documentation} */ async getBuckets (this: That, params: T.MlGetBucketsRequest | TB.MlGetBucketsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -687,7 +801,14 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/buckets` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_buckets', + pathParts: { + job_id: params.job_id, + timestamp: params.timestamp + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -713,7 +834,13 @@ export default class Ml { const method = 'GET' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/events` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_calendar_events', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -759,7 +886,13 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = '/_ml/calendars' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_calendars', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -804,11 +937,18 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/categories` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_categories', + pathParts: { + job_id: params.job_id, + category_id: params.category_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves configuration information for data frame analytics jobs. + * Retrieves configuration information for data frame analytics jobs. You can get information for multiple data frame analytics jobs in a single API request by using a comma-separated list of data frame analytics jobs or a wildcard expression. * @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 @@ -838,7 +978,13 @@ export default class Ml { method = 'GET' path = '/_ml/data_frame/analytics' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -872,11 +1018,17 @@ export default class Ml { method = 'GET' path = '/_ml/data_frame/analytics/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_data_frame_analytics_stats', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves usage information for datafeeds. + * Retrieves usage information for datafeeds. You can get statistics for multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a wildcard expression. You can get statistics for all datafeeds by using `_all`, by specifying `*` as the ``, or by omitting the ``. If the datafeed is stopped, the only information you receive is the `datafeed_id` and the `state`. This API returns a maximum of 10,000 datafeeds. * @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 @@ -906,11 +1058,17 @@ export default class Ml { method = 'GET' path = '/_ml/datafeeds/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_datafeed_stats', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves configuration information for datafeeds. + * Retrieves configuration information for datafeeds. You can get information for multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a wildcard expression. You can get information for all datafeeds by using `_all`, by specifying `*` as the ``, or by omitting the ``. This API returns a maximum of 10,000 datafeeds. * @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 @@ -940,11 +1098,17 @@ export default class Ml { method = 'GET' path = '/_ml/datafeeds' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_datafeeds', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves filters. + * Retrieves filters. You can get a single filter or all filters. * @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 @@ -974,11 +1138,17 @@ export default class Ml { method = 'GET' path = '/_ml/filters' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_filters', + pathParts: { + filter_id: params.filter_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves anomaly detection job results for one or more influencers. + * Retrieves anomaly detection job results for one or more influencers. Influencers are the entities that have contributed to, or are to blame for, the anomalies. Influencer results are available only if an `influencer_field_name` is specified in the job configuration. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-influencer.html | Elasticsearch API documentation} */ async getInfluencers (this: That, params: T.MlGetInfluencersRequest | TB.MlGetInfluencersRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1012,7 +1182,13 @@ export default class Ml { const method = body != null ? 'POST' : 'GET' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/influencers` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_influencers', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1046,11 +1222,17 @@ export default class Ml { method = 'GET' path = '/_ml/anomaly_detectors/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_job_stats', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves configuration information for anomaly detection jobs. + * Retrieves configuration information for anomaly detection jobs. You can get information for multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can get information for all anomaly detection jobs by using `_all`, by specifying `*` as the ``, or by omitting the ``. * @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 @@ -1080,11 +1262,17 @@ export default class Ml { method = 'GET' path = '/_ml/anomaly_detectors' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_jobs', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information on how ML is using memory. + * Get information about how machine learning jobs and trained models are using memory, on each node, both within the JVM heap, and natively, outside of the JVM. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-ml-memory.html | Elasticsearch API documentation} */ async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1114,11 +1302,17 @@ export default class Ml { method = 'GET' path = '/_ml/memory/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_memory_stats', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Gets stats for anomaly detection job model snapshot upgrades that are in progress. + * Retrieves usage information for anomaly detection job model snapshot upgrades. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-job-model-snapshot-upgrade-stats.html | Elasticsearch API documentation} */ async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1140,7 +1334,14 @@ export default class Ml { const method = 'GET' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_upgrade/_stats` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_model_snapshot_upgrade_stats', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1185,11 +1386,18 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_model_snapshots', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + * Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. The `overall_score` is calculated by combining the scores of all the buckets within the overall bucket span. First, the maximum `anomaly_score` per anomaly detection job in the overall bucket is calculated. Then the `top_n` of those scores are averaged to result in the `overall_score`. This means that you can fine-tune the `overall_score` so that it is more or less sensitive to the number of jobs that detect an anomaly at the same time. For example, if you set `top_n` to `1`, the `overall_score` is the maximum bucket score in the overall bucket. Alternatively, if you set `top_n` to the number of jobs, the `overall_score` is high only when all jobs detect anomalies in that overall bucket. If you set the `bucket_span` parameter (to a value greater than its default), the `overall_score` is the maximum `overall_score` of the overall buckets that have a span equal to the jobs' largest bucket span. * @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 @@ -1223,11 +1431,17 @@ export default class Ml { const method = body != null ? 'POST' : 'GET' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/overall_buckets` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_overall_buckets', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves anomaly records for an anomaly detection job. + * Retrieves anomaly records for an anomaly detection job. Records contain the detailed analytical results. They describe the anomalous activity that has been identified in the input data based on the detector configuration. There can be many anomaly records depending on the characteristics and size of the input data. In practice, there are often too many to be able to manually process them. The machine learning features therefore perform a sophisticated aggregation of the anomaly records into buckets. The number of record results depends on the number of anomalies found in each bucket, which relates to the number of time series being modeled and the number of detectors. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-record.html | Elasticsearch API documentation} */ async getRecords (this: That, params: T.MlGetRecordsRequest | TB.MlGetRecordsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1261,11 +1475,17 @@ export default class Ml { const method = body != null ? 'POST' : 'GET' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/records` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_records', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves configuration information for a trained inference model. + * Retrieves configuration information for a trained model. * @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 @@ -1295,11 +1515,17 @@ export default class Ml { method = 'GET' path = '/_ml/trained_models' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_trained_models', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves usage information for trained inference models. + * Retrieves usage information for trained models. You can get usage information for multiple trained models in a single API request by using a comma-separated list of model IDs or a wildcard expression. * @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 @@ -1329,11 +1555,17 @@ export default class Ml { method = 'GET' path = '/_ml/trained_models/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_trained_models_stats', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Evaluate a trained model. + * Evaluates 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 @@ -1367,11 +1599,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/_infer` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.infer_trained_model', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns defaults and limits used by machine learning. + * Returns defaults and limits used by machine learning. This endpoint is designed to be used by a user interface that needs to fully understand machine learning configurations where some options are not specified, meaning that the defaults should be used. This endpoint may be used to find out what those defaults are. It also provides information about the maximum size of machine learning jobs that could run in the current cluster configuration. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-ml-info.html | Elasticsearch API documentation} */ async info (this: That, params?: T.MlInfoRequest | TB.MlInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1394,11 +1632,14 @@ export default class Ml { const method = 'GET' const path = '/_ml/info' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.info' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Opens one or more anomaly detection jobs. + * Open anomaly detection jobs. An anomaly detection job must be opened in order for it to be ready to receive and analyze data. It can be opened and closed multiple times throughout its lifecycle. When you open a new job, it starts with an empty model. When you open an existing job, the most recent model state is automatically loaded. The job is ready to resume its analysis from where it left off, once new data is received. * @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 @@ -1432,11 +1673,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_open` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.open_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Posts scheduled events in a calendar. + * Adds scheduled events to a calendar. * @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 @@ -1470,11 +1717,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/events` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.post_calendar_events', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Sends data to an anomaly detection job for analysis. + * Sends data to an anomaly detection job for analysis. IMPORTANT: For each job, data can be accepted from only a single connection at a time. It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-post-data.html | Elasticsearch API documentation} */ async postData (this: That, params: T.MlPostDataRequest | TB.MlPostDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1501,11 +1754,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_data` - return await this.transport.request({ path, method, querystring, bulkBody: body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.post_data', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } /** - * Previews that will be analyzed given a data frame analytics config. + * Previews the extracted features used by a data frame analytics config. * @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 @@ -1547,11 +1806,17 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = '/_ml/data_frame/analytics/_preview' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.preview_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Previews a datafeed. + * Previews a datafeed. This API returns the first "page" of search results from a datafeed. You can preview an existing datafeed or provide configuration details for a datafeed and anomaly detection job in the API. The preview shows the structure of the data that will be passed to the anomaly detection engine. IMPORTANT: When Elasticsearch security features are enabled, the preview uses the credentials of the user that called the API. However, when the datafeed starts it uses the roles of the last user that created or updated the datafeed. To get a preview that accurately reflects the behavior of the datafeed, use the appropriate credentials. You can also use secondary authorization headers to supply the credentials. * @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> @@ -1593,11 +1858,17 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = '/_ml/datafeeds/_preview' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.preview_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Instantiates a calendar. + * Creates a calendar. * @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 @@ -1631,7 +1902,13 @@ export default class Ml { const method = 'PUT' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_calendar', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1657,11 +1934,18 @@ export default class Ml { const method = 'PUT' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/jobs/${encodeURIComponent(params.job_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_calendar_job', + pathParts: { + calendar_id: params.calendar_id, + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Instantiates a data frame analytics job. + * Instantiates a data frame analytics job. This API creates a data frame analytics job that performs an analysis on the source indices and stores the outcome in a destination index. * @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 @@ -1695,11 +1979,17 @@ export default class Ml { const method = 'PUT' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Instantiates a datafeed. + * Instantiates a datafeed. Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job. You can associate only one datafeed with each anomaly detection job. The datafeed contains a query that runs at a defined interval (`frequency`). If you are concerned about delayed data, you can add a delay (`query_delay') at each interval. When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed directly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index. * @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 @@ -1733,11 +2023,17 @@ export default class Ml { const method = 'PUT' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Instantiates a filter. + * Instantiates a filter. A filter contains a list of strings. It can be used by one or more anomaly detection jobs. Specifically, filters are referenced in the `custom_rules` property of detector configuration objects. * @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 @@ -1771,11 +2067,17 @@ export default class Ml { const method = 'PUT' const path = `/_ml/filters/${encodeURIComponent(params.filter_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_filter', + pathParts: { + filter_id: params.filter_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Instantiates an anomaly detection job. + * Create an anomaly detection job. If you include a `datafeed_config`, you must have read index privileges on the source index. * @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 @@ -1809,11 +2111,17 @@ export default class Ml { const method = 'PUT' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates an inference trained model. + * Enables you to supply a trained model that is not created by data frame analytics. * @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 @@ -1847,11 +2155,17 @@ export default class Ml { const method = 'PUT' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_trained_model', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates a new model alias (or reassigns an existing one) to refer to the trained model + * Creates or updates a trained model alias. A trained model alias is a logical name used to reference a single trained model. You can use aliases instead of trained model identifiers to make it easier to reference your models. For example, you can use aliases in inference aggregations and processors. An alias must be unique and refer to only a single trained model. However, you can have multiple aliases for each trained model. If you use this API to update an alias such that it references a different trained model ID and the model uses a different type of data frame analytics, an error occurs. For example, this situation occurs if you have a trained model for regression analysis and a trained model for classification analysis; you cannot reassign an alias from one type of trained model to another. If you use this API to update an alias and there are very few input fields in common between the old and new trained models for the model alias, the API returns a warning. * @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 @@ -1873,11 +2187,18 @@ export default class Ml { const method = 'PUT' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/model_aliases/${encodeURIComponent(params.model_alias.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_trained_model_alias', + pathParts: { + model_alias: params.model_alias, + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates part of a trained model definition + * Creates part of a trained model definition. * @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 @@ -1911,11 +2232,18 @@ export default class Ml { const method = 'PUT' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/definition/${encodeURIComponent(params.part.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_trained_model_definition_part', + pathParts: { + model_id: params.model_id, + part: params.part + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates a trained model vocabulary + * Creates a trained model vocabulary. This API is supported only for natural language processing (NLP) models. The vocabulary is stored in the index as described in `inference_config.*.vocabulary` of the trained model definition. * @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 @@ -1949,11 +2277,17 @@ export default class Ml { const method = 'PUT' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/vocabulary` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_trained_model_vocabulary', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Resets an existing anomaly detection job. + * Resets an anomaly detection job. All model state and results are deleted. The job is ready to start over as if it had just been created. It is not currently possible to reset multiple jobs using wildcards or a comma separated list. * @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 @@ -1975,11 +2309,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_reset` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.reset_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Reverts to a specific snapshot. + * Reverts to a specific snapshot. The machine learning features react quickly to anomalous input, learning new behaviors in data. Highly anomalous input increases the variance in the models whilst the system learns whether this is a new step-change in behavior or a one-off event. In the case where this anomalous input is known to be a one-off, then it might be appropriate to reset the model state to a time before this event. For example, you might consider reverting to a saved snapshot after Black Friday or a critical system failure. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-revert-snapshot.html | Elasticsearch API documentation} */ async revertModelSnapshot (this: That, params: T.MlRevertModelSnapshotRequest | TB.MlRevertModelSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -2013,11 +2353,18 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_revert` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.revert_model_snapshot', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + * Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. When upgrading your cluster, in some circumstances you must restart your nodes and reindex your machine learning indices. In those circumstances, there must be no machine learning jobs running. You can close the machine learning jobs, do the upgrade, then open all the jobs again. Alternatively, you can use this API to temporarily halt tasks associated with the jobs and datafeeds and prevent new jobs from opening. You can also use this API during upgrades that do not require you to reindex your machine learning indices, though stopping jobs is not a requirement in that case. You can see the current value for the upgrade_mode setting by using the get machine learning info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-set-upgrade-mode.html | Elasticsearch API documentation} */ async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest | TB.MlSetUpgradeModeRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -2040,11 +2387,14 @@ export default class Ml { const method = 'POST' const path = '/_ml/set_upgrade_mode' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.set_upgrade_mode' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Starts a data frame analytics job. + * Starts a data frame analytics job. A data frame analytics job can be started and stopped multiple times throughout its lifecycle. If the destination index does not exist, it is created automatically the first time you start the data frame analytics job. The `index.number_of_shards` and `index.number_of_replicas` settings for the destination index are copied from the source index. If there are multiple source indices, the destination index copies the highest setting values. The mappings for the destination index are also copied from the source indices. If there are any mapping conflicts, the job fails to start. If the destination index exists, it is used as is. You can therefore set up the destination index in advance with custom settings and mappings. * @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 @@ -2066,11 +2416,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.start_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Starts one or more datafeeds. + * Starts one or more datafeeds. A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped multiple times throughout its lifecycle. Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs. If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped. If new data was indexed for that exact millisecond between stopping and starting, it will be ignored. When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or update it had at the time of creation or update and runs the query using those same roles. If you provided secondary authorization headers when you created or updated the datafeed, those credentials are used instead. * @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 @@ -2104,11 +2460,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.start_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Start a trained model deployment. + * Starts a trained model deployment, which allocates the model to every machine learning node. * @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 @@ -2130,11 +2492,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.start_trained_model_deployment', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Stops one or more data frame analytics jobs. + * Stops one or more data frame analytics jobs. A data frame analytics job can be started and stopped multiple times throughout its lifecycle. * @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 @@ -2156,11 +2524,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.stop_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Stops one or more datafeeds. + * Stops one or more datafeeds. A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped multiple times throughout its lifecycle. * @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 @@ -2194,11 +2568,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.stop_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Stop a trained model deployment. + * Stops a trained model deployment. * @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 @@ -2220,11 +2600,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.stop_trained_model_deployment', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates certain properties of a data frame analytics job. + * Updates an existing data frame analytics job. * @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 @@ -2258,11 +2644,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates certain properties of a datafeed. + * Updates the properties of a datafeed. You must stop and start the datafeed for the changes to be applied. When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at the time of the update and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. * @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 @@ -2296,11 +2688,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates the description of a filter, adds items, or removes items. + * Updates the description of a filter, adds items, or removes items from the list. * @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 @@ -2334,7 +2732,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/filters/${encodeURIComponent(params.filter_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_filter', + pathParts: { + filter_id: params.filter_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2372,7 +2776,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2410,11 +2820,18 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_model_snapshot', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates certain properties of trained model deployment. + * Starts a trained model deployment, which allocates the model to every machine learning node. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-trained-model-deployment.html | Elasticsearch API documentation} */ async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest | TB.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -2448,11 +2865,17 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_trained_model_deployment', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Upgrades a given job snapshot to the current major version. + * Upgrades an anomaly detection model snapshot to the latest major version. Over time, older snapshot formats are deprecated and removed. Anomaly detection jobs support only snapshots that are from the current or previous major version. This API provides a means to upgrade a snapshot to the current major version. This aids in preparing the cluster for an upgrade to the next major version. Only one snapshot per anomaly detection job can be upgraded at a time and the upgraded snapshot cannot be the current snapshot of the anomaly detection job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-upgrade-job-model-snapshot.html | Elasticsearch API documentation} */ async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -2474,7 +2897,14 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_upgrade` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.upgrade_job_snapshot', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2513,7 +2943,10 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_validate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.validate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2544,6 +2977,9 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_validate/detector' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.validate_detector' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/monitoring.ts b/src/api/api/monitoring.ts index 86eff3cb7..f58cf06af 100644 --- a/src/api/api/monitoring.ts +++ b/src/api/api/monitoring.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -71,6 +72,12 @@ export default class Monitoring { const method = 'POST' const path = '/_monitoring/bulk' - return await this.transport.request({ path, method, querystring, bulkBody: body }, options) + const meta: TransportRequestMetadata = { + name: 'monitoring.bulk', + pathParts: { + type: params.type + } + } + return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } } diff --git a/src/api/api/msearch.ts b/src/api/api/msearch.ts index b799c5462..5d5fbc912 100644 --- a/src/api/api/msearch.ts +++ b/src/api/api/msearch.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function MsearchApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> @@ -72,5 +73,11 @@ export default async function MsearchTemplateApi @@ -66,11 +67,18 @@ export default class Nodes { const method = 'DELETE' const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/_repositories_metering/${encodeURIComponent(params.max_archive_version.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'nodes.clear_repositories_metering_archive', + pathParts: { + node_id: params.node_id, + max_archive_version: params.max_archive_version + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns cluster repositories metering information. + * You can use the cluster repositories metering API to retrieve repositories metering information in a cluster. This API exposes monotonically non-decreasing counters and it’s expected that clients would durably store the information needed to compute aggregations over a period of time. Additionally, the information exposed by this API is volatile, meaning that it won’t be present after node restarts. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-repositories-metering-api.html | Elasticsearch API documentation} */ async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest | TB.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -92,11 +100,17 @@ export default class Nodes { const method = 'GET' const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/_repositories_metering` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'nodes.get_repositories_metering_info', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about hot threads on each node in the cluster. + * This API yields a breakdown of the hot threads on each selected node in the cluster. The output is plain text with a breakdown of each node’s top hot threads. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html | Elasticsearch API documentation} */ async hotThreads (this: That, params?: T.NodesHotThreadsRequest | TB.NodesHotThreadsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -126,11 +140,17 @@ export default class Nodes { method = 'GET' path = '/_nodes/hot_threads' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'nodes.hot_threads', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns information about nodes in the cluster. + * Returns cluster nodes information. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html | Elasticsearch API documentation} */ async info (this: That, params?: T.NodesInfoRequest | TB.NodesInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -166,11 +186,18 @@ export default class Nodes { method = 'GET' path = '/_nodes' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'nodes.info', + pathParts: { + node_id: params.node_id, + metric: params.metric + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Reloads secure settings. + * Reloads the keystore on nodes in the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings | Elasticsearch API documentation} */ async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest | TB.NodesReloadSecureSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -212,11 +239,17 @@ export default class Nodes { method = 'POST' path = '/_nodes/reload_secure_settings' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'nodes.reload_secure_settings', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns statistical information about nodes in the cluster. + * Returns cluster nodes statistics. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html | Elasticsearch API documentation} */ async stats (this: That, params?: T.NodesStatsRequest | TB.NodesStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -258,11 +291,19 @@ export default class Nodes { method = 'GET' path = '/_nodes/stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'nodes.stats', + pathParts: { + node_id: params.node_id, + metric: params.metric, + index_metric: params.index_metric + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns low-level information about REST actions usage on nodes. + * Returns information on the usage of features. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html | Elasticsearch API documentation} */ async usage (this: That, params?: T.NodesUsageRequest | TB.NodesUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -298,6 +339,13 @@ export default class Nodes { method = 'GET' path = '/_nodes/usage' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'nodes.usage', + pathParts: { + node_id: params.node_id, + metric: params.metric + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/open_point_in_time.ts b/src/api/api/open_point_in_time.ts index dbe2fb182..f0fdd689c 100644 --- a/src/api/api/open_point_in_time.ts +++ b/src/api/api/open_point_in_time.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Open a point in time that can be used in subsequent searches + * A search request by default executes against the most recent visible data of the target indices, which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple search requests using the same point in time. For example, if refreshes happen between `search_after` requests, then the results of those requests might not be consistent as changes happening between searches are only visible to the more recent point in time. * @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 @@ -60,5 +61,11 @@ export default async function OpenPointInTimeApi (this: That, params: T.OpenPoin const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_pit` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'open_point_in_time', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ping.ts b/src/api/api/ping.ts index b91a22fd3..e0a8011df 100644 --- a/src/api/api/ping.ts +++ b/src/api/api/ping.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -61,5 +62,8 @@ export default async function PingApi (this: That, params?: T.PingRequest | TB.P const method = 'HEAD' const path = '/' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ping' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/profiling.ts b/src/api/api/profiling.ts new file mode 100644 index 000000000..0d729387c --- /dev/null +++ b/src/api/api/profiling.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, + TransportRequestMetadata, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class Profiling { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. + * @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation} + */ + async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async flamegraph (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_profiling/flamegraph' + const meta: TransportRequestMetadata = { + name: 'profiling.flamegraph' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Extracts raw stacktrace information from Universal Profiling. + * @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation} + */ + async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async stacktraces (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_profiling/stacktraces' + const meta: TransportRequestMetadata = { + name: 'profiling.stacktraces' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Returns basic information about the status of Universal Profiling. + * @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation} + */ + async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async status (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_profiling/status' + const meta: TransportRequestMetadata = { + name: 'profiling.status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Extracts a list of topN functions from Universal Profiling. + * @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation} + */ + async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async topnFunctions (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_profiling/topn/functions' + const meta: TransportRequestMetadata = { + name: 'profiling.topn_functions' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } +} diff --git a/src/api/api/put_script.ts b/src/api/api/put_script.ts index 36ea03bd2..e7dbfc87e 100644 --- a/src/api/api/put_script.ts +++ b/src/api/api/put_script.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Creates or updates a script. + * Creates or updates a stored script or search template. * @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 @@ -79,5 +80,12 @@ export default async function PutScriptApi (this: That, params: T.PutScriptReque method = 'PUT' path = `/_scripts/${encodeURIComponent(params.id.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'put_script', + pathParts: { + id: params.id, + context: params.context + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/query_rules.ts b/src/api/api/query_rules.ts new file mode 100644 index 000000000..1a090d5ff --- /dev/null +++ b/src/api/api/query_rules.ts @@ -0,0 +1,295 @@ +/* + * 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, + TransportRequestMetadata, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class QueryRules { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Deletes a query rule within a query ruleset. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-rule.html | Elasticsearch API documentation} + */ + async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise + async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['ruleset_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 = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}/_rule/${encodeURIComponent(params.rule_id.toString())}` + const meta: TransportRequestMetadata = { + name: 'query_rules.delete_rule', + pathParts: { + ruleset_id: params.ruleset_id, + rule_id: params.rule_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Deletes a query ruleset. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html | Elasticsearch API documentation} + */ + async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptions): Promise + async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, 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())}` + const meta: TransportRequestMetadata = { + name: 'query_rules.delete_ruleset', + pathParts: { + ruleset_id: params.ruleset_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Returns the details about a query rule within a query ruleset + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-rule.html | Elasticsearch API documentation} + */ + async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise + async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['ruleset_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 = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}/_rule/${encodeURIComponent(params.rule_id.toString())}` + const meta: TransportRequestMetadata = { + name: 'query_rules.get_rule', + pathParts: { + ruleset_id: params.ruleset_id, + rule_id: params.rule_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, 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 getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptions): Promise + async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, 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())}` + const meta: TransportRequestMetadata = { + name: 'query_rules.get_ruleset', + pathParts: { + ruleset_id: params.ruleset_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Returns summarized information about existing query rulesets. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html | Elasticsearch API documentation} + */ + async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptions): Promise + async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, 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' + const meta: TransportRequestMetadata = { + name: 'query_rules.list_rulesets' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Creates or updates a query rule within a query ruleset. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-rule.html | Elasticsearch API documentation} + */ + async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptions): Promise + async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['ruleset_id', 'rule_id'] + const acceptedBody: string[] = ['type', 'criteria', 'actions', 'priority'] + 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())}/_rule/${encodeURIComponent(params.rule_id.toString())}` + const meta: TransportRequestMetadata = { + name: 'query_rules.put_rule', + pathParts: { + ruleset_id: params.ruleset_id, + rule_id: params.rule_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, 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 putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptions): Promise + async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, 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())}` + const meta: TransportRequestMetadata = { + name: 'query_rules.put_ruleset', + pathParts: { + ruleset_id: params.ruleset_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } +} diff --git a/src/api/api/query_ruleset.ts b/src/api/api/query_ruleset.ts deleted file mode 100644 index 771205b0e..000000000 --- a/src/api/api/query_ruleset.ts +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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 5e0e1c263..010a984a6 100644 --- a/src/api/api/rank_eval.ts +++ b/src/api/api/rank_eval.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Allows to evaluate the quality of ranked search results over a set of typical search queries + * Enables you 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/master/search-rank-eval.html | Elasticsearch API documentation} */ export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -79,5 +80,11 @@ export default async function RankEvalApi (this: That, params: T.RankEvalRequest method = body != null ? 'POST' : 'GET' path = '/_rank_eval' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rank_eval', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/reindex.ts b/src/api/api/reindex.ts index 17790d754..91c6e14d3 100644 --- a/src/api/api/reindex.ts +++ b/src/api/api/reindex.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,8 @@ export default async function ReindexApi (this: That, params: T.ReindexRequest | const method = 'POST' const path = '/_reindex' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'reindex' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/reindex_rethrottle.ts b/src/api/api/reindex_rethrottle.ts index 3c12d0b7e..4fedb4ed3 100644 --- a/src/api/api/reindex_rethrottle.ts +++ b/src/api/api/reindex_rethrottle.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Changes the number of requests per second for a particular Reindex operation. + * Copies documents from a source to a destination. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html | Elasticsearch API documentation} */ export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest | TB.ReindexRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -60,5 +61,11 @@ export default async function ReindexRethrottleApi (this: That, params: T.Reinde const method = 'POST' const path = `/_reindex/${encodeURIComponent(params.task_id.toString())}/_rethrottle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'reindex_rethrottle', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/render_search_template.ts b/src/api/api/render_search_template.ts index ef14b738c..cd31ab4c8 100644 --- a/src/api/api/render_search_template.ts +++ b/src/api/api/render_search_template.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Allows to use the Mustache language to pre-render a search definition. + * Renders a search template as a search request body. * @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 @@ -80,5 +81,11 @@ export default async function RenderSearchTemplateApi (this: That, params?: T.Re method = body != null ? 'POST' : 'GET' path = '/_render/template' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'render_search_template', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/rollup.ts b/src/api/api/rollup.ts index 26c5d5759..d9aad8fd7 100644 --- a/src/api/api/rollup.ts +++ b/src/api/api/rollup.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Rollup { const method = 'DELETE' const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.delete_job', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -100,7 +107,13 @@ export default class Rollup { method = 'GET' path = '/_rollup/job' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.get_jobs', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -134,11 +147,17 @@ export default class Rollup { method = 'GET' path = '/_rollup/data' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.get_rollup_caps', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + * Returns the rollup capabilities of all jobs inside of a rollup index (for example, the index where rollup data is stored). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-index-caps.html | Elasticsearch API documentation} */ async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -160,7 +179,13 @@ export default class Rollup { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_rollup/data` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.get_rollup_index_caps', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -198,11 +223,17 @@ export default class Rollup { const method = 'PUT' const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.put_job', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Enables searching rolled-up data using the standard query DSL. + * Enables searching rolled-up data using the standard Query DSL. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html | Elasticsearch API documentation} */ async rollupSearch> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> @@ -236,7 +267,13 @@ export default class Rollup { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_rollup_search` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.rollup_search', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -262,7 +299,13 @@ export default class Rollup { const method = 'POST' const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.start_job', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -288,6 +331,12 @@ export default class Rollup { const method = 'POST' const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.stop_job', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/scripts_painless_execute.ts b/src/api/api/scripts_painless_execute.ts index e27a59952..33b66e3bd 100644 --- a/src/api/api/scripts_painless_execute.ts +++ b/src/api/api/scripts_painless_execute.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Allows an arbitrary script to be executed and a result to be returned + * Runs a script and returns a result. * @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> @@ -73,5 +74,8 @@ export default async function ScriptsPainlessExecuteApi (this const method = body != null ? 'POST' : 'GET' const path = '/_scripts/painless/_execute' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'scripts_painless_execute' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/scroll.ts b/src/api/api/scroll.ts index 77e291799..13b86d8ee 100644 --- a/src/api/api/scroll.ts +++ b/src/api/api/scroll.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function ScrollApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> @@ -86,5 +87,11 @@ export default async function SearchApi @@ -118,7 +131,13 @@ export default class SearchApplication { const method = 'GET' const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_application.get', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -152,7 +171,13 @@ export default class SearchApplication { method = 'GET' path = '/_application/analytics' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_application.get_behavioral_analytics', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -179,7 +204,10 @@ export default class SearchApplication { const method = 'GET' const path = '/_application/search_application' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_application.list' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -205,7 +233,14 @@ export default class SearchApplication { const method = 'POST' const path = `/_application/analytics/${encodeURIComponent(params.collection_name.toString())}/event/${encodeURIComponent(params.event_type.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_application.post_behavioral_analytics_event', + pathParts: { + collection_name: params.collection_name, + event_type: params.event_type + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -236,7 +271,13 @@ export default class SearchApplication { const method = 'PUT' const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_application.put', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -262,7 +303,13 @@ export default class SearchApplication { const method = 'PUT' const path = `/_application/analytics/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_application.put_behavioral_analytics', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -288,11 +335,17 @@ export default class SearchApplication { const method = 'POST' const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}/_render_query` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_application.render_query', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Perform a search against a search application + * Perform a search against a search application. * @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> @@ -326,6 +379,12 @@ export default class SearchApplication { const method = body != null ? 'POST' : 'GET' const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}/_search` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_application.search', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/search_mvt.ts b/src/api/api/search_mvt.ts index 5d3fbdbef..e81f4b2da 100644 --- a/src/api/api/search_mvt.ts +++ b/src/api/api/search_mvt.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,15 @@ export default async function SearchMvtApi (this: That, params: T.SearchMvtReque 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) + const meta: TransportRequestMetadata = { + name: 'search_mvt', + pathParts: { + index: params.index, + field: params.field, + zoom: params.zoom, + x: params.x, + y: params.y + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/search_shards.ts b/src/api/api/search_shards.ts index eaf609e73..c9b2b299d 100644 --- a/src/api/api/search_shards.ts +++ b/src/api/api/search_shards.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -68,5 +69,11 @@ export default async function SearchShardsApi (this: That, params?: T.SearchShar method = body != null ? 'POST' : 'GET' path = '/_search_shards' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_shards', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/search_template.ts b/src/api/api/search_template.ts index f8a5c3548..a158ad55a 100644 --- a/src/api/api/search_template.ts +++ b/src/api/api/search_template.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Allows to use the Mustache language to pre-render a search definition. + * Runs a search with a search template. * @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> @@ -80,5 +81,11 @@ export default async function SearchTemplateApi (this: That method = body != null ? 'POST' : 'GET' path = '/_search/template' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_template', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/searchable_snapshots.ts b/src/api/api/searchable_snapshots.ts index 73b6853bb..90ac0b9e2 100644 --- a/src/api/api/searchable_snapshots.ts +++ b/src/api/api/searchable_snapshots.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -74,7 +75,13 @@ export default class SearchableSnapshots { method = 'GET' path = '/_searchable_snapshots/cache/stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'searchable_snapshots.cache_stats', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -108,7 +115,13 @@ export default class SearchableSnapshots { method = 'POST' path = '/_searchable_snapshots/cache/clear' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'searchable_snapshots.clear_cache', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -146,7 +159,14 @@ export default class SearchableSnapshots { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}/_mount` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'searchable_snapshots.mount', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -180,6 +200,12 @@ export default class SearchableSnapshots { method = 'GET' path = '/_searchable_snapshots/stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'searchable_snapshots.stats', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/security.ts b/src/api/api/security.ts index 0d2d613bc..a810764df 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Security { } /** - * Creates or updates the user profile on behalf of another user. + * Creates or updates a user profile on behalf of another user. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-activate-user-profile.html | Elasticsearch API documentation} */ async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -78,11 +79,14 @@ export default class Security { const method = 'POST' const path = '/_security/profile/_activate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.activate_user_profile' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Enables authentication as a user and retrieve information about the authenticated user. + * Enables you to submit a request with a basic auth header to authenticate a user and retrieve information about the authenticated user. A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user. If the user cannot be authenticated, this API returns a 401 status code. * @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 @@ -105,7 +109,92 @@ export default class Security { const method = 'GET' const path = '/_security/_authenticate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.authenticate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk delete roles API cannot delete roles that are defined in roles files. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-bulk-delete-role.html | Elasticsearch API documentation} + */ + async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest | TB.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest | TB.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest | TB.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptions): Promise + async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest | TB.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['names'] + 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 = 'DELETE' + const path = '/_security/role' + const meta: TransportRequestMetadata = { + name: 'security.bulk_delete_role' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk create or update roles API cannot update roles that are defined in roles files. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-bulk-put-role.html | Elasticsearch API documentation} + */ + async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest | TB.SecurityBulkPutRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest | TB.SecurityBulkPutRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest | TB.SecurityBulkPutRoleRequest, options?: TransportRequestOptions): Promise + async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest | TB.SecurityBulkPutRoleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['roles'] + 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 = '/_security/role' + const meta: TransportRequestMetadata = { + name: 'security.bulk_put_role' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -131,7 +220,10 @@ export default class Security { const method = 'POST' const path = '/_security/api_key/_bulk_update' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.bulk_update_api_keys' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -177,11 +269,17 @@ export default class Security { method = 'PUT' path = '/_security/user/_password' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.change_password', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Clear a subset or all entries from the API key cache. + * Evicts a subset of all entries from the API key cache. The cache is also automatically cleared on state changes of the security index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-clear-api-key-cache.html | Elasticsearch API documentation} */ async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest | TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -203,7 +301,13 @@ export default class Security { const method = 'POST' const path = `/_security/api_key/${encodeURIComponent(params.ids.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_api_key_cache', + pathParts: { + ids: params.ids + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -229,7 +333,13 @@ export default class Security { const method = 'POST' const path = `/_security/privilege/${encodeURIComponent(params.application.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_cached_privileges', + pathParts: { + application: params.application + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -255,7 +365,13 @@ export default class Security { const method = 'POST' const path = `/_security/realm/${encodeURIComponent(params.realms.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_cached_realms', + pathParts: { + realms: params.realms + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -281,7 +397,13 @@ export default class Security { const method = 'POST' const path = `/_security/role/${encodeURIComponent(params.name.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_cached_roles', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -307,11 +429,19 @@ export default class Security { const method = 'POST' const path = `/_security/service/${encodeURIComponent(params.namespace.toString())}/${encodeURIComponent(params.service.toString())}/credential/token/${encodeURIComponent(params.name.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_cached_service_tokens', + pathParts: { + namespace: params.namespace, + service: params.service, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates an API key for access without requiring basic authentication. + * Creates an API key for access without requiring basic authentication. A successful request returns a JSON structure that contains the API key, its unique id, and its name. If applicable, it also returns expiration information for the API key in milliseconds. NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys. * @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 @@ -346,7 +476,10 @@ export default class Security { const method = 'PUT' const path = '/_security/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.create_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -372,11 +505,14 @@ export default class Security { const method = 'POST' const path = '/_security/cross_cluster/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.create_cross_cluster_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates a service account token for access without requiring basic authentication. + * Creates a service accounts token for access without requiring basic authentication. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-create-service-token.html | Elasticsearch API documentation} */ async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest | TB.SecurityCreateServiceTokenRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -405,7 +541,15 @@ export default class Security { method = 'POST' path = `/_security/service/${encodeURIComponent(params.namespace.toString())}/${encodeURIComponent(params.service.toString())}/credential/token` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.create_service_token', + pathParts: { + namespace: params.namespace, + service: params.service, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -431,7 +575,14 @@ export default class Security { const method = 'DELETE' const path = `/_security/privilege/${encodeURIComponent(params.application.toString())}/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_privileges', + pathParts: { + application: params.application, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -457,7 +608,13 @@ export default class Security { const method = 'DELETE' const path = `/_security/role/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_role', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -483,7 +640,13 @@ export default class Security { const method = 'DELETE' const path = `/_security/role_mapping/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_role_mapping', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -509,7 +672,15 @@ export default class Security { const method = 'DELETE' const path = `/_security/service/${encodeURIComponent(params.namespace.toString())}/${encodeURIComponent(params.service.toString())}/credential/token/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_service_token', + pathParts: { + namespace: params.namespace, + service: params.service, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -535,7 +706,13 @@ export default class Security { const method = 'DELETE' const path = `/_security/user/${encodeURIComponent(params.username.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -561,7 +738,13 @@ export default class Security { const method = 'PUT' const path = `/_security/user/${encodeURIComponent(params.username.toString())}/_disable` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.disable_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -587,7 +770,13 @@ export default class Security { const method = 'PUT' const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_disable` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.disable_user_profile', + pathParts: { + uid: params.uid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -613,7 +802,13 @@ export default class Security { const method = 'PUT' const path = `/_security/user/${encodeURIComponent(params.username.toString())}/_enable` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.enable_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -639,11 +834,17 @@ export default class Security { const method = 'PUT' const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_enable` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.enable_user_profile', + pathParts: { + uid: params.uid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. + * Enables a Kibana instance to configure itself for communication with a secured Elasticsearch cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html | Elasticsearch API documentation} */ async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -666,11 +867,14 @@ export default class Security { const method = 'GET' const path = '/_security/enroll/kibana' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.enroll_kibana' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Allows a new node to enroll to an existing cluster with security enabled. + * Allows a new node to join an existing cluster with security features enabled. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html | Elasticsearch API documentation} */ async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest | TB.SecurityEnrollNodeRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -693,11 +897,14 @@ export default class Security { const method = 'GET' const path = '/_security/enroll/node' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.enroll_node' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves information for one or more API keys. + * Retrieves information for one or more API keys. NOTE: If you have only the `manage_own_api_key` privilege, this API returns only the API keys that you own. If you have `read_security`, `manage_api_key` or greater privileges (including `manage_security`), this API returns all API keys regardless of ownership. * @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 @@ -720,7 +927,10 @@ export default class Security { const method = 'GET' const path = '/_security/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -747,7 +957,10 @@ export default class Security { const method = 'GET' const path = '/_security/privilege/_builtin' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_builtin_privileges' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -784,11 +997,18 @@ export default class Security { method = 'GET' path = '/_security/privilege' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_privileges', + pathParts: { + application: params.application, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves roles in the native realm. + * The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The get roles API cannot retrieve roles that are defined in roles files. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-role.html | Elasticsearch API documentation} */ async getRole (this: That, params?: T.SecurityGetRoleRequest | TB.SecurityGetRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -818,7 +1038,13 @@ export default class Security { method = 'GET' path = '/_security/role' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_role', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -852,11 +1078,17 @@ export default class Security { method = 'GET' path = '/_security/role_mapping' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_role_mapping', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves information about service accounts. + * This API returns a list of service accounts that match the provided path parameter(s). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-service-accounts.html | Elasticsearch API documentation} */ async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest | TB.SecurityGetServiceAccountsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -889,7 +1121,14 @@ export default class Security { method = 'GET' path = '/_security/service' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_service_accounts', + pathParts: { + namespace: params.namespace, + service: params.service + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -915,7 +1154,14 @@ export default class Security { const method = 'GET' const path = `/_security/service/${encodeURIComponent(params.namespace.toString())}/${encodeURIComponent(params.service.toString())}/credential` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_service_credentials', + pathParts: { + namespace: params.namespace, + service: params.service + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -941,7 +1187,10 @@ export default class Security { const method = 'GET' const path = '/_security/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -980,7 +1229,10 @@ export default class Security { const method = 'POST' const path = '/_security/oauth2/token' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_token' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1014,7 +1266,13 @@ export default class Security { method = 'GET' path = '/_security/user' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1041,11 +1299,14 @@ export default class Security { const method = 'GET' const path = '/_security/user/_privileges' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_user_privileges' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves user profiles for the given unique ID(s). + * Retrieves a user's profile using the unique profile ID. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-user-profile.html | Elasticsearch API documentation} */ async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1067,11 +1328,17 @@ export default class Security { const method = 'GET' const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_user_profile', + pathParts: { + uid: params.uid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates an API key on behalf of another user. + * Creates an API key on behalf of another user. This API is similar to Create API keys, however it creates the API key for a user that is different than the user that runs the API. The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created. It is not possible to use this API to create an API key without that user’s credentials. The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user. In this case, the API key will be created on behalf of the impersonated user. This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf. A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name. If applicable, it also returns expiration information for the API key in milliseconds. By default, API keys never expire. You can specify expiration information when you create the API keys. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-grant-api-key.html | Elasticsearch API documentation} */ async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest | TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1105,7 +1372,10 @@ export default class Security { const method = 'POST' const path = '/_security/api_key/grant' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.grant_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1151,7 +1421,13 @@ export default class Security { method = body != null ? 'POST' : 'GET' path = '/_security/user/_has_privileges' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.has_privileges', + pathParts: { + user: params.user + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1189,11 +1465,14 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/profile/_has_privileges' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.has_privileges_user_profile' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Invalidates one or more API keys. + * Invalidates one or more API keys. The `manage_api_key` privilege allows deleting any API keys. The `manage_own_api_key` only allows deleting API keys that are owned by the user. In addition, with the `manage_own_api_key` privilege, an invalidation request must be issued in one of the three formats: - Set the parameter `owner=true`. - Or, set both `username` and `realm_name` to match the user’s identity. - Or, if the request is issued by an API key, i.e. an API key invalidates itself, specify its ID in the `ids` field. * @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 @@ -1228,7 +1507,10 @@ export default class Security { const method = 'DELETE' const path = '/_security/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.invalidate_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1267,7 +1549,10 @@ export default class Security { const method = 'DELETE' const path = '/_security/oauth2/token' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.invalidate_token' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1293,7 +1578,10 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/authenticate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.oidc_authenticate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1319,7 +1607,10 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/logout' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.oidc_logout' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1345,7 +1636,10 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/prepare' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.oidc_prepare_authentication' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1376,11 +1670,14 @@ export default class Security { const method = 'PUT' const path = '/_security/privilege' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.put_privileges' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Adds and updates roles in the native realm. + * The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The create or update roles API cannot update roles that are defined in roles files. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-put-role.html | Elasticsearch API documentation} */ async putRole (this: That, params: T.SecurityPutRoleRequest | TB.SecurityPutRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1388,7 +1685,7 @@ export default class Security { async putRole (this: That, params: T.SecurityPutRoleRequest | TB.SecurityPutRoleRequest, options?: TransportRequestOptions): Promise async putRole (this: That, params: T.SecurityPutRoleRequest | TB.SecurityPutRoleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['applications', 'cluster', 'global', 'indices', 'metadata', 'run_as', 'transient_metadata'] + const acceptedBody: string[] = ['applications', 'cluster', 'global', 'indices', 'metadata', 'run_as', 'description', 'transient_metadata'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body @@ -1414,7 +1711,13 @@ export default class Security { const method = 'PUT' const path = `/_security/role/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.put_role', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1452,7 +1755,13 @@ export default class Security { const method = 'PUT' const path = `/_security/role_mapping/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.put_role_mapping', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1490,11 +1799,17 @@ export default class Security { const method = 'PUT' const path = `/_security/user/${encodeURIComponent(params.username.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.put_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves information for API keys using a subset of query DSL + * Retrieves information for API keys in a paginated manner. You can optionally filter the results with a query. * @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 @@ -1529,11 +1844,98 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/_query/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.query_api_keys' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair + * Retrieves roles in a paginated manner. You can optionally filter the results with a query. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-query-role.html | Elasticsearch API documentation} + */ + async queryRole (this: That, params?: T.SecurityQueryRoleRequest | TB.SecurityQueryRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async queryRole (this: That, params?: T.SecurityQueryRoleRequest | TB.SecurityQueryRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async queryRole (this: That, params?: T.SecurityQueryRoleRequest | TB.SecurityQueryRoleRequest, options?: TransportRequestOptions): Promise + async queryRole (this: That, params?: T.SecurityQueryRoleRequest | TB.SecurityQueryRoleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['query', 'from', 'sort', 'size', 'search_after'] + 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 = '/_security/_query/role' + const meta: TransportRequestMetadata = { + name: 'security.query_role' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Retrieves information for Users in a paginated manner. You can optionally filter the results with a query. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-query-user.html | Elasticsearch API documentation} + */ + async queryUser (this: That, params?: T.SecurityQueryUserRequest | TB.SecurityQueryUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async queryUser (this: That, params?: T.SecurityQueryUserRequest | TB.SecurityQueryUserRequest, options?: TransportRequestOptionsWithMeta): Promise> + async queryUser (this: That, params?: T.SecurityQueryUserRequest | TB.SecurityQueryUserRequest, options?: TransportRequestOptions): Promise + async queryUser (this: That, params?: T.SecurityQueryUserRequest | TB.SecurityQueryUserRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['query', 'from', 'sort', 'size', 'search_after'] + 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 = '/_security/_query/user' + const meta: TransportRequestMetadata = { + name: 'security.query_user' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Submits a SAML Response message to Elasticsearch for consumption. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-saml-authenticate.html | Elasticsearch API documentation} */ async samlAuthenticate (this: That, params: T.SecuritySamlAuthenticateRequest | TB.SecuritySamlAuthenticateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1567,11 +1969,14 @@ export default class Security { const method = 'POST' const path = '/_security/saml/authenticate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_authenticate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Verifies the logout response sent from the SAML IdP + * Verifies the logout response sent from the SAML IdP. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-saml-complete-logout.html | Elasticsearch API documentation} */ async samlCompleteLogout (this: That, params: T.SecuritySamlCompleteLogoutRequest | TB.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1605,11 +2010,14 @@ export default class Security { const method = 'POST' const path = '/_security/saml/complete_logout' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_complete_logout' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Consumes a SAML LogoutRequest + * Submits a SAML LogoutRequest message to Elasticsearch for consumption. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-saml-invalidate.html | Elasticsearch API documentation} */ async samlInvalidate (this: That, params: T.SecuritySamlInvalidateRequest | TB.SecuritySamlInvalidateRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1643,11 +2051,14 @@ export default class Security { const method = 'POST' const path = '/_security/saml/invalidate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_invalidate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Invalidates an access token and a refresh token that were generated via the SAML Authenticate API + * Submits a request to invalidate an access token and refresh token. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-saml-logout.html | Elasticsearch API documentation} */ async samlLogout (this: That, params: T.SecuritySamlLogoutRequest | TB.SecuritySamlLogoutRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1681,11 +2092,14 @@ export default class Security { const method = 'POST' const path = '/_security/saml/logout' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_logout' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates a SAML authentication request + * Creates a SAML authentication request () as a URL string, based on the configuration of the respective SAML realm in Elasticsearch. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-saml-prepare-authentication.html | Elasticsearch API documentation} */ async samlPrepareAuthentication (this: That, params?: T.SecuritySamlPrepareAuthenticationRequest | TB.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1720,11 +2134,14 @@ export default class Security { const method = 'POST' const path = '/_security/saml/prepare' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_prepare_authentication' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider + * Generate SAML metadata for a SAML 2.0 Service Provider. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-saml-sp-metadata.html | Elasticsearch API documentation} */ async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest | TB.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1746,7 +2163,13 @@ export default class Security { const method = 'GET' const path = `/_security/saml/metadata/${encodeURIComponent(params.realm_name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_service_provider_metadata', + pathParts: { + realm_name: params.realm_name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1785,11 +2208,14 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/profile/_suggest' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.suggest_user_profiles' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates attributes of an existing API key. + * Updates attributes of an existing API key. Users can only update API keys that they created or that were granted to them. Use this API to update API keys created by the create API Key or grant API Key APIs. If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead. It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key. This API supports updates to an API key’s access scope and metadata. The access scope of an API key is derived from the `role_descriptors` you specify in the request, and a snapshot of the owner user’s permissions at the time of the request. The snapshot of the owner’s permissions is updated automatically on every call. If you don’t specify `role_descriptors` in the request, a call to this API might still change the API key’s access scope. This change can occur if the owner user’s permissions have changed since the API key was created or last modified. To update another user’s API key, use the `run_as` feature to submit a request on behalf of another user. IMPORTANT: It’s not possible to use an API key as the authentication credential for this API. To update an API key, the owner user’s credentials are required. * @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 @@ -1823,7 +2249,13 @@ export default class Security { const method = 'PUT' const path = `/_security/api_key/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.update_api_key', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1849,7 +2281,13 @@ export default class Security { const method = 'PUT' const path = `/_security/cross_cluster/api_key/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.update_cross_cluster_api_key', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1875,11 +2313,14 @@ export default class Security { const method = 'PUT' const path = '/_security/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.update_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Update application specific data for the user profile of the given unique ID. + * Updates specific data for the user profile that's associated with the specified unique ID. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-update-user-profile-data.html | Elasticsearch API documentation} */ async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -1913,6 +2354,12 @@ export default class Security { const method = 'PUT' const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_data` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.update_user_profile_data', + pathParts: { + uid: params.uid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/shutdown.ts b/src/api/api/shutdown.ts index 3fc62d09a..cf83485f3 100644 --- a/src/api/api/shutdown.ts +++ b/src/api/api/shutdown.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Shutdown { const method = 'DELETE' const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/shutdown` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'shutdown.delete_node', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -100,7 +107,13 @@ export default class Shutdown { method = 'GET' path = '/_nodes/shutdown' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'shutdown.get_node', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -138,6 +151,12 @@ export default class Shutdown { const method = 'PUT' const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/shutdown` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'shutdown.put_node', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/simulate.ts b/src/api/api/simulate.ts new file mode 100644 index 000000000..a5a76325c --- /dev/null +++ b/src/api/api/simulate.ts @@ -0,0 +1,85 @@ +/* + * 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, + TransportRequestMetadata, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class Simulate { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Simulates running ingest with example documents. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-ingest-api.html | Elasticsearch API documentation} + */ + async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async ingest (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + let method = '' + let path = '' + if (params.index != null) { + method = body != null ? 'POST' : 'GET' + path = `/_ingest/${encodeURIComponent(params.index.toString())}/_simulate` + } else { + method = body != null ? 'POST' : 'GET' + path = '/_ingest/_simulate' + } + const meta: TransportRequestMetadata = { + name: 'simulate.ingest', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } +} diff --git a/src/api/api/slm.ts b/src/api/api/slm.ts index c84752269..16f0913c8 100644 --- a/src/api/api/slm.ts +++ b/src/api/api/slm.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Slm { const method = 'DELETE' const path = `/_slm/policy/${encodeURIComponent(params.policy_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.delete_lifecycle', + pathParts: { + policy_id: params.policy_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,13 @@ export default class Slm { const method = 'PUT' const path = `/_slm/policy/${encodeURIComponent(params.policy_id.toString())}/_execute` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.execute_lifecycle', + pathParts: { + policy_id: params.policy_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -119,7 +132,10 @@ export default class Slm { const method = 'POST' const path = '/_slm/_execute_retention' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.execute_retention' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -153,7 +169,13 @@ export default class Slm { method = 'GET' path = '/_slm/policy' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.get_lifecycle', + pathParts: { + policy_id: params.policy_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -180,7 +202,10 @@ export default class Slm { const method = 'GET' const path = '/_slm/stats' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.get_stats' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -207,7 +232,10 @@ export default class Slm { const method = 'GET' const path = '/_slm/status' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.get_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -245,7 +273,13 @@ export default class Slm { const method = 'PUT' const path = `/_slm/policy/${encodeURIComponent(params.policy_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.put_lifecycle', + pathParts: { + policy_id: params.policy_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -272,7 +306,10 @@ export default class Slm { const method = 'POST' const path = '/_slm/start' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.start' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -299,6 +336,9 @@ export default class Slm { const method = 'POST' const path = '/_slm/stop' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.stop' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/snapshot.ts b/src/api/api/snapshot.ts index f6a5d3923..cd0f53dcf 100644 --- a/src/api/api/snapshot.ts +++ b/src/api/api/snapshot.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Snapshot { } /** - * Removes stale data from repository. + * Triggers the review of a snapshot repository’s contents and deletes any stale data not referenced by existing snapshots. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html | Elasticsearch API documentation} */ async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest | TB.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -66,7 +67,13 @@ export default class Snapshot { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.name.toString())}/_cleanup` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.cleanup_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -104,7 +111,15 @@ export default class Snapshot { const method = 'PUT' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}/_clone/${encodeURIComponent(params.target_snapshot.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.clone', + pathParts: { + repository: params.repository, + snapshot: params.snapshot, + target_snapshot: params.target_snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -142,7 +157,14 @@ export default class Snapshot { const method = 'PUT' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.create', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -173,7 +195,13 @@ export default class Snapshot { const method = 'PUT' const path = `/_snapshot/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.create_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -199,7 +227,14 @@ export default class Snapshot { const method = 'DELETE' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.delete', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -225,7 +260,13 @@ export default class Snapshot { const method = 'DELETE' const path = `/_snapshot/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.delete_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -251,7 +292,14 @@ export default class Snapshot { const method = 'GET' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.get', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -285,7 +333,13 @@ export default class Snapshot { method = 'GET' path = '/_snapshot' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.get_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -311,7 +365,13 @@ export default class Snapshot { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/_analyze` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.repository_analyze', + pathParts: { + repository: params.repository + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -349,7 +409,14 @@ export default class Snapshot { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}/_restore` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.restore', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -386,7 +453,14 @@ export default class Snapshot { method = 'GET' path = '/_snapshot/_status' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.status', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -412,6 +486,12 @@ export default class Snapshot { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.name.toString())}/_verify` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.verify_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/sql.ts b/src/api/api/sql.ts index 05e597545..fbd30e803 100644 --- a/src/api/api/sql.ts +++ b/src/api/api/sql.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -78,7 +79,10 @@ export default class Sql { const method = 'POST' const path = '/_sql/close' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.clear_cursor' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -104,7 +108,13 @@ export default class Sql { const method = 'DELETE' const path = `/_sql/async/delete/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.delete_async', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -130,7 +140,13 @@ export default class Sql { const method = 'GET' const path = `/_sql/async/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.get_async', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -156,7 +172,13 @@ export default class Sql { const method = 'GET' const path = `/_sql/async/status/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.get_async_status', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -195,7 +217,10 @@ export default class Sql { const method = body != null ? 'POST' : 'GET' const path = '/_sql' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.query' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -233,6 +258,9 @@ export default class Sql { const method = body != null ? 'POST' : 'GET' const path = '/_sql/translate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.translate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/ssl.ts b/src/api/api/ssl.ts index 198146ad1..9ace268c1 100644 --- a/src/api/api/ssl.ts +++ b/src/api/api/ssl.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -67,6 +68,9 @@ export default class Ssl { const method = 'GET' const path = '/_ssl/certificates' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ssl.certificates' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/synonyms.ts b/src/api/api/synonyms.ts index 80ba96536..abbf98749 100644 --- a/src/api/api/synonyms.ts +++ b/src/api/api/synonyms.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Synonyms { const method = 'DELETE' const path = `/_synonyms/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.delete_synonym', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,14 @@ export default class Synonyms { 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) + const meta: TransportRequestMetadata = { + name: 'synonyms.delete_synonym_rule', + pathParts: { + set_id: params.set_id, + rule_id: params.rule_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -118,7 +132,13 @@ export default class Synonyms { const method = 'GET' const path = `/_synonyms/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.get_synonym', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -144,7 +164,14 @@ export default class Synonyms { 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) + const meta: TransportRequestMetadata = { + name: 'synonyms.get_synonym_rule', + pathParts: { + set_id: params.set_id, + rule_id: params.rule_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -171,11 +198,14 @@ export default class Synonyms { const method = 'GET' const path = '/_synonyms' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.get_synonyms_sets' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Creates or updates a synonyms set + * Creates or updates a synonym 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 @@ -209,7 +239,13 @@ export default class Synonyms { const method = 'PUT' const path = `/_synonyms/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.put_synonym', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -247,6 +283,13 @@ export default class Synonyms { 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) + const meta: TransportRequestMetadata = { + name: 'synonyms.put_synonym_rule', + pathParts: { + set_id: params.set_id, + rule_id: params.rule_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/tasks.ts b/src/api/api/tasks.ts index a3cdcb968..8f54ef0e4 100644 --- a/src/api/api/tasks.ts +++ b/src/api/api/tasks.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -74,7 +75,13 @@ export default class Tasks { method = 'POST' path = '/_tasks/_cancel' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'tasks.cancel', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -100,11 +107,17 @@ export default class Tasks { const method = 'GET' const path = `/_tasks/${encodeURIComponent(params.task_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'tasks.get', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Returns a list of tasks. + * The task management API returns information about tasks currently executing on one or more nodes in the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html | Elasticsearch API documentation} */ async list (this: That, params?: T.TasksListRequest | TB.TasksListRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -127,6 +140,9 @@ export default class Tasks { const method = 'GET' const path = '/_tasks' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'tasks.list' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/terms_enum.ts b/src/api/api/terms_enum.ts index db54a8c40..1dd51ece7 100644 --- a/src/api/api/terms_enum.ts +++ b/src/api/api/terms_enum.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function TermsEnumApi (this: That, params: T.TermsEnumReque const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_terms_enum` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'terms_enum', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/termvectors.ts b/src/api/api/termvectors.ts index 6ffee1fa1..956c4df14 100644 --- a/src/api/api/termvectors.ts +++ b/src/api/api/termvectors.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -79,5 +80,12 @@ export default async function TermvectorsApi (this: That, p method = body != null ? 'POST' : 'GET' path = `/${encodeURIComponent(params.index.toString())}/_termvectors` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'termvectors', + pathParts: { + index: params.index, + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/text_structure.ts b/src/api/api/text_structure.ts index ba75e1c39..972556a6d 100644 --- a/src/api/api/text_structure.ts +++ b/src/api/api/text_structure.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -43,6 +44,64 @@ export default class TextStructure { this.transport = transport } + /** + * Finds the structure of a text field in an index. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/find-field-structure.html | Elasticsearch API documentation} + */ + async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async findFieldStructure (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_text_structure/find_field_structure' + const meta: TransportRequestMetadata = { + name: 'text_structure.find_field_structure' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/find-message-structure.html | Elasticsearch API documentation} + */ + async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async findMessageStructure (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + const method = body != null ? 'POST' : 'GET' + const path = '/_text_structure/find_message_structure' + const meta: TransportRequestMetadata = { + name: 'text_structure.find_message_structure' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + /** * Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/find-structure.html | Elasticsearch API documentation} @@ -71,7 +130,10 @@ export default class TextStructure { const method = 'POST' const path = '/_text_structure/find_structure' - return await this.transport.request({ path, method, querystring, bulkBody: body }, options) + const meta: TransportRequestMetadata = { + name: 'text_structure.find_structure' + } + return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } /** @@ -109,6 +171,9 @@ export default class TextStructure { const method = body != null ? 'POST' : 'GET' const path = '/_text_structure/test_grok_pattern' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'text_structure.test_grok_pattern' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/transform.ts b/src/api/api/transform.ts index cd472a416..2e3baa8ae 100644 --- a/src/api/api/transform.ts +++ b/src/api/api/transform.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Transform { } /** - * Deletes an existing transform. + * Deletes a transform. * @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 @@ -66,7 +67,42 @@ export default class Transform { const method = 'DELETE' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.delete_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Retrieves transform usage information for transform nodes. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform-node-stats.html | Elasticsearch API documentation} + */ + async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async getNodeStats (this: That, params?: T.TODO | TB.TODO, 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') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_transform/_node_stats' + const meta: TransportRequestMetadata = { + name: 'transform.get_node_stats' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -100,7 +136,13 @@ export default class Transform { method = 'GET' path = '/_transform' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.get_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -126,11 +168,17 @@ export default class Transform { const method = 'GET' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_stats` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.get_transform_stats', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Previews a transform. + * Previews a transform. It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations. * @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> @@ -172,11 +220,17 @@ export default class Transform { method = body != null ? 'POST' : 'GET' path = '/_transform/_preview' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.preview_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Instantiates a transform. + * Creates a transform. A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a unique row per entity. You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values in the latest object. You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and `view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations. NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any `.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not give users any privileges on `.data-frame-internal*` indices. * @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 @@ -210,11 +264,17 @@ export default class Transform { const method = 'PUT' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.put_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Resets an existing transform. + * Resets a transform. Before you can reset it, you must stop it; alternatively, use the `force` query parameter. If the destination index was created by the transform, it is deleted. * @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 @@ -236,11 +296,17 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_reset` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.reset_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Schedules now a transform. + * Schedules now a transform. If you _schedule_now a transform, it will process the new data instantly, without waiting for the configured frequency interval. After _schedule_now API is called, the transform will be processed again at now + frequency unless _schedule_now API is called again in the meantime. * @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 @@ -262,11 +328,17 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_schedule_now` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.schedule_now_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Starts one or more transforms. + * Starts a transform. When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping definitions for the destination index from the source indices and the transform aggregations. If fields in the destination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations), the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings in a pivot transform. When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you created the transform, they occur when you start the transform—with the exception of privilege checks. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations. * @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 @@ -288,7 +360,13 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.start_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -314,11 +392,17 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.stop_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Updates certain properties of a transform. + * Updates certain properties of a transform. All updated properties except `description` do not take effect until after the transform starts the next checkpoint, thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata` privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the time of update and runs with those privileges. * @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 @@ -352,11 +436,17 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.update_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Upgrades all transforms. + * Upgrades all transforms. This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not affect the source and destination indices. The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/upgrade-transforms.html | Elasticsearch API documentation} */ async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -379,6 +469,9 @@ export default class Transform { const method = 'POST' const path = '/_transform/_upgrade' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.upgrade_transforms' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/update.ts b/src/api/api/update.ts index d15e007a0..1f234cda4 100644 --- a/src/api/api/update.ts +++ b/src/api/api/update.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,12 @@ export default async function UpdateApi @@ -72,5 +73,11 @@ export default async function UpdateByQueryApi (this: That, params: T.UpdateByQu const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_update_by_query` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'update_by_query', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/update_by_query_rethrottle.ts b/src/api/api/update_by_query_rethrottle.ts index 370acd548..68f5cd9ed 100644 --- a/src/api/api/update_by_query_rethrottle.ts +++ b/src/api/api/update_by_query_rethrottle.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,11 @@ export default async function UpdateByQueryRethrottleApi (this: That, params: T. const method = 'POST' const path = `/_update_by_query/${encodeURIComponent(params.task_id.toString())}/_rethrottle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'update_by_query_rethrottle', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/watcher.ts b/src/api/api/watcher.ts index 09aca4615..5b98a7593 100644 --- a/src/api/api/watcher.ts +++ b/src/api/api/watcher.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -73,7 +74,14 @@ export default class Watcher { method = 'PUT' path = `/_watcher/watch/${encodeURIComponent(params.watch_id.toString())}/_ack` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.ack_watch', + pathParts: { + watch_id: params.watch_id, + action_id: params.action_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -99,7 +107,13 @@ export default class Watcher { const method = 'PUT' const path = `/_watcher/watch/${encodeURIComponent(params.watch_id.toString())}/_activate` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.activate_watch', + pathParts: { + watch_id: params.watch_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -125,7 +139,13 @@ export default class Watcher { const method = 'PUT' const path = `/_watcher/watch/${encodeURIComponent(params.watch_id.toString())}/_deactivate` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.deactivate_watch', + pathParts: { + watch_id: params.watch_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -151,11 +171,17 @@ export default class Watcher { const method = 'DELETE' const path = `/_watcher/watch/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.delete_watch', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Forces the execution of a stored watch. + * This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes. For testing and debugging purposes, you also have fine-grained control on how the watch runs. You can execute the watch without executing all of its actions or alternatively by simulating them. You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after execution. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-execute-watch.html | Elasticsearch API documentation} */ async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest | TB.WatcherExecuteWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -197,7 +223,13 @@ export default class Watcher { method = 'PUT' path = '/_watcher/watch/_execute' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.execute_watch', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -223,7 +255,10 @@ export default class Watcher { const method = 'GET' const path = '/_watcher/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.get_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -249,7 +284,13 @@ export default class Watcher { const method = 'GET' const path = `/_watcher/watch/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.get_watch', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -287,7 +328,13 @@ export default class Watcher { const method = 'PUT' const path = `/_watcher/watch/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.put_watch', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -326,7 +373,10 @@ export default class Watcher { const method = body != null ? 'POST' : 'GET' const path = '/_watcher/_query/watches' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.query_watches' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -353,7 +403,10 @@ export default class Watcher { const method = 'POST' const path = '/_watcher/_start' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.start' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -387,7 +440,13 @@ export default class Watcher { method = 'GET' path = '/_watcher/stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.stats', + pathParts: { + metric: params.metric + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -414,7 +473,10 @@ export default class Watcher { const method = 'POST' const path = '/_watcher/_stop' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.stop' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -440,6 +502,9 @@ export default class Watcher { const method = 'PUT' const path = '/_watcher/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.update_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/xpack.ts b/src/api/api/xpack.ts index c288e8091..3472a080c 100644 --- a/src/api/api/xpack.ts +++ b/src/api/api/xpack.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -44,7 +45,7 @@ export default class Xpack { } /** - * Retrieves information about the installed X-Pack features. + * Provides general information about the installed X-Pack features. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/info-api.html | Elasticsearch API documentation} */ async info (this: That, params?: T.XpackInfoRequest | TB.XpackInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -67,11 +68,14 @@ export default class Xpack { const method = 'GET' const path = '/_xpack' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'xpack.info' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Retrieves usage information about the installed X-Pack features. + * This API provides information about which features are currently enabled and available under the current license and some usage statistics. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/usage-api.html | Elasticsearch API documentation} */ async usage (this: That, params?: T.XpackUsageRequest | TB.XpackUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -94,6 +98,9 @@ export default class Xpack { const method = 'GET' const path = '/_xpack/usage' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'xpack.usage' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/index.ts b/src/api/index.ts index 286a59bb7..e2ef990bb 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -29,6 +29,7 @@ import AsyncSearchApi from './api/async_search' import AutoscalingApi from './api/autoscaling' import bulkApi from './api/bulk' +import capabilitiesApi from './api/capabilities' import CatApi from './api/cat' import CcrApi from './api/ccr' import clearScrollApi from './api/clear_scroll' @@ -76,8 +77,9 @@ import mtermvectorsApi from './api/mtermvectors' import NodesApi from './api/nodes' import openPointInTimeApi from './api/open_point_in_time' import pingApi from './api/ping' +import ProfilingApi from './api/profiling' import putScriptApi from './api/put_script' -import QueryRulesetApi from './api/query_ruleset' +import QueryRulesApi from './api/query_rules' import rankEvalApi from './api/rank_eval' import reindexApi from './api/reindex' import reindexRethrottleApi from './api/reindex_rethrottle' @@ -93,6 +95,7 @@ import searchTemplateApi from './api/search_template' import SearchableSnapshotsApi from './api/searchable_snapshots' import SecurityApi from './api/security' import ShutdownApi from './api/shutdown' +import SimulateApi from './api/simulate' import SlmApi from './api/slm' import SnapshotApi from './api/snapshot' import SqlApi from './api/sql' @@ -114,6 +117,7 @@ export default interface API { asyncSearch: AsyncSearchApi autoscaling: AutoscalingApi bulk: typeof bulkApi + capabilities: typeof capabilitiesApi cat: CatApi ccr: CcrApi clearScroll: typeof clearScrollApi @@ -161,8 +165,9 @@ export default interface API { nodes: NodesApi openPointInTime: typeof openPointInTimeApi ping: typeof pingApi + profiling: ProfilingApi putScript: typeof putScriptApi - queryRuleset: QueryRulesetApi + queryRules: QueryRulesApi rankEval: typeof rankEvalApi reindex: typeof reindexApi reindexRethrottle: typeof reindexRethrottleApi @@ -178,6 +183,7 @@ export default interface API { searchableSnapshots: SearchableSnapshotsApi security: SecurityApi shutdown: ShutdownApi + simulate: SimulateApi slm: SlmApi snapshot: SnapshotApi sql: SqlApi @@ -217,12 +223,14 @@ const kMigration = Symbol('Migration') const kMl = Symbol('Ml') const kMonitoring = Symbol('Monitoring') const kNodes = Symbol('Nodes') -const kQueryRuleset = Symbol('QueryRuleset') +const kProfiling = Symbol('Profiling') +const kQueryRules = Symbol('QueryRules') const kRollup = Symbol('Rollup') const kSearchApplication = Symbol('SearchApplication') const kSearchableSnapshots = Symbol('SearchableSnapshots') const kSecurity = Symbol('Security') const kShutdown = Symbol('Shutdown') +const kSimulate = Symbol('Simulate') const kSlm = Symbol('Slm') const kSnapshot = Symbol('Snapshot') const kSql = Symbol('Sql') @@ -257,12 +265,14 @@ export default class API { [kMl]: symbol | null [kMonitoring]: symbol | null [kNodes]: symbol | null - [kQueryRuleset]: symbol | null + [kProfiling]: symbol | null + [kQueryRules]: symbol | null [kRollup]: symbol | null [kSearchApplication]: symbol | null [kSearchableSnapshots]: symbol | null [kSecurity]: symbol | null [kShutdown]: symbol | null + [kSimulate]: symbol | null [kSlm]: symbol | null [kSnapshot]: symbol | null [kSql]: symbol | null @@ -296,12 +306,14 @@ export default class API { this[kMl] = null this[kMonitoring] = null this[kNodes] = null - this[kQueryRuleset] = null + this[kProfiling] = null + this[kQueryRules] = null this[kRollup] = null this[kSearchApplication] = null this[kSearchableSnapshots] = null this[kSecurity] = null this[kShutdown] = null + this[kSimulate] = null this[kSlm] = null this[kSnapshot] = null this[kSql] = null @@ -316,6 +328,7 @@ export default class API { } API.prototype.bulk = bulkApi +API.prototype.capabilities = capabilitiesApi API.prototype.clearScroll = clearScrollApi API.prototype.closePointInTime = closePointInTimeApi API.prototype.count = countApi @@ -427,8 +440,11 @@ Object.defineProperties(API.prototype, { nodes: { get () { return this[kNodes] === null ? (this[kNodes] = new NodesApi(this.transport)) : this[kNodes] } }, - queryRuleset: { - get () { return this[kQueryRuleset] === null ? (this[kQueryRuleset] = new QueryRulesetApi(this.transport)) : this[kQueryRuleset] } + profiling: { + get () { return this[kProfiling] === null ? (this[kProfiling] = new ProfilingApi(this.transport)) : this[kProfiling] } + }, + queryRules: { + get () { return this[kQueryRules] === null ? (this[kQueryRules] = new QueryRulesApi(this.transport)) : this[kQueryRules] } }, rollup: { get () { return this[kRollup] === null ? (this[kRollup] = new RollupApi(this.transport)) : this[kRollup] } @@ -445,6 +461,9 @@ Object.defineProperties(API.prototype, { shutdown: { get () { return this[kShutdown] === null ? (this[kShutdown] = new ShutdownApi(this.transport)) : this[kShutdown] } }, + simulate: { + get () { return this[kSimulate] === null ? (this[kSimulate] = new SimulateApi(this.transport)) : this[kSimulate] } + }, slm: { get () { return this[kSlm] === null ? (this[kSlm] = new SlmApi(this.transport)) : this[kSlm] } }, diff --git a/src/api/types.ts b/src/api/types.ts index df17e1cbb..db34c036c 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -95,7 +95,7 @@ export interface BulkUpdateAction @@ -1005,7 +1007,7 @@ export interface ReindexRequest extends RequestBase { conflicts?: Conflicts dest: ReindexDestination max_docs?: long - script?: Script + script?: Script | string size?: long source: ReindexSource } @@ -1102,7 +1104,7 @@ export interface ScriptsPainlessExecutePainlessContextSetup { export interface ScriptsPainlessExecuteRequest extends RequestBase { context?: string context_setup?: ScriptsPainlessExecutePainlessContextSetup - script?: InlineScript | string + script?: Script | string } export interface ScriptsPainlessExecuteResponse { @@ -1427,6 +1429,7 @@ export interface SearchHit { _node?: string _routing?: string _source?: TDocument + _rank?: integer _seq_no?: SequenceNumber _primary_term?: long _version?: VersionNumber @@ -1830,7 +1833,7 @@ export interface TermvectorsRequest extends RequestBase { export interface TermvectorsResponse { found: boolean - _id: Id + _id?: Id _index: IndexName term_vectors?: Record took: long @@ -1846,7 +1849,7 @@ export interface TermvectorsTerm { } export interface TermvectorsTermVector { - field_statistics: TermvectorsFieldStatistics + field_statistics?: TermvectorsFieldStatistics terms: Record } @@ -1874,7 +1877,7 @@ export interface UpdateRequest detect_noop?: boolean doc?: TPartialDocument doc_as_upsert?: boolean - script?: Script + script?: Script | string scripted_upsert?: boolean _source?: SearchSourceConfig upsert?: TDocument @@ -1918,7 +1921,7 @@ export interface UpdateByQueryRequest extends RequestBase { wait_for_completion?: boolean max_docs?: long query?: QueryDslQueryContainer - script?: Script + script?: Script | string slice?: SlicedScroll conflicts?: Conflicts } @@ -2175,9 +2178,10 @@ export interface GeoDistanceSortKeys { ignore_unmapped?: boolean order?: SortOrder unit?: DistanceUnit + nested?: NestedSortValue } export type GeoDistanceSort = GeoDistanceSortKeys -& { [property: string]: GeoLocation | GeoLocation[] | SortMode | GeoDistanceType | boolean | SortOrder | DistanceUnit } +& { [property: string]: GeoLocation | GeoLocation[] | SortMode | GeoDistanceType | boolean | SortOrder | DistanceUnit | NestedSortValue } export type GeoDistanceType = 'arc' | 'plane' @@ -2283,12 +2287,6 @@ export interface InlineGetKeys { export type InlineGet = InlineGetKeys & { [property: string]: any } -export interface InlineScript extends ScriptBase { - lang?: ScriptLanguage - options?: Record - source: string -} - export type Ip = string export interface KnnQuery extends QueryDslQueryBase { @@ -2522,7 +2520,7 @@ export type Routing = string export interface RrfRank { rank_constant?: long - window_size?: long + rank_window_size?: long } export type ScalarValue = long | double | string | boolean | null @@ -2531,14 +2529,16 @@ export interface ScoreSort { order?: SortOrder } -export type Script = InlineScript | string | StoredScriptId - -export interface ScriptBase { +export interface Script { + source?: string + id?: Id params?: Record + lang?: ScriptLanguage + options?: Record } export interface ScriptField { - script: Script + script: Script | string ignore_failure?: boolean } @@ -2546,7 +2546,7 @@ export type ScriptLanguage = 'painless' | 'expression' | 'mustache' | 'java' | s export interface ScriptSort { order?: SortOrder - script: Script + script: Script | string type?: ScriptSortType mode?: SortMode nested?: NestedSortValue @@ -2697,10 +2697,6 @@ export interface StoredScript { source: string } -export interface StoredScriptId extends ScriptBase { - id: Id -} - export type SuggestMode = 'missing' | 'popular' | 'always' export type SuggestionName = string @@ -2948,7 +2944,7 @@ export interface AggregationsAutoDateHistogramAggregation extends AggregationsBu missing?: DateTime offset?: string params?: Record - script?: Script + script?: Script | string time_zone?: TimeZone } @@ -3018,11 +3014,11 @@ export interface AggregationsBucketPathAggregation { } export interface AggregationsBucketScriptAggregation extends AggregationsPipelineAggregationBase { - script?: Script + script?: Script | string } export interface AggregationsBucketSelectorAggregation extends AggregationsPipelineAggregationBase { - script?: Script + script?: Script | string } export interface AggregationsBucketSortAggregation { @@ -3036,7 +3032,7 @@ export type AggregationsBuckets = Record | T export type AggregationsBucketsPath = string | string[] | Record -export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1Y' +export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1y' export interface AggregationsCardinalityAggregate extends AggregationsAggregateBase { value: long @@ -3095,7 +3091,7 @@ export interface AggregationsCompositeAggregationBase { field?: Field missing_bucket?: boolean missing_order?: AggregationsMissingOrder - script?: Script + script?: Script | string value_type?: AggregationsValueType order?: SortOrder } @@ -3166,7 +3162,7 @@ export interface AggregationsDateHistogramAggregation extends AggregationsBucket offset?: Duration order?: AggregationsAggregateOrder params?: Record - script?: Script + script?: Script | string time_zone?: TimeZone keyed?: boolean } @@ -3207,7 +3203,7 @@ export interface AggregationsDerivativeAggregation extends AggregationsPipelineA export interface AggregationsDiversifiedSamplerAggregation extends AggregationsBucketAggregationBase { execution_hint?: AggregationsSamplerAggregationExecutionHint max_docs_per_value?: integer - script?: Script + script?: Script | string shard_size?: integer field?: Field } @@ -3456,7 +3452,7 @@ export interface AggregationsHistogramAggregation extends AggregationsBucketAggr missing?: double offset?: double order?: AggregationsAggregateOrder - script?: Script + script?: Script | string format?: string keyed?: boolean } @@ -3644,7 +3640,7 @@ export interface AggregationsMedianAbsoluteDeviationAggregation extends Aggregat export interface AggregationsMetricAggregationBase { field?: Field missing?: AggregationsMissing - script?: Script + script?: Script | string } export interface AggregationsMinAggregate extends AggregationsSingleMetricAggregateBase { @@ -3798,7 +3794,7 @@ export interface AggregationsRangeAggregation extends AggregationsBucketAggregat field?: Field missing?: integer ranges?: AggregationsAggregationRange[] - script?: Script + script?: Script | string keyed?: boolean format?: string } @@ -3856,7 +3852,7 @@ export interface AggregationsSamplerAggregation extends AggregationsBucketAggreg export type AggregationsSamplerAggregationExecutionHint = 'map' | 'global_ordinals' | 'bytes_hash' export interface AggregationsScriptedHeuristic { - script: Script + script: Script | string } export interface AggregationsScriptedMetricAggregate extends AggregationsAggregateBase { @@ -3864,11 +3860,11 @@ export interface AggregationsScriptedMetricAggregate extends AggregationsAggrega } export interface AggregationsScriptedMetricAggregation extends AggregationsMetricAggregationBase { - combine_script?: Script - init_script?: Script - map_script?: Script + combine_script?: Script | string + init_script?: Script | string + map_script?: Script | string params?: Record - reduce_script?: Script + reduce_script?: Script | string } export interface AggregationsSerialDifferencingAggregation extends AggregationsPipelineAggregationBase { @@ -4081,7 +4077,8 @@ export interface AggregationsTermsAggregation extends AggregationsBucketAggregat missing_bucket?: boolean value_type?: string order?: AggregationsAggregateOrder - script?: Script + script?: Script | string + shard_min_doc_count?: long shard_size?: integer show_term_doc_count_error?: boolean size?: integer @@ -4107,7 +4104,7 @@ export interface AggregationsTermsPartition { export interface AggregationsTestPopulation { field: Field - script?: Script + script?: Script | string filter?: QueryDslQueryContainer } @@ -4180,7 +4177,7 @@ export interface AggregationsVariableWidthHistogramAggregation { buckets?: integer shard_size?: integer initial_buffer?: integer - script?: Script + script?: Script | string } export interface AggregationsVariableWidthHistogramBucketKeys extends AggregationsMultiBucketBase { @@ -4204,7 +4201,7 @@ export interface AggregationsWeightedAverageAggregation { export interface AggregationsWeightedAverageValue { field?: Field missing?: double - script?: Script + script?: Script | string } export interface AggregationsWeightedAvgAggregate extends AggregationsSingleMetricAggregateBase { @@ -4252,7 +4249,7 @@ export interface AnalysisCompoundWordTokenFilterBase extends AnalysisTokenFilter export interface AnalysisConditionTokenFilter extends AnalysisTokenFilterBase { type: 'condition' filter: string[] - script: Script + script: Script | string } export interface AnalysisCustomAnalyzer { @@ -4647,7 +4644,7 @@ export interface AnalysisPorterStemTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisPredicateTokenFilter extends AnalysisTokenFilterBase { type: 'predicate_token_filter' - script: Script + script: Script | string } export interface AnalysisRemoveDuplicatesTokenFilter extends AnalysisTokenFilterBase { @@ -4684,7 +4681,7 @@ export type AnalysisSnowballLanguage = 'Armenian' | 'Basque' | 'Catalan' | 'Dani export interface AnalysisSnowballTokenFilter extends AnalysisTokenFilterBase { type: 'snowball' - language: AnalysisSnowballLanguage + language?: AnalysisSnowballLanguage } export interface AnalysisStandardAnalyzer { @@ -4931,8 +4928,9 @@ export interface MappingDateRangeProperty extends MappingRangePropertyBase { export interface MappingDenseVectorIndexOptions { type: string - m: integer - ef_construction: integer + m?: integer + ef_construction?: integer + confidence_interval?: float } export interface MappingDenseVectorProperty extends MappingPropertyBase { @@ -4965,7 +4963,7 @@ export interface MappingDynamicProperty extends MappingDocValuesPropertyBase { null_value?: FieldValue boost?: double coerce?: boolean - script?: Script + script?: Script | string on_script_error?: MappingOnScriptError ignore_malformed?: boolean time_series_metric?: MappingTimeSeriesMetricType @@ -5043,7 +5041,7 @@ export interface MappingGeoPointProperty extends MappingDocValuesPropertyBase { null_value?: GeoLocation index?: boolean on_script_error?: MappingOnScriptError - script?: Script + script?: Script | string type: 'geo_point' } @@ -5109,7 +5107,7 @@ export interface MappingIpProperty extends MappingDocValuesPropertyBase { ignore_malformed?: boolean null_value?: string on_script_error?: MappingOnScriptError - script?: Script + script?: Script | string time_series_dimension?: boolean type: 'ip' } @@ -5129,7 +5127,7 @@ export interface MappingKeywordProperty extends MappingDocValuesPropertyBase { eager_global_ordinals?: boolean index?: boolean index_options?: MappingIndexOptions - script?: Script + script?: Script | string on_script_error?: MappingOnScriptError normalizer?: string norms?: boolean @@ -5174,7 +5172,7 @@ export interface MappingNumberPropertyBase extends MappingDocValuesPropertyBase ignore_malformed?: boolean index?: boolean on_script_error?: MappingOnScriptError - script?: Script + script?: Script | string time_series_metric?: MappingTimeSeriesMetricType time_series_dimension?: boolean } @@ -5234,7 +5232,7 @@ export interface MappingRuntimeField { input_field?: Field target_field?: Field target_index?: IndexName - script?: Script + script?: Script | string type: MappingRuntimeFieldType } @@ -5422,28 +5420,22 @@ export interface QueryDslConstantScoreQuery extends QueryDslQueryBase { filter: QueryDslQueryContainer } -export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { +export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } -export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { - gt?: DateMath - gte?: DateMath - lt?: DateMath - lte?: DateMath - from?: DateMath | null - to?: DateMath | null +export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { format?: DateFormat time_zone?: TimeZone } -export type QueryDslDecayFunction = QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction +export type QueryDslDecayFunction = QueryDslUntypedDecayFunction | QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction -export interface QueryDslDecayFunctionBase { +export interface QueryDslDecayFunctionBase { multi_value_mode?: QueryDslMultiValueMode } @@ -5459,7 +5451,7 @@ export interface QueryDslDisMaxQuery extends QueryDslQueryBase { tie_breaker?: double } -export type QueryDslDistanceFeatureQuery = QueryDslGeoDistanceFeatureQuery | QueryDslDateDistanceFeatureQuery +export type QueryDslDistanceFeatureQuery = QueryDslUntypedDistanceFeatureQuery | QueryDslGeoDistanceFeatureQuery | QueryDslDateDistanceFeatureQuery export interface QueryDslDistanceFeatureQueryBase extends QueryDslQueryBase { origin: TOrigin @@ -5534,10 +5526,10 @@ export interface QueryDslGeoBoundingBoxQueryKeys extends QueryDslQueryBase { export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys & { [property: string]: GeoBounds | QueryDslGeoExecution | QueryDslGeoValidationMethod | boolean | float | string } -export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { +export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5630,7 +5622,7 @@ export interface QueryDslIntervalsFilter { not_containing?: QueryDslIntervalsContainer not_overlapping?: QueryDslIntervalsContainer overlapping?: QueryDslIntervalsContainer - script?: Script + script?: Script | string } export interface QueryDslIntervalsFuzzy { @@ -5785,19 +5777,13 @@ export interface QueryDslNestedQuery extends QueryDslQueryBase { score_mode?: QueryDslChildScoreMode } -export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { - gt?: double - gte?: double - lt?: double - lte?: double - from?: double | null - to?: double | null +export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { } -export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { +export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' @@ -5850,7 +5836,7 @@ export interface QueryDslQueryContainer { dis_max?: QueryDslDisMaxQuery distance_feature?: QueryDslDistanceFeatureQuery exists?: QueryDslExistsQuery - function_score?: QueryDslFunctionScoreQuery + function_score?: QueryDslFunctionScoreQuery | QueryDslFunctionScoreContainer[] fuzzy?: Partial> geo_bounding_box?: QueryDslGeoBoundingBoxQuery geo_distance?: QueryDslGeoDistanceQuery @@ -5878,7 +5864,7 @@ export interface QueryDslQueryContainer { range?: Partial> rank_feature?: QueryDslRankFeatureQuery regexp?: Partial> - rule_query?: QueryDslRuleQuery + rule?: QueryDslRuleQuery script?: QueryDslScriptQuery script_score?: QueryDslScriptScoreQuery semantic?: QueryDslSemanticQuery @@ -5893,6 +5879,7 @@ export interface QueryDslQueryContainer { span_or?: QueryDslSpanOrQuery span_term?: Partial> span_within?: QueryDslSpanWithinQuery + sparse_vector?: QueryDslSparseVectorQuery term?: Partial> terms?: QueryDslTermsQuery terms_set?: Partial> @@ -5936,10 +5923,16 @@ export interface QueryDslRandomScoreFunction { seed?: long | string } -export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermsRangeQuery +export type QueryDslRangeQuery = QueryDslUntypedRangeQuery | QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermRangeQuery -export interface QueryDslRangeQueryBase extends QueryDslQueryBase { +export interface QueryDslRangeQueryBase extends QueryDslQueryBase { relation?: QueryDslRangeRelation + gt?: T + gte?: T + lt?: T + lte?: T + from?: T | null + to?: T | null } export type QueryDslRangeRelation = 'within' | 'contains' | 'intersects' @@ -5981,22 +5974,22 @@ export interface QueryDslRegexpQuery extends QueryDslQueryBase { export interface QueryDslRuleQuery extends QueryDslQueryBase { organic: QueryDslQueryContainer - ruleset_id: Id + ruleset_ids: Id[] match_criteria: any } export interface QueryDslScriptQuery extends QueryDslQueryBase { - script: Script + script: Script | string } export interface QueryDslScriptScoreFunction { - script: Script + script: Script | string } export interface QueryDslScriptScoreQuery extends QueryDslQueryBase { min_score?: float query: QueryDslQueryContainer - script: Script + script: Script | string } export interface QueryDslSemanticQuery extends QueryDslQueryBase { @@ -6097,11 +6090,23 @@ export interface QueryDslSpanWithinQuery extends QueryDslQueryBase { little: QueryDslSpanQuery } +export interface QueryDslSparseVectorQuery extends QueryDslQueryBase { + field: Field + query_vector?: Record + inference_id?: Id + query?: string + prune?: boolean + pruning_config?: QueryDslTokenPruningConfig +} + export interface QueryDslTermQuery extends QueryDslQueryBase { value: FieldValue case_insensitive?: boolean } +export interface QueryDslTermRangeQuery extends QueryDslRangeQueryBase { +} + export interface QueryDslTermsLookup { index: IndexName id: Id @@ -6116,18 +6121,9 @@ export type QueryDslTermsQuery = QueryDslTermsQueryKeys export type QueryDslTermsQueryField = FieldValue[] | QueryDslTermsLookup -export interface QueryDslTermsRangeQuery extends QueryDslRangeQueryBase { - gt?: string - gte?: string - lt?: string - lte?: string - from?: string | null - to?: string | null -} - export interface QueryDslTermsSetQuery extends QueryDslQueryBase { minimum_should_match_field?: Field - minimum_should_match_script?: Script + minimum_should_match_script?: Script | string terms: string[] } @@ -6149,6 +6145,19 @@ export interface QueryDslTypeQuery extends QueryDslQueryBase { value: string } +export interface QueryDslUntypedDecayFunctionKeys extends QueryDslDecayFunctionBase { +} +export type QueryDslUntypedDecayFunction = QueryDslUntypedDecayFunctionKeys +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } + +export interface QueryDslUntypedDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { +} + +export interface QueryDslUntypedRangeQuery extends QueryDslRangeQueryBase { + format?: DateFormat + time_zone?: TimeZone +} + export interface QueryDslWeightedTokensQuery extends QueryDslQueryBase { tokens: Record pruning_config?: QueryDslTokenPruningConfig @@ -6408,28 +6417,39 @@ export interface CatAliasesRequest extends CatCatRequestBase { export type CatAliasesResponse = CatAliasesAliasesRecord[] export interface CatAllocationAllocationRecord { - shards?: string - s?: string - 'disk.indices'?: ByteSize | null - di?: ByteSize | null - diskIndices?: ByteSize | null - 'disk.used'?: ByteSize | null - du?: ByteSize | null - diskUsed?: ByteSize | null - 'disk.avail'?: ByteSize | null - da?: ByteSize | null - diskAvail?: ByteSize | null - 'disk.total'?: ByteSize | null - dt?: ByteSize | null - diskTotal?: ByteSize | null - 'disk.percent'?: Percentage | null - dp?: Percentage | null - diskPercent?: Percentage | null - host?: Host | null - h?: Host | null - ip?: Ip | null - node?: string - n?: string + shards: string + s: string + 'shards.undesired': string | null + 'write_load.forecast': double | null + wlf: double | null + writeLoadForecast: double | null + 'disk.indices.forecast': ByteSize | null + dif: ByteSize | null + diskIndicesForecast: ByteSize | null + 'disk.indices': ByteSize | null + di: ByteSize | null + diskIndices: ByteSize | null + 'disk.used': ByteSize | null + du: ByteSize | null + diskUsed: ByteSize | null + 'disk.avail': ByteSize | null + da: ByteSize | null + diskAvail: ByteSize | null + 'disk.total': ByteSize | null + dt: ByteSize | null + diskTotal: ByteSize | null + 'disk.percent': Percentage | null + dp: Percentage | null + diskPercent: Percentage | null + host: Host | null + h: Host | null + ip: Ip | null + node: string + n: string + 'node.role': string | null + r: string | null + role: string | null + nodeRole: string | null } export interface CatAllocationRequest extends CatCatRequestBase { @@ -9669,12 +9689,13 @@ export interface EqlHitsEvent { _index: IndexName _id: Id _source: TEvent + missing?: boolean fields?: Record } export interface EqlHitsSequence { events: EqlHitsEvent[] - join_keys: any[] + join_keys?: any[] } export interface EqlDeleteRequest extends RequestBase { @@ -9729,14 +9750,32 @@ export type EqlSearchResponse = EqlEqlSearchResponseBase> } export type EsqlQueryResponse = EsqlColumns @@ -10455,6 +10494,7 @@ export interface IndicesMappingLimitSettingsNestedObjects { export interface IndicesMappingLimitSettingsTotalFields { limit?: long + ignore_dynamic_beyond_limit?: boolean } export interface IndicesMerge { @@ -10551,8 +10591,8 @@ export interface IndicesSettingsSimilarityLmj { export interface IndicesSettingsSimilarityScripted { type: 'scripted' - script: Script - weight_script?: Script + script: Script | string + weight_script?: Script | string } export interface IndicesSlowlogSettings { @@ -12227,41 +12267,41 @@ export interface IngestProcessorBase { } export interface IngestProcessorContainer { - attachment?: IngestAttachmentProcessor append?: IngestAppendProcessor - csv?: IngestCsvProcessor + attachment?: IngestAttachmentProcessor + bytes?: IngestBytesProcessor + circle?: IngestCircleProcessor convert?: IngestConvertProcessor + csv?: IngestCsvProcessor date?: IngestDateProcessor date_index_name?: IngestDateIndexNameProcessor + dissect?: IngestDissectProcessor dot_expander?: IngestDotExpanderProcessor + drop?: IngestDropProcessor enrich?: IngestEnrichProcessor fail?: IngestFailProcessor foreach?: IngestForeachProcessor - json?: IngestJsonProcessor - user_agent?: IngestUserAgentProcessor - kv?: IngestKeyValueProcessor geoip?: IngestGeoIpProcessor grok?: IngestGrokProcessor gsub?: IngestGsubProcessor + inference?: IngestInferenceProcessor join?: IngestJoinProcessor + json?: IngestJsonProcessor + kv?: IngestKeyValueProcessor lowercase?: IngestLowercaseProcessor + pipeline?: IngestPipelineProcessor remove?: IngestRemoveProcessor rename?: IngestRenameProcessor reroute?: IngestRerouteProcessor script?: IngestScriptProcessor set?: IngestSetProcessor + set_security_user?: IngestSetSecurityUserProcessor sort?: IngestSortProcessor split?: IngestSplitProcessor trim?: IngestTrimProcessor uppercase?: IngestUppercaseProcessor urldecode?: IngestUrlDecodeProcessor - bytes?: IngestBytesProcessor - dissect?: IngestDissectProcessor - set_security_user?: IngestSetSecurityUserProcessor - pipeline?: IngestPipelineProcessor - drop?: IngestDropProcessor - circle?: IngestCircleProcessor - inference?: IngestInferenceProcessor + user_agent?: IngestUserAgentProcessor } export interface IngestRemoveProcessor extends IngestProcessorBase { @@ -16024,66 +16064,95 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { nodes: Record } -export interface QueryRulesetQueryRule { +export interface QueryRulesQueryRule { rule_id: Id - type: QueryRulesetQueryRuleType - criteria: QueryRulesetQueryRuleCriteria[] - actions: QueryRulesetQueryRuleActions + type: QueryRulesQueryRuleType + criteria: QueryRulesQueryRuleCriteria | QueryRulesQueryRuleCriteria[] + actions: QueryRulesQueryRuleActions + priority?: integer } -export interface QueryRulesetQueryRuleActions { +export interface QueryRulesQueryRuleActions { ids?: Id[] docs?: QueryDslPinnedDoc[] } -export interface QueryRulesetQueryRuleCriteria { - type: QueryRulesetQueryRuleCriteriaType - metadata: string +export interface QueryRulesQueryRuleCriteria { + type: QueryRulesQueryRuleCriteriaType + metadata?: string values?: any[] } -export type QueryRulesetQueryRuleCriteriaType = 'global' | 'exact' | 'exact_fuzzy' | 'prefix' | 'suffix' | 'contains' | 'lt' | 'lte' | 'gt' | 'gte' +export type QueryRulesQueryRuleCriteriaType = 'global' | 'exact' | 'exact_fuzzy' | 'fuzzy' | 'prefix' | 'suffix' | 'contains' | 'lt' | 'lte' | 'gt' | 'gte' | 'always' -export type QueryRulesetQueryRuleType = 'pinned' +export type QueryRulesQueryRuleType = 'pinned' -export interface QueryRulesetQueryRuleset { +export interface QueryRulesQueryRuleset { ruleset_id: Id - rules: QueryRulesetQueryRule[] + rules: QueryRulesQueryRule[] } -export interface QueryRulesetDeleteRequest extends RequestBase { +export interface QueryRulesDeleteRuleRequest extends RequestBase { + ruleset_id: Id + rule_id: Id +} + +export type QueryRulesDeleteRuleResponse = AcknowledgedResponseBase + +export interface QueryRulesDeleteRulesetRequest extends RequestBase { ruleset_id: Id } -export type QueryRulesetDeleteResponse = AcknowledgedResponseBase +export type QueryRulesDeleteRulesetResponse = AcknowledgedResponseBase -export interface QueryRulesetGetRequest extends RequestBase { +export interface QueryRulesGetRuleRequest extends RequestBase { + ruleset_id: Id + rule_id: Id +} + +export type QueryRulesGetRuleResponse = QueryRulesQueryRule + +export interface QueryRulesGetRulesetRequest extends RequestBase { ruleset_id: Id } -export type QueryRulesetGetResponse = QueryRulesetQueryRuleset +export type QueryRulesGetRulesetResponse = QueryRulesQueryRuleset -export interface QueryRulesetListQueryRulesetListItem { +export interface QueryRulesListRulesetsQueryRulesetListItem { ruleset_id: Id - rules_count: integer + rule_total_count: integer + rule_criteria_types_counts: Record } -export interface QueryRulesetListRequest extends RequestBase { +export interface QueryRulesListRulesetsRequest extends RequestBase { from?: integer size?: integer } -export interface QueryRulesetListResponse { +export interface QueryRulesListRulesetsResponse { count: long - results: QueryRulesetListQueryRulesetListItem[] + results: QueryRulesListRulesetsQueryRulesetListItem[] } -export interface QueryRulesetPutRequest extends RequestBase { +export interface QueryRulesPutRuleRequest extends RequestBase { ruleset_id: Id - rules: QueryRulesetQueryRule[] + rule_id: Id + type: QueryRulesQueryRuleType + criteria: QueryRulesQueryRuleCriteria | QueryRulesQueryRuleCriteria[] + actions: QueryRulesQueryRuleActions + priority?: integer } -export interface QueryRulesetPutResponse { +export interface QueryRulesPutRuleResponse { + result: Result +} + +export interface QueryRulesPutRulesetRequest extends RequestBase { + ruleset_id: Id + rules: QueryRulesQueryRule | QueryRulesQueryRule[] +} + +export interface QueryRulesPutRulesetResponse { result: Result } @@ -16291,7 +16360,7 @@ export interface SearchApplicationSearchApplication { } export interface SearchApplicationSearchApplicationTemplate { - script: InlineScript | string + script: Script | string } export interface SearchApplicationDeleteRequest extends RequestBase { @@ -16459,11 +16528,16 @@ export interface SecurityApplicationPrivileges { resources: string[] } +export interface SecurityBulkError { + count: integer + details: Record +} + export interface SecurityClusterNode { name: Name } -export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_connector_secrets' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string +export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string export interface SecurityCreatedStatus { created: boolean @@ -16508,24 +16582,26 @@ export interface SecurityRealmInfo { } export interface SecurityRoleDescriptor { - cluster?: string[] + cluster?: SecurityClusterPrivilege[] indices?: SecurityIndicesPrivileges[] index?: SecurityIndicesPrivileges[] global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege applications?: SecurityApplicationPrivileges[] metadata?: Metadata run_as?: string[] + description?: string transient_metadata?: Record } export interface SecurityRoleDescriptorRead { - cluster: string[] + cluster: SecurityClusterPrivilege[] indices: SecurityIndicesPrivileges[] index: SecurityIndicesPrivileges[] global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege applications?: SecurityApplicationPrivileges[] metadata?: Metadata run_as?: string[] + description?: string transient_metadata?: Record } @@ -16546,23 +16622,23 @@ export interface SecurityRoleMappingRule { export interface SecurityRoleTemplate { format?: SecurityTemplateFormat - template: Script + template: Script | string } export type SecurityRoleTemplateInlineQuery = string | QueryDslQueryContainer -export interface SecurityRoleTemplateInlineScript extends ScriptBase { +export interface SecurityRoleTemplateQuery { + template?: SecurityRoleTemplateScript | SecurityRoleTemplateInlineQuery +} + +export interface SecurityRoleTemplateScript { + source?: SecurityRoleTemplateInlineQuery + id?: Id + params?: Record lang?: ScriptLanguage options?: Record - source: SecurityRoleTemplateInlineQuery } -export interface SecurityRoleTemplateQuery { - template?: SecurityRoleTemplateScript -} - -export type SecurityRoleTemplateScript = SecurityRoleTemplateInlineScript | SecurityRoleTemplateInlineQuery | StoredScriptId - export type SecurityTemplateFormat = 'string' | 'json' export interface SecurityUser { @@ -16643,6 +16719,29 @@ export interface SecurityAuthenticateToken { type?: string } +export interface SecurityBulkDeleteRoleRequest extends RequestBase { + refresh?: Refresh + names: string[] +} + +export interface SecurityBulkDeleteRoleResponse { + deleted?: string[] + not_found?: string[] + errors?: SecurityBulkError +} + +export interface SecurityBulkPutRoleRequest extends RequestBase { + refresh?: Refresh + roles: Record +} + +export interface SecurityBulkPutRoleResponse { + created?: string[] + updated?: string[] + noop?: string[] + errors?: SecurityBulkError +} + export interface SecurityChangePasswordRequest extends RequestBase { username?: Username refresh?: Refresh @@ -17136,6 +17235,7 @@ export interface SecurityPutRoleRequest extends RequestBase { indices?: SecurityIndicesPrivileges[] metadata?: Metadata run_as?: string[] + description?: string transient_metadata?: Record } @@ -17234,6 +17334,72 @@ export interface SecurityQueryApiKeysResponse { aggregations?: Record } +export interface SecurityQueryRoleQueryRole extends SecurityRoleDescriptor { + _sort?: SortResults + name: string +} + +export interface SecurityQueryRoleRequest extends RequestBase { + query?: SecurityQueryRoleRoleQueryContainer + from?: integer + sort?: Sort + size?: integer + search_after?: SortResults +} + +export interface SecurityQueryRoleResponse { + total: integer + count: integer + roles: SecurityQueryRoleQueryRole[] +} + +export interface SecurityQueryRoleRoleQueryContainer { + bool?: QueryDslBoolQuery + exists?: QueryDslExistsQuery + ids?: QueryDslIdsQuery + match?: Partial> + match_all?: QueryDslMatchAllQuery + prefix?: Partial> + range?: Partial> + simple_query_string?: QueryDslSimpleQueryStringQuery + term?: Partial> + terms?: QueryDslTermsQuery + wildcard?: Partial> +} + +export interface SecurityQueryUserQueryUser extends SecurityUser { + _sort?: SortResults +} + +export interface SecurityQueryUserRequest extends RequestBase { + with_profile_uid?: boolean + query?: SecurityQueryUserUserQueryContainer + from?: integer + sort?: Sort + size?: integer + search_after?: SortResults +} + +export interface SecurityQueryUserResponse { + total: integer + count: integer + users: SecurityQueryUserQueryUser[] +} + +export interface SecurityQueryUserUserQueryContainer { + ids?: QueryDslIdsQuery + bool?: QueryDslBoolQuery + exists?: QueryDslExistsQuery + match?: Partial> + match_all?: QueryDslMatchAllQuery + prefix?: Partial> + range?: Partial> + simple_query_string?: QueryDslSimpleQueryStringQuery + term?: Partial> + terms?: QueryDslTermsQuery + wildcard?: Partial> +} + export interface SecuritySamlAuthenticateRequest extends RequestBase { content: string ids: Ids @@ -18395,9 +18561,9 @@ export interface TransformGetTransformStatsTransformIndexerStats { export interface TransformGetTransformStatsTransformProgress { docs_indexed: long docs_processed: long - docs_remaining: long - percent_complete: double - total_docs: long + docs_remaining?: long + percent_complete?: double + total_docs?: long } export interface TransformGetTransformStatsTransformStats { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index c32c3af00..71b7922bd 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -96,7 +96,7 @@ export interface BulkUpdateAction @@ -1046,7 +1048,7 @@ export interface ReindexRequest extends RequestBase { conflicts?: Conflicts dest: ReindexDestination max_docs?: long - script?: Script + script?: Script | string size?: long source: ReindexSource } @@ -1149,7 +1151,7 @@ export interface ScriptsPainlessExecuteRequest extends RequestBase { body?: { context?: string context_setup?: ScriptsPainlessExecutePainlessContextSetup - script?: InlineScript | string + script?: Script | string } } @@ -1482,6 +1484,7 @@ export interface SearchHit { _node?: string _routing?: string _source?: TDocument + _rank?: integer _seq_no?: SequenceNumber _primary_term?: long _version?: VersionNumber @@ -1897,7 +1900,7 @@ export interface TermvectorsRequest extends RequestBase { export interface TermvectorsResponse { found: boolean - _id: Id + _id?: Id _index: IndexName term_vectors?: Record took: long @@ -1913,7 +1916,7 @@ export interface TermvectorsTerm { } export interface TermvectorsTermVector { - field_statistics: TermvectorsFieldStatistics + field_statistics?: TermvectorsFieldStatistics terms: Record } @@ -1943,7 +1946,7 @@ export interface UpdateRequest detect_noop?: boolean doc?: TPartialDocument doc_as_upsert?: boolean - script?: Script + script?: Script | string scripted_upsert?: boolean _source?: SearchSourceConfig upsert?: TDocument @@ -1990,7 +1993,7 @@ export interface UpdateByQueryRequest extends RequestBase { body?: { max_docs?: long query?: QueryDslQueryContainer - script?: Script + script?: Script | string slice?: SlicedScroll conflicts?: Conflicts } @@ -2248,9 +2251,10 @@ export interface GeoDistanceSortKeys { ignore_unmapped?: boolean order?: SortOrder unit?: DistanceUnit + nested?: NestedSortValue } export type GeoDistanceSort = GeoDistanceSortKeys -& { [property: string]: GeoLocation | GeoLocation[] | SortMode | GeoDistanceType | boolean | SortOrder | DistanceUnit } +& { [property: string]: GeoLocation | GeoLocation[] | SortMode | GeoDistanceType | boolean | SortOrder | DistanceUnit | NestedSortValue } export type GeoDistanceType = 'arc' | 'plane' @@ -2356,12 +2360,6 @@ export interface InlineGetKeys { export type InlineGet = InlineGetKeys & { [property: string]: any } -export interface InlineScript extends ScriptBase { - lang?: ScriptLanguage - options?: Record - source: string -} - export type Ip = string export interface KnnQuery extends QueryDslQueryBase { @@ -2595,7 +2593,7 @@ export type Routing = string export interface RrfRank { rank_constant?: long - window_size?: long + rank_window_size?: long } export type ScalarValue = long | double | string | boolean | null @@ -2604,14 +2602,16 @@ export interface ScoreSort { order?: SortOrder } -export type Script = InlineScript | string | StoredScriptId - -export interface ScriptBase { +export interface Script { + source?: string + id?: Id params?: Record + lang?: ScriptLanguage + options?: Record } export interface ScriptField { - script: Script + script: Script | string ignore_failure?: boolean } @@ -2619,7 +2619,7 @@ export type ScriptLanguage = 'painless' | 'expression' | 'mustache' | 'java' | s export interface ScriptSort { order?: SortOrder - script: Script + script: Script | string type?: ScriptSortType mode?: SortMode nested?: NestedSortValue @@ -2770,10 +2770,6 @@ export interface StoredScript { source: string } -export interface StoredScriptId extends ScriptBase { - id: Id -} - export type SuggestMode = 'missing' | 'popular' | 'always' export type SuggestionName = string @@ -3021,7 +3017,7 @@ export interface AggregationsAutoDateHistogramAggregation extends AggregationsBu missing?: DateTime offset?: string params?: Record - script?: Script + script?: Script | string time_zone?: TimeZone } @@ -3091,11 +3087,11 @@ export interface AggregationsBucketPathAggregation { } export interface AggregationsBucketScriptAggregation extends AggregationsPipelineAggregationBase { - script?: Script + script?: Script | string } export interface AggregationsBucketSelectorAggregation extends AggregationsPipelineAggregationBase { - script?: Script + script?: Script | string } export interface AggregationsBucketSortAggregation { @@ -3109,7 +3105,7 @@ export type AggregationsBuckets = Record | T export type AggregationsBucketsPath = string | string[] | Record -export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1Y' +export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1y' export interface AggregationsCardinalityAggregate extends AggregationsAggregateBase { value: long @@ -3168,7 +3164,7 @@ export interface AggregationsCompositeAggregationBase { field?: Field missing_bucket?: boolean missing_order?: AggregationsMissingOrder - script?: Script + script?: Script | string value_type?: AggregationsValueType order?: SortOrder } @@ -3239,7 +3235,7 @@ export interface AggregationsDateHistogramAggregation extends AggregationsBucket offset?: Duration order?: AggregationsAggregateOrder params?: Record - script?: Script + script?: Script | string time_zone?: TimeZone keyed?: boolean } @@ -3280,7 +3276,7 @@ export interface AggregationsDerivativeAggregation extends AggregationsPipelineA export interface AggregationsDiversifiedSamplerAggregation extends AggregationsBucketAggregationBase { execution_hint?: AggregationsSamplerAggregationExecutionHint max_docs_per_value?: integer - script?: Script + script?: Script | string shard_size?: integer field?: Field } @@ -3529,7 +3525,7 @@ export interface AggregationsHistogramAggregation extends AggregationsBucketAggr missing?: double offset?: double order?: AggregationsAggregateOrder - script?: Script + script?: Script | string format?: string keyed?: boolean } @@ -3717,7 +3713,7 @@ export interface AggregationsMedianAbsoluteDeviationAggregation extends Aggregat export interface AggregationsMetricAggregationBase { field?: Field missing?: AggregationsMissing - script?: Script + script?: Script | string } export interface AggregationsMinAggregate extends AggregationsSingleMetricAggregateBase { @@ -3871,7 +3867,7 @@ export interface AggregationsRangeAggregation extends AggregationsBucketAggregat field?: Field missing?: integer ranges?: AggregationsAggregationRange[] - script?: Script + script?: Script | string keyed?: boolean format?: string } @@ -3929,7 +3925,7 @@ export interface AggregationsSamplerAggregation extends AggregationsBucketAggreg export type AggregationsSamplerAggregationExecutionHint = 'map' | 'global_ordinals' | 'bytes_hash' export interface AggregationsScriptedHeuristic { - script: Script + script: Script | string } export interface AggregationsScriptedMetricAggregate extends AggregationsAggregateBase { @@ -3937,11 +3933,11 @@ export interface AggregationsScriptedMetricAggregate extends AggregationsAggrega } export interface AggregationsScriptedMetricAggregation extends AggregationsMetricAggregationBase { - combine_script?: Script - init_script?: Script - map_script?: Script + combine_script?: Script | string + init_script?: Script | string + map_script?: Script | string params?: Record - reduce_script?: Script + reduce_script?: Script | string } export interface AggregationsSerialDifferencingAggregation extends AggregationsPipelineAggregationBase { @@ -4154,7 +4150,8 @@ export interface AggregationsTermsAggregation extends AggregationsBucketAggregat missing_bucket?: boolean value_type?: string order?: AggregationsAggregateOrder - script?: Script + script?: Script | string + shard_min_doc_count?: long shard_size?: integer show_term_doc_count_error?: boolean size?: integer @@ -4180,7 +4177,7 @@ export interface AggregationsTermsPartition { export interface AggregationsTestPopulation { field: Field - script?: Script + script?: Script | string filter?: QueryDslQueryContainer } @@ -4253,7 +4250,7 @@ export interface AggregationsVariableWidthHistogramAggregation { buckets?: integer shard_size?: integer initial_buffer?: integer - script?: Script + script?: Script | string } export interface AggregationsVariableWidthHistogramBucketKeys extends AggregationsMultiBucketBase { @@ -4277,7 +4274,7 @@ export interface AggregationsWeightedAverageAggregation { export interface AggregationsWeightedAverageValue { field?: Field missing?: double - script?: Script + script?: Script | string } export interface AggregationsWeightedAvgAggregate extends AggregationsSingleMetricAggregateBase { @@ -4325,7 +4322,7 @@ export interface AnalysisCompoundWordTokenFilterBase extends AnalysisTokenFilter export interface AnalysisConditionTokenFilter extends AnalysisTokenFilterBase { type: 'condition' filter: string[] - script: Script + script: Script | string } export interface AnalysisCustomAnalyzer { @@ -4720,7 +4717,7 @@ export interface AnalysisPorterStemTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisPredicateTokenFilter extends AnalysisTokenFilterBase { type: 'predicate_token_filter' - script: Script + script: Script | string } export interface AnalysisRemoveDuplicatesTokenFilter extends AnalysisTokenFilterBase { @@ -4757,7 +4754,7 @@ export type AnalysisSnowballLanguage = 'Armenian' | 'Basque' | 'Catalan' | 'Dani export interface AnalysisSnowballTokenFilter extends AnalysisTokenFilterBase { type: 'snowball' - language: AnalysisSnowballLanguage + language?: AnalysisSnowballLanguage } export interface AnalysisStandardAnalyzer { @@ -5004,8 +5001,9 @@ export interface MappingDateRangeProperty extends MappingRangePropertyBase { export interface MappingDenseVectorIndexOptions { type: string - m: integer - ef_construction: integer + m?: integer + ef_construction?: integer + confidence_interval?: float } export interface MappingDenseVectorProperty extends MappingPropertyBase { @@ -5038,7 +5036,7 @@ export interface MappingDynamicProperty extends MappingDocValuesPropertyBase { null_value?: FieldValue boost?: double coerce?: boolean - script?: Script + script?: Script | string on_script_error?: MappingOnScriptError ignore_malformed?: boolean time_series_metric?: MappingTimeSeriesMetricType @@ -5116,7 +5114,7 @@ export interface MappingGeoPointProperty extends MappingDocValuesPropertyBase { null_value?: GeoLocation index?: boolean on_script_error?: MappingOnScriptError - script?: Script + script?: Script | string type: 'geo_point' } @@ -5182,7 +5180,7 @@ export interface MappingIpProperty extends MappingDocValuesPropertyBase { ignore_malformed?: boolean null_value?: string on_script_error?: MappingOnScriptError - script?: Script + script?: Script | string time_series_dimension?: boolean type: 'ip' } @@ -5202,7 +5200,7 @@ export interface MappingKeywordProperty extends MappingDocValuesPropertyBase { eager_global_ordinals?: boolean index?: boolean index_options?: MappingIndexOptions - script?: Script + script?: Script | string on_script_error?: MappingOnScriptError normalizer?: string norms?: boolean @@ -5247,7 +5245,7 @@ export interface MappingNumberPropertyBase extends MappingDocValuesPropertyBase ignore_malformed?: boolean index?: boolean on_script_error?: MappingOnScriptError - script?: Script + script?: Script | string time_series_metric?: MappingTimeSeriesMetricType time_series_dimension?: boolean } @@ -5307,7 +5305,7 @@ export interface MappingRuntimeField { input_field?: Field target_field?: Field target_index?: IndexName - script?: Script + script?: Script | string type: MappingRuntimeFieldType } @@ -5495,28 +5493,22 @@ export interface QueryDslConstantScoreQuery extends QueryDslQueryBase { filter: QueryDslQueryContainer } -export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { +export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } -export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { - gt?: DateMath - gte?: DateMath - lt?: DateMath - lte?: DateMath - from?: DateMath | null - to?: DateMath | null +export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { format?: DateFormat time_zone?: TimeZone } -export type QueryDslDecayFunction = QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction +export type QueryDslDecayFunction = QueryDslUntypedDecayFunction | QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction -export interface QueryDslDecayFunctionBase { +export interface QueryDslDecayFunctionBase { multi_value_mode?: QueryDslMultiValueMode } @@ -5532,7 +5524,7 @@ export interface QueryDslDisMaxQuery extends QueryDslQueryBase { tie_breaker?: double } -export type QueryDslDistanceFeatureQuery = QueryDslGeoDistanceFeatureQuery | QueryDslDateDistanceFeatureQuery +export type QueryDslDistanceFeatureQuery = QueryDslUntypedDistanceFeatureQuery | QueryDslGeoDistanceFeatureQuery | QueryDslDateDistanceFeatureQuery export interface QueryDslDistanceFeatureQueryBase extends QueryDslQueryBase { origin: TOrigin @@ -5607,10 +5599,10 @@ export interface QueryDslGeoBoundingBoxQueryKeys extends QueryDslQueryBase { export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys & { [property: string]: GeoBounds | QueryDslGeoExecution | QueryDslGeoValidationMethod | boolean | float | string } -export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { +export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5703,7 +5695,7 @@ export interface QueryDslIntervalsFilter { not_containing?: QueryDslIntervalsContainer not_overlapping?: QueryDslIntervalsContainer overlapping?: QueryDslIntervalsContainer - script?: Script + script?: Script | string } export interface QueryDslIntervalsFuzzy { @@ -5858,19 +5850,13 @@ export interface QueryDslNestedQuery extends QueryDslQueryBase { score_mode?: QueryDslChildScoreMode } -export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { - gt?: double - gte?: double - lt?: double - lte?: double - from?: double | null - to?: double | null +export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { } -export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { +export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' @@ -5923,7 +5909,7 @@ export interface QueryDslQueryContainer { dis_max?: QueryDslDisMaxQuery distance_feature?: QueryDslDistanceFeatureQuery exists?: QueryDslExistsQuery - function_score?: QueryDslFunctionScoreQuery + function_score?: QueryDslFunctionScoreQuery | QueryDslFunctionScoreContainer[] fuzzy?: Partial> geo_bounding_box?: QueryDslGeoBoundingBoxQuery geo_distance?: QueryDslGeoDistanceQuery @@ -5951,7 +5937,7 @@ export interface QueryDslQueryContainer { range?: Partial> rank_feature?: QueryDslRankFeatureQuery regexp?: Partial> - rule_query?: QueryDslRuleQuery + rule?: QueryDslRuleQuery script?: QueryDslScriptQuery script_score?: QueryDslScriptScoreQuery semantic?: QueryDslSemanticQuery @@ -5966,6 +5952,7 @@ export interface QueryDslQueryContainer { span_or?: QueryDslSpanOrQuery span_term?: Partial> span_within?: QueryDslSpanWithinQuery + sparse_vector?: QueryDslSparseVectorQuery term?: Partial> terms?: QueryDslTermsQuery terms_set?: Partial> @@ -6009,10 +5996,16 @@ export interface QueryDslRandomScoreFunction { seed?: long | string } -export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermsRangeQuery +export type QueryDslRangeQuery = QueryDslUntypedRangeQuery | QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermRangeQuery -export interface QueryDslRangeQueryBase extends QueryDslQueryBase { +export interface QueryDslRangeQueryBase extends QueryDslQueryBase { relation?: QueryDslRangeRelation + gt?: T + gte?: T + lt?: T + lte?: T + from?: T | null + to?: T | null } export type QueryDslRangeRelation = 'within' | 'contains' | 'intersects' @@ -6054,22 +6047,22 @@ export interface QueryDslRegexpQuery extends QueryDslQueryBase { export interface QueryDslRuleQuery extends QueryDslQueryBase { organic: QueryDslQueryContainer - ruleset_id: Id + ruleset_ids: Id[] match_criteria: any } export interface QueryDslScriptQuery extends QueryDslQueryBase { - script: Script + script: Script | string } export interface QueryDslScriptScoreFunction { - script: Script + script: Script | string } export interface QueryDslScriptScoreQuery extends QueryDslQueryBase { min_score?: float query: QueryDslQueryContainer - script: Script + script: Script | string } export interface QueryDslSemanticQuery extends QueryDslQueryBase { @@ -6170,11 +6163,23 @@ export interface QueryDslSpanWithinQuery extends QueryDslQueryBase { little: QueryDslSpanQuery } +export interface QueryDslSparseVectorQuery extends QueryDslQueryBase { + field: Field + query_vector?: Record + inference_id?: Id + query?: string + prune?: boolean + pruning_config?: QueryDslTokenPruningConfig +} + export interface QueryDslTermQuery extends QueryDslQueryBase { value: FieldValue case_insensitive?: boolean } +export interface QueryDslTermRangeQuery extends QueryDslRangeQueryBase { +} + export interface QueryDslTermsLookup { index: IndexName id: Id @@ -6189,18 +6194,9 @@ export type QueryDslTermsQuery = QueryDslTermsQueryKeys export type QueryDslTermsQueryField = FieldValue[] | QueryDslTermsLookup -export interface QueryDslTermsRangeQuery extends QueryDslRangeQueryBase { - gt?: string - gte?: string - lt?: string - lte?: string - from?: string | null - to?: string | null -} - export interface QueryDslTermsSetQuery extends QueryDslQueryBase { minimum_should_match_field?: Field - minimum_should_match_script?: Script + minimum_should_match_script?: Script | string terms: string[] } @@ -6222,6 +6218,19 @@ export interface QueryDslTypeQuery extends QueryDslQueryBase { value: string } +export interface QueryDslUntypedDecayFunctionKeys extends QueryDslDecayFunctionBase { +} +export type QueryDslUntypedDecayFunction = QueryDslUntypedDecayFunctionKeys +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } + +export interface QueryDslUntypedDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { +} + +export interface QueryDslUntypedRangeQuery extends QueryDslRangeQueryBase { + format?: DateFormat + time_zone?: TimeZone +} + export interface QueryDslWeightedTokensQuery extends QueryDslQueryBase { tokens: Record pruning_config?: QueryDslTokenPruningConfig @@ -6485,28 +6494,39 @@ export interface CatAliasesRequest extends CatCatRequestBase { export type CatAliasesResponse = CatAliasesAliasesRecord[] export interface CatAllocationAllocationRecord { - shards?: string - s?: string - 'disk.indices'?: ByteSize | null - di?: ByteSize | null - diskIndices?: ByteSize | null - 'disk.used'?: ByteSize | null - du?: ByteSize | null - diskUsed?: ByteSize | null - 'disk.avail'?: ByteSize | null - da?: ByteSize | null - diskAvail?: ByteSize | null - 'disk.total'?: ByteSize | null - dt?: ByteSize | null - diskTotal?: ByteSize | null - 'disk.percent'?: Percentage | null - dp?: Percentage | null - diskPercent?: Percentage | null - host?: Host | null - h?: Host | null - ip?: Ip | null - node?: string - n?: string + shards: string + s: string + 'shards.undesired': string | null + 'write_load.forecast': double | null + wlf: double | null + writeLoadForecast: double | null + 'disk.indices.forecast': ByteSize | null + dif: ByteSize | null + diskIndicesForecast: ByteSize | null + 'disk.indices': ByteSize | null + di: ByteSize | null + diskIndices: ByteSize | null + 'disk.used': ByteSize | null + du: ByteSize | null + diskUsed: ByteSize | null + 'disk.avail': ByteSize | null + da: ByteSize | null + diskAvail: ByteSize | null + 'disk.total': ByteSize | null + dt: ByteSize | null + diskTotal: ByteSize | null + 'disk.percent': Percentage | null + dp: Percentage | null + diskPercent: Percentage | null + host: Host | null + h: Host | null + ip: Ip | null + node: string + n: string + 'node.role': string | null + r: string | null + role: string | null + nodeRole: string | null } export interface CatAllocationRequest extends CatCatRequestBase { @@ -9821,12 +9841,13 @@ export interface EqlHitsEvent { _index: IndexName _id: Id _source: TEvent + missing?: boolean fields?: Record } export interface EqlHitsSequence { events: EqlHitsEvent[] - join_keys: any[] + join_keys?: any[] } export interface EqlDeleteRequest extends RequestBase { @@ -9884,16 +9905,34 @@ export type EqlSearchResponse = EqlEqlSearchResponseBase> } } @@ -10629,6 +10668,7 @@ export interface IndicesMappingLimitSettingsNestedObjects { export interface IndicesMappingLimitSettingsTotalFields { limit?: long + ignore_dynamic_beyond_limit?: boolean } export interface IndicesMerge { @@ -10725,8 +10765,8 @@ export interface IndicesSettingsSimilarityLmj { export interface IndicesSettingsSimilarityScripted { type: 'scripted' - script: Script - weight_script?: Script + script: Script | string + weight_script?: Script | string } export interface IndicesSlowlogSettings { @@ -12452,41 +12492,41 @@ export interface IngestProcessorBase { } export interface IngestProcessorContainer { - attachment?: IngestAttachmentProcessor append?: IngestAppendProcessor - csv?: IngestCsvProcessor + attachment?: IngestAttachmentProcessor + bytes?: IngestBytesProcessor + circle?: IngestCircleProcessor convert?: IngestConvertProcessor + csv?: IngestCsvProcessor date?: IngestDateProcessor date_index_name?: IngestDateIndexNameProcessor + dissect?: IngestDissectProcessor dot_expander?: IngestDotExpanderProcessor + drop?: IngestDropProcessor enrich?: IngestEnrichProcessor fail?: IngestFailProcessor foreach?: IngestForeachProcessor - json?: IngestJsonProcessor - user_agent?: IngestUserAgentProcessor - kv?: IngestKeyValueProcessor geoip?: IngestGeoIpProcessor grok?: IngestGrokProcessor gsub?: IngestGsubProcessor + inference?: IngestInferenceProcessor join?: IngestJoinProcessor + json?: IngestJsonProcessor + kv?: IngestKeyValueProcessor lowercase?: IngestLowercaseProcessor + pipeline?: IngestPipelineProcessor remove?: IngestRemoveProcessor rename?: IngestRenameProcessor reroute?: IngestRerouteProcessor script?: IngestScriptProcessor set?: IngestSetProcessor + set_security_user?: IngestSetSecurityUserProcessor sort?: IngestSortProcessor split?: IngestSplitProcessor trim?: IngestTrimProcessor uppercase?: IngestUppercaseProcessor urldecode?: IngestUrlDecodeProcessor - bytes?: IngestBytesProcessor - dissect?: IngestDissectProcessor - set_security_user?: IngestSetSecurityUserProcessor - pipeline?: IngestPipelineProcessor - drop?: IngestDropProcessor - circle?: IngestCircleProcessor - inference?: IngestInferenceProcessor + user_agent?: IngestUserAgentProcessor } export interface IngestRemoveProcessor extends IngestProcessorBase { @@ -16376,69 +16416,101 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { nodes: Record } -export interface QueryRulesetQueryRule { +export interface QueryRulesQueryRule { rule_id: Id - type: QueryRulesetQueryRuleType - criteria: QueryRulesetQueryRuleCriteria[] - actions: QueryRulesetQueryRuleActions + type: QueryRulesQueryRuleType + criteria: QueryRulesQueryRuleCriteria | QueryRulesQueryRuleCriteria[] + actions: QueryRulesQueryRuleActions + priority?: integer } -export interface QueryRulesetQueryRuleActions { +export interface QueryRulesQueryRuleActions { ids?: Id[] docs?: QueryDslPinnedDoc[] } -export interface QueryRulesetQueryRuleCriteria { - type: QueryRulesetQueryRuleCriteriaType - metadata: string +export interface QueryRulesQueryRuleCriteria { + type: QueryRulesQueryRuleCriteriaType + metadata?: string values?: any[] } -export type QueryRulesetQueryRuleCriteriaType = 'global' | 'exact' | 'exact_fuzzy' | 'prefix' | 'suffix' | 'contains' | 'lt' | 'lte' | 'gt' | 'gte' +export type QueryRulesQueryRuleCriteriaType = 'global' | 'exact' | 'exact_fuzzy' | 'fuzzy' | 'prefix' | 'suffix' | 'contains' | 'lt' | 'lte' | 'gt' | 'gte' | 'always' -export type QueryRulesetQueryRuleType = 'pinned' +export type QueryRulesQueryRuleType = 'pinned' -export interface QueryRulesetQueryRuleset { +export interface QueryRulesQueryRuleset { ruleset_id: Id - rules: QueryRulesetQueryRule[] + rules: QueryRulesQueryRule[] } -export interface QueryRulesetDeleteRequest extends RequestBase { +export interface QueryRulesDeleteRuleRequest extends RequestBase { + ruleset_id: Id + rule_id: Id +} + +export type QueryRulesDeleteRuleResponse = AcknowledgedResponseBase + +export interface QueryRulesDeleteRulesetRequest extends RequestBase { ruleset_id: Id } -export type QueryRulesetDeleteResponse = AcknowledgedResponseBase +export type QueryRulesDeleteRulesetResponse = AcknowledgedResponseBase -export interface QueryRulesetGetRequest extends RequestBase { +export interface QueryRulesGetRuleRequest extends RequestBase { + ruleset_id: Id + rule_id: Id +} + +export type QueryRulesGetRuleResponse = QueryRulesQueryRule + +export interface QueryRulesGetRulesetRequest extends RequestBase { ruleset_id: Id } -export type QueryRulesetGetResponse = QueryRulesetQueryRuleset +export type QueryRulesGetRulesetResponse = QueryRulesQueryRuleset -export interface QueryRulesetListQueryRulesetListItem { +export interface QueryRulesListRulesetsQueryRulesetListItem { ruleset_id: Id - rules_count: integer + rule_total_count: integer + rule_criteria_types_counts: Record } -export interface QueryRulesetListRequest extends RequestBase { +export interface QueryRulesListRulesetsRequest extends RequestBase { from?: integer size?: integer } -export interface QueryRulesetListResponse { +export interface QueryRulesListRulesetsResponse { count: long - results: QueryRulesetListQueryRulesetListItem[] + results: QueryRulesListRulesetsQueryRulesetListItem[] } -export interface QueryRulesetPutRequest extends RequestBase { +export interface QueryRulesPutRuleRequest extends RequestBase { ruleset_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?: { - rules: QueryRulesetQueryRule[] + type: QueryRulesQueryRuleType + criteria: QueryRulesQueryRuleCriteria | QueryRulesQueryRuleCriteria[] + actions: QueryRulesQueryRuleActions + priority?: integer } } -export interface QueryRulesetPutResponse { +export interface QueryRulesPutRuleResponse { + result: Result +} + +export interface QueryRulesPutRulesetRequest 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: QueryRulesQueryRule | QueryRulesQueryRule[] + } +} + +export interface QueryRulesPutRulesetResponse { result: Result } @@ -16652,7 +16724,7 @@ export interface SearchApplicationSearchApplication { } export interface SearchApplicationSearchApplicationTemplate { - script: InlineScript | string + script: Script | string } export interface SearchApplicationDeleteRequest extends RequestBase { @@ -16827,11 +16899,16 @@ export interface SecurityApplicationPrivileges { resources: string[] } +export interface SecurityBulkError { + count: integer + details: Record +} + export interface SecurityClusterNode { name: Name } -export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_connector_secrets' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string +export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string export interface SecurityCreatedStatus { created: boolean @@ -16876,24 +16953,26 @@ export interface SecurityRealmInfo { } export interface SecurityRoleDescriptor { - cluster?: string[] + cluster?: SecurityClusterPrivilege[] indices?: SecurityIndicesPrivileges[] index?: SecurityIndicesPrivileges[] global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege applications?: SecurityApplicationPrivileges[] metadata?: Metadata run_as?: string[] + description?: string transient_metadata?: Record } export interface SecurityRoleDescriptorRead { - cluster: string[] + cluster: SecurityClusterPrivilege[] indices: SecurityIndicesPrivileges[] index: SecurityIndicesPrivileges[] global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege applications?: SecurityApplicationPrivileges[] metadata?: Metadata run_as?: string[] + description?: string transient_metadata?: Record } @@ -16914,23 +16993,23 @@ export interface SecurityRoleMappingRule { export interface SecurityRoleTemplate { format?: SecurityTemplateFormat - template: Script + template: Script | string } export type SecurityRoleTemplateInlineQuery = string | QueryDslQueryContainer -export interface SecurityRoleTemplateInlineScript extends ScriptBase { +export interface SecurityRoleTemplateQuery { + template?: SecurityRoleTemplateScript | SecurityRoleTemplateInlineQuery +} + +export interface SecurityRoleTemplateScript { + source?: SecurityRoleTemplateInlineQuery + id?: Id + params?: Record lang?: ScriptLanguage options?: Record - source: SecurityRoleTemplateInlineQuery } -export interface SecurityRoleTemplateQuery { - template?: SecurityRoleTemplateScript -} - -export type SecurityRoleTemplateScript = SecurityRoleTemplateInlineScript | SecurityRoleTemplateInlineQuery | StoredScriptId - export type SecurityTemplateFormat = 'string' | 'json' export interface SecurityUser { @@ -17014,6 +17093,35 @@ export interface SecurityAuthenticateToken { type?: string } +export interface SecurityBulkDeleteRoleRequest extends RequestBase { + refresh?: Refresh + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + names: string[] + } +} + +export interface SecurityBulkDeleteRoleResponse { + deleted?: string[] + not_found?: string[] + errors?: SecurityBulkError +} + +export interface SecurityBulkPutRoleRequest extends RequestBase { + refresh?: Refresh + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + roles: Record + } +} + +export interface SecurityBulkPutRoleResponse { + created?: string[] + updated?: string[] + noop?: string[] + errors?: SecurityBulkError +} + export interface SecurityChangePasswordRequest extends RequestBase { username?: Username refresh?: Refresh @@ -17534,6 +17642,7 @@ export interface SecurityPutRoleRequest extends RequestBase { indices?: SecurityIndicesPrivileges[] metadata?: Metadata run_as?: string[] + description?: string transient_metadata?: Record } } @@ -17643,6 +17752,78 @@ export interface SecurityQueryApiKeysResponse { aggregations?: Record } +export interface SecurityQueryRoleQueryRole extends SecurityRoleDescriptor { + _sort?: SortResults + name: string +} + +export interface SecurityQueryRoleRequest extends RequestBase { + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + query?: SecurityQueryRoleRoleQueryContainer + from?: integer + sort?: Sort + size?: integer + search_after?: SortResults + } +} + +export interface SecurityQueryRoleResponse { + total: integer + count: integer + roles: SecurityQueryRoleQueryRole[] +} + +export interface SecurityQueryRoleRoleQueryContainer { + bool?: QueryDslBoolQuery + exists?: QueryDslExistsQuery + ids?: QueryDslIdsQuery + match?: Partial> + match_all?: QueryDslMatchAllQuery + prefix?: Partial> + range?: Partial> + simple_query_string?: QueryDslSimpleQueryStringQuery + term?: Partial> + terms?: QueryDslTermsQuery + wildcard?: Partial> +} + +export interface SecurityQueryUserQueryUser extends SecurityUser { + _sort?: SortResults +} + +export interface SecurityQueryUserRequest extends RequestBase { + with_profile_uid?: boolean + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + query?: SecurityQueryUserUserQueryContainer + from?: integer + sort?: Sort + size?: integer + search_after?: SortResults + } +} + +export interface SecurityQueryUserResponse { + total: integer + count: integer + users: SecurityQueryUserQueryUser[] +} + +export interface SecurityQueryUserUserQueryContainer { + ids?: QueryDslIdsQuery + bool?: QueryDslBoolQuery + exists?: QueryDslExistsQuery + match?: Partial> + match_all?: QueryDslMatchAllQuery + prefix?: Partial> + range?: Partial> + simple_query_string?: QueryDslSimpleQueryStringQuery + term?: Partial> + terms?: QueryDslTermsQuery + wildcard?: Partial> +} + export interface SecuritySamlAuthenticateRequest extends RequestBase { /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { @@ -18863,9 +19044,9 @@ export interface TransformGetTransformStatsTransformIndexerStats { export interface TransformGetTransformStatsTransformProgress { docs_indexed: long docs_processed: long - docs_remaining: long - percent_complete: double - total_docs: long + docs_remaining?: long + percent_complete?: double + total_docs?: long } export interface TransformGetTransformStatsTransformStats {