diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 191b4c8..3cd7b3f 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -524,7 +524,11 @@ client.info() [discrete] === mget -Allows to get multiple documents in one request. +Get multiple documents. + +Get multiple JSON documents by ID from one or more indices. +If you specify an index in the request URI, you only need to specify the document IDs in the request body. +To ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail. {ref}/docs-multi-get.html[Endpoint documentation] [source,ts] @@ -552,7 +556,23 @@ If the `_source` parameter is `false`, this parameter is ignored. [discrete] === msearch -Allows to execute several search operations in one request. +Run multiple searches. + +The format of the request is similar to the bulk API format and makes use of the newline delimited JSON (NDJSON) format. +The structure is as follows: + +``` +header\n +body\n +header\n +body\n +``` + +This structure is specifically optimized to reduce parsing if a specific search ends up redirected to another node. + +IMPORTANT: The final line of data must end with a newline character `\n`. +Each newline character may be preceded by a carriage return `\r`. +When sending requests to this endpoint the `Content-Type` header should be set to `application/x-ndjson`. {ref}/search-multi-search.html[Endpoint documentation] [source,ts] @@ -611,7 +631,12 @@ If `false`, it returns `hits.total` as an object. [discrete] === mtermvectors -Returns multiple termvectors in one request. +Get multiple term vectors. + +You can specify existing documents by index and ID or provide artificial documents in the body of the request. +You can specify the index in the request body or request URI. +The response contains a `docs` array with all the fetched termvectors. +Each element has the structure provided by the termvectors API. {ref}/docs-multi-termvectors.html[Endpoint documentation] [source,ts] @@ -801,7 +826,20 @@ client.scriptsPainlessExecute({ ... }) [discrete] === scroll -Allows to retrieve a large numbers of results from a single search request. +Run a scrolling search. + +IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT). + +The scroll API gets large sets of results from a single scrolling search request. +To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter. +The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request. +The search response returns a scroll ID in the `_scroll_id` response body parameter. +You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request. +If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search. + +You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context. + +IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests. {ref}/search-request-body.html[Endpoint documentation] [source,ts] @@ -859,7 +897,7 @@ A post filter has no impact on the aggregation results. 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, 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. +** *`retriever` (Optional, { standard, knn, rrf, text_similarity_reranker })*: 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. ** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])*: Used to retrieve the next page of hits using a set of sort values from the previous page. ** *`size` (Optional, number)*: The number of hits to return. @@ -1075,7 +1113,15 @@ should be maintained for scrolled search. [discrete] === terms_enum -The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. +Get terms in an index. + +Discover terms that match a partial string in an index. +This "terms enum" API is designed for low-latency look-ups used in auto-complete scenarios. + +If the `complete` property in the response is false, the returned terms set may be incomplete and should be treated as approximate. +This can occur due to a few reasons, such as a request timeout or a node error. + +NOTE: The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents. {ref}/search-terms-enum.html[Endpoint documentation] [source,ts] @@ -1244,8 +1290,8 @@ Set to `all` or any positive integer up to the total number of shards in the ind === async_search [discrete] ==== delete -Deletes an async search by identifier. -If the search is still running, the search request will be cancelled. +Delete an async search. +If the asynchronous search is still running, it is 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. @@ -1263,7 +1309,8 @@ client.asyncSearch.delete({ id }) [discrete] ==== get -Retrieves the results of a previously submitted async search request given its identifier. +Get async search results. +Retrieve the results of a previously submitted asynchronous search request. 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] @@ -1289,8 +1336,8 @@ By default no timeout is set meaning that the currently available results will b [discrete] ==== status -Get async search status -Retrieves the status of a previously submitted async search request given its identifier, without retrieving search results. +Get async search status. +Retrieve 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] @@ -1307,10 +1354,12 @@ client.asyncSearch.status({ id }) [discrete] ==== submit -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. +Run an async search. +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. Partial results become available following the sort criteria that was requested. + +Warning: Asynchronous search does not support scroll or search requests that include only the suggest section. + +By default, Elasticsearch does not 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] @@ -1829,7 +1878,9 @@ If no response is received before the timeout expires, the request fails and ret === connector [discrete] ==== check_in -Updates the last_seen field in the connector, and sets it to current timestamp +Check in a connector. + +Update the `last_seen` field in the connector and set it to the current timestamp. {ref}/check-in-connector-api.html[Endpoint documentation] [source,ts] @@ -1845,7 +1896,12 @@ client.connector.checkIn({ connector_id }) [discrete] ==== delete -Deletes a connector. +Delete a connector. + +Removes a connector and associated sync jobs. +This is a destructive action that is not recoverable. +NOTE: This action doesn’t delete any API keys, ingest pipelines, or data indices associated with the connector. +These need to be removed manually. {ref}/delete-connector-api.html[Endpoint documentation] [source,ts] @@ -1862,7 +1918,9 @@ client.connector.delete({ connector_id }) [discrete] ==== get -Retrieves a connector. +Get a connector. + +Get the details about a connector. {ref}/get-connector-api.html[Endpoint documentation] [source,ts] @@ -1878,7 +1936,9 @@ client.connector.get({ connector_id }) [discrete] ==== list -Returns existing connectors. +Get all connectors. + +Get information about all connectors. {ref}/list-connector-api.html[Endpoint documentation] [source,ts] @@ -1899,7 +1959,11 @@ client.connector.list({ ... }) [discrete] ==== post -Creates a connector. +Create a connector. + +Connectors are Elasticsearch integrations that bring content from third-party data sources, which can be deployed on Elastic Cloud or hosted on your own infrastructure. +Elastic managed connectors (Native connectors) are a managed service on Elastic Cloud. +Self-managed connectors (Connector clients) are self-managed on your infrastructure. {ref}/create-connector-api.html[Endpoint documentation] [source,ts] @@ -1920,7 +1984,7 @@ client.connector.post({ ... }) [discrete] ==== put -Creates or updates a connector. +Create or update a connector. {ref}/create-connector-api.html[Endpoint documentation] [source,ts] @@ -1942,7 +2006,10 @@ client.connector.put({ ... }) [discrete] ==== sync_job_cancel -Cancels a connector sync job. +Cancel a connector sync job. + +Cancel a connector sync job, which sets the status to cancelling and updates `cancellation_requested_at` to the current time. +The connector service is then responsible for setting the status of connector sync jobs to cancelled. {ref}/cancel-connector-sync-job-api.html[Endpoint documentation] [source,ts] @@ -1958,7 +2025,10 @@ client.connector.syncJobCancel({ connector_sync_job_id }) [discrete] ==== sync_job_delete -Deletes a connector sync job. +Delete a connector sync job. + +Remove a connector sync job and its associated data. +This is a destructive action that is not recoverable. {ref}/delete-connector-sync-job-api.html[Endpoint documentation] [source,ts] @@ -1974,7 +2044,7 @@ client.connector.syncJobDelete({ connector_sync_job_id }) [discrete] ==== sync_job_get -Retrieves a connector sync job. +Get a connector sync job. {ref}/get-connector-sync-job-api.html[Endpoint documentation] [source,ts] @@ -1990,7 +2060,9 @@ client.connector.syncJobGet({ connector_sync_job_id }) [discrete] ==== sync_job_list -Lists connector sync jobs. +Get all connector sync jobs. + +Get information about all stored connector sync jobs listed by their creation date in ascending order. {ref}/list-connector-sync-jobs-api.html[Endpoint documentation] [source,ts] @@ -2010,7 +2082,9 @@ client.connector.syncJobList({ ... }) [discrete] ==== sync_job_post -Creates a connector sync job. +Create a connector sync job. + +Create a connector sync job document in the internal index and initialize its counters and timestamps with default values. {ref}/create-connector-sync-job-api.html[Endpoint documentation] [source,ts] @@ -2028,6 +2102,8 @@ client.connector.syncJobPost({ id }) [discrete] ==== update_active_filtering +Activate the connector draft filter. + Activates the valid draft filtering for a connector. {ref}/update-connector-filtering-api.html[Endpoint documentation] @@ -2044,7 +2120,12 @@ client.connector.updateActiveFiltering({ connector_id }) [discrete] ==== update_api_key_id -Updates the API key id in the connector document +Update the connector API key ID. + +Update the `api_key_id` and `api_key_secret_id` fields of a connector. +You can specify the ID of the API key used for authorization and the ID of the connector secret where the API key is stored. +The connector secret ID is required only for Elastic managed (native) connectors. +Self-managed connectors (connector clients) do not use this field. {ref}/update-connector-api-key-id-api.html[Endpoint documentation] [source,ts] @@ -2062,7 +2143,9 @@ client.connector.updateApiKeyId({ connector_id }) [discrete] ==== update_configuration -Updates the configuration field in the connector document +Update the connector configuration. + +Update the configuration field in the connector document. {ref}/update-connector-configuration-api.html[Endpoint documentation] [source,ts] @@ -2080,7 +2163,11 @@ client.connector.updateConfiguration({ connector_id }) [discrete] ==== update_error -Updates the filtering field in the connector document +Update the connector error field. + +Set the error field for the connector. +If the error provided in the request body is non-null, the connector’s status is updated to error. +Otherwise, if the error is reset to null, the connector status is updated to connected. {ref}/update-connector-error-api.html[Endpoint documentation] [source,ts] @@ -2097,7 +2184,11 @@ client.connector.updateError({ connector_id, error }) [discrete] ==== update_filtering -Updates the filtering field in the connector document +Update the connector filtering. + +Update the draft filtering configuration of a connector and marks the draft validation state as edited. +The filtering draft is activated once validated by the running Elastic connector service. +The filtering property is used to configure sync rules (both basic and advanced) for a connector. {ref}/update-connector-filtering-api.html[Endpoint documentation] [source,ts] @@ -2116,7 +2207,9 @@ client.connector.updateFiltering({ connector_id }) [discrete] ==== update_filtering_validation -Updates the draft filtering validation info for a connector. +Update the connector draft filtering validation. + +Update the draft filtering validation info for a connector. [source,ts] ---- client.connector.updateFilteringValidation({ connector_id, validation }) @@ -2131,7 +2224,9 @@ client.connector.updateFilteringValidation({ connector_id, validation }) [discrete] ==== update_index_name -Updates the index_name in the connector document +Update the connector index name. + +Update the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored. {ref}/update-connector-index-name-api.html[Endpoint documentation] [source,ts] @@ -2148,7 +2243,7 @@ client.connector.updateIndexName({ connector_id, index_name }) [discrete] ==== update_name -Updates the name and description fields in the connector document +Update the connector name and description. {ref}/update-connector-name-description-api.html[Endpoint documentation] [source,ts] @@ -2166,7 +2261,7 @@ client.connector.updateName({ connector_id }) [discrete] ==== update_native -Updates the is_native flag in the connector document +Update the connector is_native flag. [source,ts] ---- client.connector.updateNative({ connector_id, is_native }) @@ -2181,7 +2276,9 @@ client.connector.updateNative({ connector_id, is_native }) [discrete] ==== update_pipeline -Updates the pipeline field in the connector document +Update the connector pipeline. + +When you create a new connector, the configuration of an ingest pipeline is populated with default settings. {ref}/update-connector-pipeline-api.html[Endpoint documentation] [source,ts] @@ -2198,7 +2295,7 @@ client.connector.updatePipeline({ connector_id, pipeline }) [discrete] ==== update_scheduling -Updates the scheduling field in the connector document +Update the connector scheduling. {ref}/update-connector-scheduling-api.html[Endpoint documentation] [source,ts] @@ -2215,7 +2312,7 @@ client.connector.updateScheduling({ connector_id, scheduling }) [discrete] ==== update_service_type -Updates the service type of the connector +Update the connector service type. {ref}/update-connector-service-type-api.html[Endpoint documentation] [source,ts] @@ -2232,7 +2329,7 @@ client.connector.updateServiceType({ connector_id, service_type }) [discrete] ==== update_status -Updates the status of the connector +Update the connector status. {ref}/update-connector-status-api.html[Endpoint documentation] [source,ts] @@ -2321,18 +2418,6 @@ client.enrich.putPolicy({ name }) ** *`match` (Optional, { enrich_fields, indices, match_field, query, name, elasticsearch_version })*: Matches enrich data to incoming documents based on a `term` query. ** *`range` (Optional, { enrich_fields, indices, match_field, query, name, elasticsearch_version })*: Matches a number, date, or IP address in incoming documents to a range in the enrich index based on a `term` query. -[discrete] -==== stats -Get enrich stats. -Returns enrich coordinator statistics and information about enrich policies that are currently executing. - -{ref}/enrich-stats-api.html[Endpoint documentation] -[source,ts] ----- -client.enrich.stats() ----- - - [discrete] === eql [discrete] @@ -2419,6 +2504,9 @@ client.eql.search({ index, query }) ** *`fields` (Optional, { field, format, include_unmapped } | { field, format, include_unmapped }[])*: Array of wildcard (*) patterns. The response returns values for field names matching these patterns in the fields property of each hit. ** *`result_position` (Optional, Enum("tail" | "head"))* ** *`runtime_mappings` (Optional, Record)* +** *`max_samples_per_key` (Optional, number)*: By default, the response of a sample query contains up to `10` samples, with one sample per unique set of join keys. Use the `size` +parameter to get a smaller or larger set of samples. To retrieve more than one sample per set of join keys, use the +`max_samples_per_key` parameter. Pipes are not supported for sample queries. ** *`allow_no_indices` (Optional, boolean)* ** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])* ** *`ignore_unavailable` (Optional, boolean)*: If true, missing or closed indices are not included in the response. @@ -2508,7 +2596,8 @@ client.indices.addBlock({ index, block }) [discrete] ==== analyze -Performs analysis on a text string and returns the resulting tokens. +Get tokens from text analysis. +The analyze API performs [analysis](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html) on a text string and returns the resulting tokens. {ref}/indices-analyze.html[Endpoint documentation] [source,ts] @@ -2646,26 +2735,6 @@ If no response is received before the timeout expires, the request fails and ret ** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. -[discrete] -==== delete_data_lifecycle -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] ----- -client.indices.deleteDataLifecycle({ name }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`name` (string | string[])*: A list of data streams of which the data stream lifecycle will be deleted; use `*` to get all data streams -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether wildcard expressions should get expanded to open or closed indices (default: open) -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit timestamp for the document - [discrete] ==== delete_data_stream Delete data streams. @@ -3094,11 +3163,7 @@ client.indices.putDataLifecycle({ name }) ** *`name` (string | string[])*: List of data streams used to limit the request. Supports wildcards (`*`). To target all data streams use `*` or `_all`. -** *`data_retention` (Optional, string | -1 | 0)*: If defined, every document added to this data stream will be stored at least for this time frame. -Any time after this duration the document could be deleted. -When empty, every document in this data stream will be stored indefinitely. -** *`downsampling` (Optional, { rounds })*: If defined, every backing index will execute the configured downsampling configuration after the backing -index is not the data stream write index anymore. +** *`lifecycle` (Optional, { data_retention, downsampling, enabled })* ** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of data stream that wildcard patterns can match. Supports a list of values, such as `open,hidden`. Valid values are: `all`, `hidden`, `open`, `closed`, `none`. @@ -3129,7 +3194,7 @@ client.indices.putIndexTemplate({ name }) Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. ** *`template` (Optional, { aliases, mappings, settings, lifecycle })*: Template to be applied. It may optionally include an `aliases`, `mappings`, or `settings` configuration. -** *`data_stream` (Optional, { hidden })*: If this object is included, the template is used to create data streams and their backing indices. +** *`data_stream` (Optional, { hidden, allow_custom_routing })*: If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a `data_stream` object. ** *`priority` (Optional, number)*: Priority to determine index template precedence when a new data stream or index is created. @@ -3182,7 +3247,7 @@ a new date field is added instead of string. not used at all by Elasticsearch, but can be used to store application-specific metadata. ** *`numeric_detection` (Optional, boolean)*: Automatically map strings into numeric data types for all fields. -** *`properties` (Optional, Record)*: Mapping for a field. For new fields, this mapping can include: +** *`properties` (Optional, Record)*: Mapping for a field. For new fields, this mapping can include: - Field name - Field data type @@ -3241,39 +3306,6 @@ error. ** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. -[discrete] -==== put_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] ----- -client.indices.putTemplate({ name }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`name` (string)*: The name of the template -** *`aliases` (Optional, Record)*: Aliases for the index. -** *`index_patterns` (Optional, string | string[])*: Array of wildcard expressions used to match the names -of indices during creation. -** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled, subobjects, _data_stream_timestamp })*: Mapping for fields in the index. -** *`order` (Optional, number)*: Order in which Elasticsearch applies this template if index -matches multiple templates. - -Templates with lower 'order' values are merged first. Templates with higher -'order' values are merged later, overriding templates with lower values. -** *`settings` (Optional, { index, mode, routing_path, soft_deletes, sort, number_of_shards, number_of_replicas, number_of_routing_shards, check_on_startup, codec, routing_partition_size, load_fixed_bitset_filters_eagerly, hidden, auto_expand_replicas, merge, search, refresh_interval, max_result_window, max_inner_result_window, max_rescore_window, max_docvalue_fields_search, max_script_fields, max_ngram_diff, max_shingle_diff, blocks, max_refresh_listeners, analyze, highlight, max_terms_count, max_regex_length, routing, gc_deletes, default_pipeline, final_pipeline, lifecycle, provided_name, creation_date, creation_date_string, uuid, version, verified_before_close, format, max_slices_per_scroll, translog, query_string, priority, top_metrics_max_size, analysis, settings, time_series, queries, similarity, mapping, indexing.slowlog, indexing_pressure, store })*: Configuration options for the index. -** *`version` (Optional, number)*: Version number used to manage index templates externally. This number -is not automatically generated by Elasticsearch. -** *`create` (Optional, boolean)*: If true, this request cannot replace or update existing index templates. -** *`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. -** *`cause` (Optional, string)* - [discrete] ==== refresh Refresh an index. @@ -3409,7 +3441,7 @@ If set to `false`, then indices or data streams matching the template must alway Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. ** *`template` (Optional, { aliases, mappings, settings, lifecycle })*: Template to be applied. It may optionally include an `aliases`, `mappings`, or `settings` configuration. -** *`data_stream` (Optional, { hidden })*: If this object is included, the template is used to create data streams and their backing indices. +** *`data_stream` (Optional, { hidden, allow_custom_routing })*: If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a `data_stream` object. ** *`priority` (Optional, number)*: Priority to determine index template precedence when a new data stream or index is created. @@ -3643,8 +3675,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, { append, attachment, bytes, circle, convert, csv, date, date_index_name, dissect, dot_expander, drop, enrich, fail, foreach, geo_grid, geoip, grok, gsub, html_strip, inference, join, json, kv, lowercase, pipeline, redact, remove, rename, reroute, script, set, set_security_user, sort, split, trim, uppercase, urldecode, uri_parts, 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, geo_grid, geoip, grok, gsub, html_strip, inference, join, json, kv, lowercase, pipeline, redact, remove, rename, reroute, script, set, set_security_user, sort, split, trim, uppercase, urldecode, uri_parts, user_agent }[])*: Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified. +** *`on_failure` (Optional, { append, attachment, bytes, circle, community_id, convert, csv, date, date_index_name, dissect, dot_expander, drop, enrich, fail, fingerprint, foreach, geo_grid, geoip, grok, gsub, html_strip, inference, join, json, kv, lowercase, network_direction, pipeline, redact, registered_domain, remove, rename, reroute, script, set, set_security_user, sort, split, terminate, trim, uppercase, urldecode, uri_parts, 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, community_id, convert, csv, date, date_index_name, dissect, dot_expander, drop, enrich, fail, fingerprint, foreach, geo_grid, geoip, grok, gsub, html_strip, inference, join, json, kv, lowercase, network_direction, pipeline, redact, registered_domain, remove, rename, reroute, script, set, set_security_user, sort, split, terminate, trim, uppercase, urldecode, uri_parts, 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. ** *`deprecated` (Optional, boolean)*: Marks this ingest pipeline as deprecated. When a deprecated ingest pipeline is referenced as the default or final pipeline when creating or updating a non-deprecated index template, Elasticsearch will emit a deprecation warning. @@ -4638,7 +4670,7 @@ Create 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. +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. @@ -5418,6 +5450,23 @@ client.queryRules.putRuleset({ ruleset_id, rules }) ** *`ruleset_id` (string)*: The unique identifier of the query ruleset to be created or updated ** *`rules` ({ rule_id, type, criteria, actions, priority } | { rule_id, type, criteria, actions, priority }[])* +[discrete] +==== test +Creates or updates a query ruleset. + +{ref}/test-query-ruleset.html[Endpoint documentation] +[source,ts] +---- +client.queryRules.test({ ruleset_id, match_criteria }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`ruleset_id` (string)*: The unique identifier of the query ruleset to be created or updated +** *`match_criteria` (Record)* + [discrete] === search_application [discrete] @@ -5519,7 +5568,7 @@ client.searchApplication.put({ name }) * *Request (object):* ** *`name` (string)*: The name of the search application to be created or updated. -** *`search_application` (Optional, { name, indices, updated_at_millis, analytics_collection_name, template })* +** *`search_application` (Optional, { indices, analytics_collection_name, template })* ** *`create` (Optional, boolean)*: If `true`, this request cannot replace or update existing Search Applications. [discrete] @@ -5563,6 +5612,7 @@ client.searchApplication.search({ name }) [discrete] ==== authenticate Authenticate a user. + Authenticates a user and returns information about the authenticated user. Include the user information in a [basic auth header](https://en.wikipedia.org/wiki/Basic_access_authentication). 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. @@ -5578,7 +5628,8 @@ client.security.authenticate() [discrete] ==== create_api_key Create an API key. -Creates an API key for access without requiring basic authentication. + +Create 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. @@ -5599,9 +5650,29 @@ client.security.createApiKey({ ... }) ** *`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. +[discrete] +==== delete_role +Delete roles. + +Delete roles in the native realm. + +{ref}/security-api-delete-role.html[Endpoint documentation] +[source,ts] +---- +client.security.deleteRole({ name }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (string)*: Role name +** *`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] ==== get_api_key Get API key information. + 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. @@ -5634,10 +5705,42 @@ descriptors and the owner user's role descriptors. ** *`active_only` (Optional, boolean)*: A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, nor expired at query time. You can specify this together with other parameters such as `owner` or `name`. If `active_only` is false, the response will include both active and inactive (expired or invalidated) keys. ** *`with_profile_uid` (Optional, boolean)*: Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists. +[discrete] +==== get_builtin_privileges +Get builtin privileges. + +Get the list of cluster privileges and index privileges that are available in this version of Elasticsearch. + +{ref}/security-api-get-builtin-privileges.html[Endpoint documentation] +[source,ts] +---- +client.security.getBuiltinPrivileges() +---- + + +[discrete] +==== get_role +Get roles. + +Get roles in the native realm. + +{ref}/security-api-get-role.html[Endpoint documentation] +[source,ts] +---- +client.security.getRole({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (Optional, string | string[])*: The name of the role. You can specify multiple roles as a list. If you do not specify this parameter, the API returns information about all roles. + [discrete] ==== has_privileges Check user privileges. -Determines whether the specified user has a specified list of privileges. + +Determine whether the specified user has a specified list of privileges. {ref}/security-api-has-privileges.html[Endpoint documentation] [source,ts] @@ -5657,13 +5760,15 @@ client.security.hasPrivileges({ ... }) [discrete] ==== invalidate_api_key Invalidate API keys. -Invalidates one or more API keys. + +This API invalidates API keys created by the create API key or grant API key APIs. +Invalidated API keys fail authentication, but they can still be viewed using the get API key information and query API key information APIs, for at least the configured retention period, until they are automatically deleted. 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. +- Or, if the request is issued by an API key, that is to say an API key invalidates itself, specify its ID in the `ids` field. {ref}/security-api-invalidate-api-key.html[Endpoint documentation] [source,ts] @@ -5687,10 +5792,39 @@ This parameter cannot be used with either `ids` or `name`, or when `owner` flag ** *`username` (Optional, string)*: The username of a user. This parameter cannot be used with either `ids` or `name`, or when `owner` flag is set to `true`. +[discrete] +==== put_role +Create or update roles. + +The role management APIs are generally the preferred way to manage roles in the native realm, rather than using file-based role management. +The create or update roles API cannot update roles that are defined in roles files. +File-based role management is not available in Elastic Serverless. + +{ref}/security-api-put-role.html[Endpoint documentation] +[source,ts] +---- +client.security.putRole({ name }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (string)*: The name of the role that is being created or updated. On Elasticsearch Serverless, the role name must begin with a letter or digit and can only contain letters, digits and the characters '_', '-', and '.'. Each role must have a unique name, as this will serve as the identifier for that 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_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. +** *`indices` (Optional, { field_security, names, privileges, query }[])*: 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. + [discrete] ==== query_api_keys -Query API keys. -Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query. +Find API keys with a query. + +Get a paginated list of API keys and their information. You can optionally filter the results with a query. {ref}/security-api-query-api-key.html[Endpoint documentation] [source,ts] @@ -5730,6 +5864,7 @@ An API key's actual permission is the intersection of its assigned role descript [discrete] ==== update_api_key Update an 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. diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index 4a8cef9..f17bb56 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -45,7 +45,7 @@ export default class AsyncSearch { } /** - * Deletes an async search by 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. + * Delete an async search. If the asynchronous search is still running, it is 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 @@ -77,7 +77,7 @@ export default class AsyncSearch { } /** - * 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. + * Get async search results. Retrieve the results of a previously submitted asynchronous search request. 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> @@ -109,7 +109,7 @@ export default class AsyncSearch { } /** - * 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. + * Get async search status. Retrieve 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 @@ -141,7 +141,7 @@ export default class AsyncSearch { } /** - * 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. + * Run an async search. 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. Partial results become available following the sort criteria that was requested. Warning: Asynchronous search does not support scroll or search requests that include only the suggest section. By default, Elasticsearch does not 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> diff --git a/src/api/api/connector.ts b/src/api/api/connector.ts index d9ec7c4..1867491 100644 --- a/src/api/api/connector.ts +++ b/src/api/api/connector.ts @@ -45,7 +45,7 @@ export default class Connector { } /** - * Updates the last_seen field in the connector, and sets it to current timestamp + * Check in a connector. Update the `last_seen` field in the connector and set it to the current timestamp. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/check-in-connector-api.html | Elasticsearch API documentation} */ async checkIn (this: That, params: T.ConnectorCheckInRequest | TB.ConnectorCheckInRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -77,7 +77,7 @@ export default class Connector { } /** - * Deletes a connector. + * Delete a connector. Removes a connector and associated sync jobs. This is a destructive action that is not recoverable. NOTE: This action doesn’t delete any API keys, ingest pipelines, or data indices associated with the connector. These need to be removed manually. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-api.html | Elasticsearch API documentation} */ async delete (this: That, params: T.ConnectorDeleteRequest | TB.ConnectorDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -109,7 +109,7 @@ export default class Connector { } /** - * Retrieves a connector. + * Get a connector. Get the details about a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-api.html | Elasticsearch API documentation} */ async get (this: That, params: T.ConnectorGetRequest | TB.ConnectorGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -141,7 +141,7 @@ export default class Connector { } /** - * Returns existing connectors. + * Get all connectors. Get information about all connectors. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-api.html | Elasticsearch API documentation} */ async list (this: That, params?: T.ConnectorListRequest | TB.ConnectorListRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -171,7 +171,7 @@ export default class Connector { } /** - * Creates a connector. + * Create a connector. Connectors are Elasticsearch integrations that bring content from third-party data sources, which can be deployed on Elastic Cloud or hosted on your own infrastructure. Elastic managed connectors (Native connectors) are a managed service on Elastic Cloud. Self-managed connectors (Connector clients) are self-managed on your infrastructure. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html | Elasticsearch API documentation} */ async post (this: That, params?: T.ConnectorPostRequest | TB.ConnectorPostRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -213,7 +213,7 @@ export default class Connector { } /** - * Creates or updates a connector. + * Create or update a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-api.html | Elasticsearch API documentation} */ async put (this: That, params?: T.ConnectorPutRequest | TB.ConnectorPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -265,7 +265,7 @@ export default class Connector { } /** - * Cancels a connector sync job. + * Cancel a connector sync job. Cancel a connector sync job, which sets the status to cancelling and updates `cancellation_requested_at` to the current time. The connector service is then responsible for setting the status of connector sync jobs to cancelled. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html | Elasticsearch API documentation} */ async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest | TB.ConnectorSyncJobCancelRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -297,7 +297,7 @@ export default class Connector { } /** - * Deletes a connector sync job. + * Delete a connector sync job. Remove a connector sync job and its associated data. This is a destructive action that is not recoverable. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html | Elasticsearch API documentation} */ async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest | TB.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -329,7 +329,7 @@ export default class Connector { } /** - * Retrieves a connector sync job. + * Get a connector sync job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html | Elasticsearch API documentation} */ async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest | TB.ConnectorSyncJobGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -361,7 +361,7 @@ export default class Connector { } /** - * Lists connector sync jobs. + * Get all connector sync jobs. Get information about all stored connector sync jobs listed by their creation date in ascending order. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-sync-jobs-api.html | Elasticsearch API documentation} */ async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest | TB.ConnectorSyncJobListRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -391,7 +391,7 @@ export default class Connector { } /** - * Creates a connector sync job. + * Create a connector sync job. Create a connector sync job document in the internal index and initialize its counters and timestamps with default values. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html | Elasticsearch API documentation} */ async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest | TB.ConnectorSyncJobPostRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -432,7 +432,7 @@ export default class Connector { } /** - * Activates the valid draft filtering for a connector. + * Activate the connector draft filter. Activates the valid draft filtering for a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html | Elasticsearch API documentation} */ async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest | TB.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -464,7 +464,7 @@ export default class Connector { } /** - * Updates the API key id in the connector document + * Update the connector API key ID. Update the `api_key_id` and `api_key_secret_id` fields of a connector. You can specify the ID of the API key used for authorization and the ID of the connector secret where the API key is stored. The connector secret ID is required only for Elastic managed (native) connectors. Self-managed connectors (connector clients) do not use this field. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html | Elasticsearch API documentation} */ async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest | TB.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -508,7 +508,7 @@ export default class Connector { } /** - * Updates the configuration field in the connector document + * Update the connector configuration. Update the configuration field in the connector document. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-configuration-api.html | Elasticsearch API documentation} */ async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest | TB.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -552,7 +552,7 @@ export default class Connector { } /** - * Updates the filtering field in the connector document + * Update the connector error field. Set the error field for the connector. If the error provided in the request body is non-null, the connector’s status is updated to error. Otherwise, if the error is reset to null, the connector status is updated to connected. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-error-api.html | Elasticsearch API documentation} */ async updateError (this: That, params: T.ConnectorUpdateErrorRequest | TB.ConnectorUpdateErrorRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -596,7 +596,7 @@ export default class Connector { } /** - * Updates the filtering field in the connector document + * Update the connector filtering. Update the draft filtering configuration of a connector and marks the draft validation state as edited. The filtering draft is activated once validated by the running Elastic connector service. The filtering property is used to configure sync rules (both basic and advanced) for a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-api.html | Elasticsearch API documentation} */ async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest | TB.ConnectorUpdateFilteringRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -640,7 +640,7 @@ export default class Connector { } /** - * Updates the draft filtering validation info for a connector. + * Update the connector draft filtering validation. Update the draft filtering validation info for a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-filtering-validation-api.html | Elasticsearch API documentation} */ async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -684,7 +684,7 @@ export default class Connector { } /** - * Updates the index_name in the connector document + * Update the connector index name. Update the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html | Elasticsearch API documentation} */ async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest | TB.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -728,7 +728,7 @@ export default class Connector { } /** - * Updates the name and description fields in the connector document + * Update the connector name and description. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-name-description-api.html | Elasticsearch API documentation} */ async updateName (this: That, params: T.ConnectorUpdateNameRequest | TB.ConnectorUpdateNameRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -772,7 +772,7 @@ export default class Connector { } /** - * Updates the is_native flag in the connector document + * Update the connector is_native flag. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-native-api.html | Elasticsearch API documentation} */ async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -816,7 +816,7 @@ export default class Connector { } /** - * Updates the pipeline field in the connector document + * Update the connector pipeline. When you create a new connector, the configuration of an ingest pipeline is populated with default settings. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-pipeline-api.html | Elasticsearch API documentation} */ async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest | TB.ConnectorUpdatePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -860,7 +860,7 @@ export default class Connector { } /** - * Updates the scheduling field in the connector document + * Update the connector scheduling. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-scheduling-api.html | Elasticsearch API documentation} */ async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest | TB.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -904,7 +904,7 @@ export default class Connector { } /** - * Updates the service type of the connector + * Update the connector service type. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html | Elasticsearch API documentation} */ async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest | TB.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -948,7 +948,7 @@ export default class Connector { } /** - * Updates the status of the connector + * Update the connector status. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html | Elasticsearch API documentation} */ async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest | TB.ConnectorUpdateStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/enrich.ts b/src/api/api/enrich.ts index ada26a2..25b3398 100644 --- a/src/api/api/enrich.ts +++ b/src/api/api/enrich.ts @@ -191,34 +191,4 @@ export default class Enrich { } return await this.transport.request({ path, method, querystring, body, meta }, options) } - - /** - * Get enrich stats. 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 - async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptions): Promise - async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, 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 = '/_enrich/_stats' - 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 0e0ddd8..d0b9054 100644 --- a/src/api/api/eql.ts +++ b/src/api/api/eql.ts @@ -149,7 +149,7 @@ export default class Eql { async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptions): Promise> async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] - const acceptedBody: string[] = ['query', 'case_sensitive', 'event_category_field', 'tiebreaker_field', 'timestamp_field', 'fetch_size', 'filter', 'keep_alive', 'keep_on_completion', 'wait_for_completion_timeout', 'size', 'fields', 'result_position', 'runtime_mappings'] + const acceptedBody: string[] = ['query', 'case_sensitive', 'event_category_field', 'tiebreaker_field', 'timestamp_field', 'fetch_size', 'filter', 'keep_alive', 'keep_on_completion', 'wait_for_completion_timeout', 'size', 'fields', 'result_position', 'runtime_mappings', 'max_samples_per_key'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index c6d8047..bce1a38 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -78,7 +78,7 @@ export default class Indices { } /** - * Performs analysis on a text string and returns the resulting tokens. + * Get tokens from text analysis. The analyze API performs [analysis](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html) 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 @@ -277,38 +277,6 @@ export default class Indices { return await this.transport.request({ path, method, querystring, body, meta }, options) } - /** - * 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 - async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise - async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['name'] - const querystring: Record = {} - const body = undefined - - for (const key in params) { - if (acceptedPath.includes(key)) { - continue - } else if (key !== 'body') { - // @ts-expect-error - querystring[key] = params[key] - } - } - - const method = 'DELETE' - const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle` - const meta: TransportRequestMetadata = { - name: 'indices.delete_data_lifecycle', - pathParts: { - name: params.name - } - } - return await this.transport.request({ path, method, querystring, body, meta }, options) - } - /** * 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} @@ -921,22 +889,15 @@ export default class Indices { async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['data_retention', 'downsampling'] + const acceptedBody: string[] = ['lifecycle'] 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 - } + let body: any = params.body ?? undefined for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error - body[key] = params[key] + body = params[key] } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { @@ -1088,50 +1049,6 @@ export default class Indices { return await this.transport.request({ path, method, querystring, body, meta }, options) } - /** - * Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. - * @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 - async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptions): Promise - async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['aliases', 'index_patterns', 'mappings', 'order', 'settings', 'version'] - 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 = `/_template/${encodeURIComponent(params.name.toString())}` - const meta: TransportRequestMetadata = { - name: 'indices.put_template', - pathParts: { - name: params.name - } - } - return await this.transport.request({ path, method, querystring, body, meta }, options) - } - /** * Refresh an index. 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} diff --git a/src/api/api/mget.ts b/src/api/api/mget.ts index 75ffcae..ae069e6 100644 --- a/src/api/api/mget.ts +++ b/src/api/api/mget.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Allows to get multiple documents in one request. + * Get multiple documents. Get multiple JSON documents by ID from one or more indices. If you specify an index in the request URI, you only need to specify the document IDs in the request body. To ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html | Elasticsearch API documentation} */ export default async function MgetApi (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index a0bc3f3..19f7699 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -1352,7 +1352,7 @@ export default class Ml { } /** - * Create 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. + * Create 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 diff --git a/src/api/api/msearch.ts b/src/api/api/msearch.ts index 5d5fbc9..7d57782 100644 --- a/src/api/api/msearch.ts +++ b/src/api/api/msearch.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Allows to execute several search operations in one request. + * Run multiple searches. The format of the request is similar to the bulk API format and makes use of the newline delimited JSON (NDJSON) format. The structure is as follows: ``` header\n body\n header\n body\n ``` This structure is specifically optimized to reduce parsing if a specific search ends up redirected to another node. IMPORTANT: The final line of data must end with a newline character `\n`. Each newline character may be preceded by a carriage return `\r`. When sending requests to this endpoint the `Content-Type` header should be set to `application/x-ndjson`. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html | Elasticsearch API documentation} */ export default async function MsearchApi> (this: That, params: T.MsearchRequest | TB.MsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> diff --git a/src/api/api/mtermvectors.ts b/src/api/api/mtermvectors.ts index 5fdb4a4..8886f5b 100644 --- a/src/api/api/mtermvectors.ts +++ b/src/api/api/mtermvectors.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Returns multiple termvectors in one request. + * Get multiple term vectors. You can specify existing documents by index and ID or provide artificial documents in the body of the request. You can specify the index in the request body or request URI. The response contains a `docs` array with all the fetched termvectors. Each element has the structure provided by the termvectors API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html | Elasticsearch API documentation} */ export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest | TB.MtermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/query_rules.ts b/src/api/api/query_rules.ts index 1a090d5..1507889 100644 --- a/src/api/api/query_rules.ts +++ b/src/api/api/query_rules.ts @@ -292,4 +292,48 @@ export default class QueryRules { } 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/test-query-ruleset.html | Elasticsearch API documentation} + */ + async test (this: That, params: T.QueryRulesTestRequest | TB.QueryRulesTestRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async test (this: That, params: T.QueryRulesTestRequest | TB.QueryRulesTestRequest, options?: TransportRequestOptionsWithMeta): Promise> + async test (this: That, params: T.QueryRulesTestRequest | TB.QueryRulesTestRequest, options?: TransportRequestOptions): Promise + async test (this: That, params: T.QueryRulesTestRequest | TB.QueryRulesTestRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['ruleset_id'] + const acceptedBody: string[] = ['match_criteria'] + 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 = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}/_test` + const meta: TransportRequestMetadata = { + name: 'query_rules.test', + pathParts: { + ruleset_id: params.ruleset_id + } + } + 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 13b86d8..ae356e9 100644 --- a/src/api/api/scroll.ts +++ b/src/api/api/scroll.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Allows to retrieve a large numbers of results from a single search request. + * Run a scrolling search. IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT). The scroll API gets large sets of results from a single scrolling search request. To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter. The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request. The search response returns a scroll ID in the `_scroll_id` response body parameter. You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request. If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search. You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context. IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll | Elasticsearch API documentation} */ export default async function ScrollApi> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise> diff --git a/src/api/api/security.ts b/src/api/api/security.ts index 2f03c0e..f8f6977 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -75,7 +75,7 @@ export default class Security { } /** - * Create an 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. + * Create an API key. Create 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 @@ -116,6 +116,38 @@ export default class Security { return await this.transport.request({ path, method, querystring, body, meta }, options) } + /** + * Delete roles. Delete roles in the native realm. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-delete-role.html | Elasticsearch API documentation} + */ + async deleteRole (this: That, params: T.SecurityDeleteRoleRequest | TB.SecurityDeleteRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteRole (this: That, params: T.SecurityDeleteRoleRequest | TB.SecurityDeleteRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteRole (this: That, params: T.SecurityDeleteRoleRequest | TB.SecurityDeleteRoleRequest, options?: TransportRequestOptions): Promise + async deleteRole (this: That, params: T.SecurityDeleteRoleRequest | TB.SecurityDeleteRoleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['name'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_security/role/${encodeURIComponent(params.name.toString())}` + const meta: TransportRequestMetadata = { + name: 'security.delete_role', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + /** * Get API key information. 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} @@ -147,7 +179,77 @@ export default class Security { } /** - * Check user privileges. Determines whether the specified user has a specified list of privileges. + * Get builtin privileges. Get the list of cluster privileges and index privileges that are available in this version of Elasticsearch. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-builtin-privileges.html | Elasticsearch API documentation} + */ + async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest | TB.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest | TB.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest | TB.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptions): Promise + async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest | TB.SecurityGetBuiltinPrivilegesRequest, 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 = '/_security/privilege/_builtin' + const meta: TransportRequestMetadata = { + name: 'security.get_builtin_privileges' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Get roles. Get roles in the native realm. + * @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 + async getRole (this: That, params?: T.SecurityGetRoleRequest | TB.SecurityGetRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRole (this: That, params?: T.SecurityGetRoleRequest | TB.SecurityGetRoleRequest, options?: TransportRequestOptions): Promise + async getRole (this: That, params?: T.SecurityGetRoleRequest | TB.SecurityGetRoleRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['name'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + let method = '' + let path = '' + if (params.name != null) { + method = 'GET' + path = `/_security/role/${encodeURIComponent(params.name.toString())}` + } else { + method = 'GET' + path = '/_security/role' + } + const meta: TransportRequestMetadata = { + name: 'security.get_role', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Check user privileges. Determine whether the specified user has a specified list of privileges. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-has-privileges.html | Elasticsearch API documentation} */ async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest | TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -199,7 +301,7 @@ export default class Security { } /** - * Invalidate 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. + * Invalidate API keys. This API invalidates API keys created by the create API key or grant API key APIs. Invalidated API keys fail authentication, but they can still be viewed using the get API key information and query API key information APIs, for at least the configured retention period, until they are automatically deleted. 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, that is to say 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 @@ -241,7 +343,51 @@ export default class Security { } /** - * Query API keys. Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query. + * Create or update roles. The role management APIs are generally the preferred way to manage roles in the native realm, rather than using file-based role management. The create or update roles API cannot update roles that are defined in roles files. File-based role management is not available in Elastic Serverless. + * @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 + async putRole (this: That, params: T.SecurityPutRoleRequest | TB.SecurityPutRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + 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', 'indices', 'metadata', 'run_as', 'description', 'transient_metadata'] + 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 = `/_security/role/${encodeURIComponent(params.name.toString())}` + const meta: TransportRequestMetadata = { + name: 'security.put_role', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Find API keys with a query. Get a paginated list of API keys and their information. 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 diff --git a/src/api/api/terms_enum.ts b/src/api/api/terms_enum.ts index 1dd51ec..fe04897 100644 --- a/src/api/api/terms_enum.ts +++ b/src/api/api/terms_enum.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. + * Get terms in an index. Discover terms that match a partial string in an index. This "terms enum" API is designed for low-latency look-ups used in auto-complete scenarios. If the `complete` property in the response is false, the returned terms set may be incomplete and should be treated as approximate. This can occur due to a few reasons, such as a request timeout or a node error. NOTE: The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-terms-enum.html | Elasticsearch API documentation} */ export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/types.ts b/src/api/types.ts index e9f9b08..d491444 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -2624,12 +2624,14 @@ export interface Retries { export interface RetrieverBase { filter?: QueryDslQueryContainer | QueryDslQueryContainer[] + min_score?: float } export interface RetrieverContainer { standard?: StandardRetriever knn?: KnnRetriever rrf?: RRFRetriever + text_similarity_reranker?: TextSimilarityReranker } export type Routing = string @@ -2757,7 +2759,7 @@ export interface ShardStatistics { } export interface ShardsOperationResponseBase { - _shards: ShardStatistics + _shards?: ShardStatistics } export interface SlicedScroll { @@ -2794,7 +2796,6 @@ export interface StandardRetriever extends RetrieverBase { search_after?: SortResults terminate_after?: integer sort?: Sort - min_score?: float collapse?: SearchFieldCollapse } @@ -2831,6 +2832,14 @@ export interface TextEmbedding { model_text: string } +export interface TextSimilarityReranker extends RetrieverBase { + retriever: RetrieverContainer + rank_window_size?: integer + inference_id?: string + inference_text?: string + field?: string +} + export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem' export type TimeOfDay = string @@ -4513,8 +4522,8 @@ export interface AnalysisEdgeNGramTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisEdgeNGramTokenizer extends AnalysisTokenizerBase { type: 'edge_ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer token_chars?: AnalysisTokenChar[] } @@ -4856,8 +4865,8 @@ export interface AnalysisNGramTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisNGramTokenizer extends AnalysisTokenizerBase { type: 'ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer token_chars?: AnalysisTokenChar[] } @@ -5330,22 +5339,28 @@ export interface MappingDateRangeProperty extends MappingRangePropertyBase { type: 'date_range' } +export type MappingDenseVectorElementType = 'bit' | 'byte' | 'float' + export interface MappingDenseVectorIndexOptions { - type: string - m?: integer - ef_construction?: integer confidence_interval?: float + ef_construction?: integer + m?: integer + type: MappingDenseVectorIndexOptionsType } +export type MappingDenseVectorIndexOptionsType = 'flat' | 'hnsw' | 'int4_flat' | 'int4_hnsw' | 'int8_flat' | 'int8_hnsw' + export interface MappingDenseVectorProperty extends MappingPropertyBase { type: 'dense_vector' - element_type?: string dims?: integer - similarity?: string + element_type?: MappingDenseVectorElementType index?: boolean index_options?: MappingDenseVectorIndexOptions + similarity?: MappingDenseVectorSimilarity } +export type MappingDenseVectorSimilarity = 'cosine' | 'dot_product' | 'l2_norm' | 'max_inner_product' + export interface MappingDocValuesPropertyBase extends MappingCorePropertyBase { doc_values?: boolean } @@ -8637,18 +8652,20 @@ export type CcrDeleteAutoFollowPatternResponse = AcknowledgedResponseBase export interface CcrFollowRequest extends RequestBase { index: IndexName wait_for_active_shards?: WaitForActiveShards - leader_index?: IndexName + data_stream_name?: string + leader_index: IndexName max_outstanding_read_requests?: long - max_outstanding_write_requests?: long - max_read_request_operation_count?: long - max_read_request_size?: string + max_outstanding_write_requests?: integer + max_read_request_operation_count?: integer + max_read_request_size?: ByteSize max_retry_delay?: Duration - max_write_buffer_count?: long - max_write_buffer_size?: string - max_write_request_operation_count?: long - max_write_request_size?: string + max_write_buffer_count?: integer + max_write_buffer_size?: ByteSize + max_write_request_operation_count?: integer + max_write_request_size?: ByteSize read_poll_timeout?: Duration - remote_cluster?: string + remote_cluster: string + settings?: IndicesIndexSettings } export interface CcrFollowResponse { @@ -8666,16 +8683,16 @@ export interface CcrFollowInfoFollowerIndex { } export interface CcrFollowInfoFollowerIndexParameters { - max_outstanding_read_requests: integer - max_outstanding_write_requests: integer - max_read_request_operation_count: integer - max_read_request_size: string - max_retry_delay: Duration - max_write_buffer_count: integer - max_write_buffer_size: string - max_write_request_operation_count: integer - max_write_request_size: string - read_poll_timeout: Duration + max_outstanding_read_requests?: long + max_outstanding_write_requests?: integer + max_read_request_operation_count?: integer + max_read_request_size?: ByteSize + max_retry_delay?: Duration + max_write_buffer_count?: integer + max_write_buffer_size?: ByteSize + max_write_request_operation_count?: integer + max_write_request_size?: ByteSize + read_poll_timeout?: Duration } export type CcrFollowInfoFollowerIndexStatus = 'active' | 'paused' @@ -9468,7 +9485,7 @@ export interface ClusterStatsOperatingSystemMemoryInfo { export interface ClusterStatsRequest extends RequestBase { node_id?: NodeIds - flat_settings?: boolean + include_remotes?: boolean timeout?: Duration } @@ -9622,7 +9639,7 @@ export interface ConnectorFeatureEnabled { export interface ConnectorFilteringAdvancedSnippet { created_at?: DateTime updated_at?: DateTime - value: Record + value: any } export interface ConnectorFilteringConfig { @@ -10172,6 +10189,7 @@ export interface EqlSearchRequest extends RequestBase { fields?: QueryDslFieldAndFormat | Field | (QueryDslFieldAndFormat | Field)[] result_position?: EqlSearchResultPosition runtime_mappings?: MappingRuntimeFields + max_samples_per_key?: integer } export type EqlSearchResponse = EqlEqlSearchResponseBase @@ -10604,15 +10622,15 @@ export interface IlmMigrateToDataTiersResponse { export interface IlmMoveToStepRequest extends RequestBase { index: IndexName - current_step?: IlmMoveToStepStepKey - next_step?: IlmMoveToStepStepKey + current_step: IlmMoveToStepStepKey + next_step: IlmMoveToStepStepKey } export type IlmMoveToStepResponse = AcknowledgedResponseBase export interface IlmMoveToStepStepKey { - action: string - name: string + action?: string + name?: string phase: string } @@ -10707,6 +10725,7 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration downsampling?: IndicesDataStreamLifecycleDownsampling + enabled?: boolean } export interface IndicesDataStreamLifecycleDownsampling { @@ -10726,9 +10745,7 @@ export interface IndicesDataStreamLifecycleRolloverConditions { max_primary_shard_docs?: long } -export interface IndicesDataStreamLifecycleWithRollover { - data_retention?: Duration - downsampling?: IndicesDataStreamLifecycleDownsampling +export interface IndicesDataStreamLifecycleWithRollover extends IndicesDataStreamLifecycle { rollover?: IndicesDataStreamLifecycleRolloverConditions } @@ -10738,6 +10755,7 @@ export interface IndicesDataStreamTimestampField { export interface IndicesDataStreamVisibility { hidden?: boolean + allow_custom_routing?: boolean } export interface IndicesDownsampleConfig { @@ -11585,7 +11603,7 @@ export type IndicesGetAliasResponse = Record @@ -12778,6 +12821,15 @@ export interface IngestMaxmind { account_id: Id } +export interface IngestNetworkDirectionProcessor extends IngestProcessorBase { + source_ip?: Field + destination_ip?: Field + target_field?: Field + internal_networks?: string[] + internal_networks_field?: Field + ignore_missing?: boolean +} + export interface IngestPipeline { description?: string on_failure?: IngestProcessorContainer[] @@ -12811,6 +12863,7 @@ export interface IngestProcessorContainer { attachment?: IngestAttachmentProcessor bytes?: IngestBytesProcessor circle?: IngestCircleProcessor + community_id?: IngestCommunityIDProcessor convert?: IngestConvertProcessor csv?: IngestCsvProcessor date?: IngestDateProcessor @@ -12820,6 +12873,7 @@ export interface IngestProcessorContainer { drop?: IngestDropProcessor enrich?: IngestEnrichProcessor fail?: IngestFailProcessor + fingerprint?: IngestFingerprintProcessor foreach?: IngestForeachProcessor geo_grid?: IngestGeoGridProcessor geoip?: IngestGeoIpProcessor @@ -12831,8 +12885,10 @@ export interface IngestProcessorContainer { json?: IngestJsonProcessor kv?: IngestKeyValueProcessor lowercase?: IngestLowercaseProcessor + network_direction?: IngestNetworkDirectionProcessor pipeline?: IngestPipelineProcessor redact?: IngestRedactProcessor + registered_domain?: IngestRegisteredDomainProcessor remove?: IngestRemoveProcessor rename?: IngestRenameProcessor reroute?: IngestRerouteProcessor @@ -12841,6 +12897,7 @@ export interface IngestProcessorContainer { set_security_user?: IngestSetSecurityUserProcessor sort?: IngestSortProcessor split?: IngestSplitProcessor + terminate?: IngestTerminateProcessor trim?: IngestTrimProcessor uppercase?: IngestUppercaseProcessor urldecode?: IngestUrlDecodeProcessor @@ -12856,6 +12913,13 @@ export interface IngestRedactProcessor extends IngestProcessorBase { suffix?: string ignore_missing?: boolean skip_if_unlicensed?: boolean + trace_redact?: boolean +} + +export interface IngestRegisteredDomainProcessor extends IngestProcessorBase { + field: Field + target_field?: Field + ignore_missing?: boolean } export interface IngestRemoveProcessor extends IngestProcessorBase { @@ -12913,6 +12977,9 @@ export interface IngestSplitProcessor extends IngestProcessorBase { target_field?: Field } +export interface IngestTerminateProcessor extends IngestProcessorBase { +} + export interface IngestTrimProcessor extends IngestProcessorBase { field: Field ignore_missing?: boolean @@ -13067,6 +13134,7 @@ export type IngestSimulateDocumentSimulation = IngestSimulateDocumentSimulationK & { [property: string]: string | Id | IndexName | IngestSimulateIngest | Record | SpecUtilsStringified | VersionType } export interface IngestSimulateIngest { + _redact?: IngestSimulateRedact timestamp: DateTime pipeline?: Name } @@ -13081,6 +13149,10 @@ export interface IngestSimulatePipelineSimulation { error?: ErrorCause } +export interface IngestSimulateRedact { + _is_redacted: boolean +} + export interface IngestSimulateRequest extends RequestBase { id?: Id verbose?: boolean @@ -16508,7 +16580,7 @@ export interface NodesInfoNodeInfoSettingsIngest { } export interface NodesInfoNodeInfoSettingsNetwork { - host?: Host + host?: Host | Host[] } export interface NodesInfoNodeInfoSettingsNode { @@ -16541,6 +16613,7 @@ export interface NodesInfoNodeInfoXpack { license?: NodesInfoNodeInfoXpackLicense security: NodesInfoNodeInfoXpackSecurity notification?: Record + ml?: NodesInfoNodeInfoXpackMl } export interface NodesInfoNodeInfoXpackLicense { @@ -16551,16 +16624,20 @@ export interface NodesInfoNodeInfoXpackLicenseType { type: string } +export interface NodesInfoNodeInfoXpackMl { + use_auto_machine_memory_percent?: boolean +} + export interface NodesInfoNodeInfoXpackSecurity { - http: NodesInfoNodeInfoXpackSecuritySsl + http?: NodesInfoNodeInfoXpackSecuritySsl enabled: string transport?: NodesInfoNodeInfoXpackSecuritySsl authc?: NodesInfoNodeInfoXpackSecurityAuthc } export interface NodesInfoNodeInfoXpackSecurityAuthc { - realms: NodesInfoNodeInfoXpackSecurityAuthcRealms - token: NodesInfoNodeInfoXpackSecurityAuthcToken + realms?: NodesInfoNodeInfoXpackSecurityAuthcRealms + token?: NodesInfoNodeInfoXpackSecurityAuthcToken } export interface NodesInfoNodeInfoXpackSecurityAuthcRealms { @@ -16789,6 +16866,21 @@ export interface QueryRulesPutRulesetResponse { result: Result } +export interface QueryRulesTestQueryRulesetMatchedRule { + ruleset_id: Id + rule_id: Id +} + +export interface QueryRulesTestRequest extends RequestBase { + ruleset_id: Id + match_criteria: Record +} + +export interface QueryRulesTestResponse { + total_matched_rules: integer + matched_rules: QueryRulesTestQueryRulesetMatchedRule[] +} + export interface RollupDateHistogramGrouping { delay?: Duration field: Field @@ -16984,10 +17076,13 @@ export interface SearchApplicationEventDataStream { name: IndexName } -export interface SearchApplicationSearchApplication { +export interface SearchApplicationSearchApplication extends SearchApplicationSearchApplicationParameters { name: Name - indices: IndexName[] updated_at_millis: EpochTime +} + +export interface SearchApplicationSearchApplicationParameters { + indices: IndexName[] analytics_collection_name?: Name template?: SearchApplicationSearchApplicationTemplate } @@ -17028,20 +17123,13 @@ export interface SearchApplicationListRequest extends RequestBase { export interface SearchApplicationListResponse { count: long - results: SearchApplicationListSearchApplicationListItem[] -} - -export interface SearchApplicationListSearchApplicationListItem { - name: Name - indices: IndexName[] - updated_at_millis: EpochTime - analytics_collection_name?: Name + results: SearchApplicationSearchApplication[] } export interface SearchApplicationPutRequest extends RequestBase { name: Name create?: boolean - search_application?: SearchApplicationSearchApplication + search_application?: SearchApplicationSearchApplicationParameters } export interface SearchApplicationPutResponse { @@ -17197,7 +17285,7 @@ export type SecurityIndexPrivilege = 'all' | 'auto_configure' | 'create' | 'crea export interface SecurityIndicesPrivileges { field_security?: SecurityFieldSecurity - names: Indices + names: IndexName[] privileges: SecurityIndexPrivilege[] query?: SecurityIndicesPrivilegesQuery } @@ -17216,7 +17304,7 @@ export interface SecurityRealmInfo { export interface SecurityRemoteIndicesPrivileges { clusters: Names field_security?: SecurityFieldSecurity - names: Indices + names: IndexName[] privileges: SecurityIndexPrivilege[] query?: SecurityIndicesPrivilegesQuery } @@ -17291,7 +17379,7 @@ export interface SecurityUser { export interface SecurityUserIndicesPrivileges { field_security?: SecurityFieldSecurity[] - names: Indices + names: IndexName[] privileges: SecurityIndexPrivilege[] query?: SecurityIndicesPrivilegesQuery[] allow_restricted_indices: boolean @@ -17601,7 +17689,7 @@ export interface SecurityGetBuiltinPrivilegesRequest extends RequestBase { export interface SecurityGetBuiltinPrivilegesResponse { cluster: string[] - index: Indices + index: IndexName[] } export interface SecurityGetPrivilegesRequest extends RequestBase { @@ -18678,7 +18766,8 @@ export interface SnapshotRestoreRequest extends RequestBase { } export interface SnapshotRestoreResponse { - snapshot: SnapshotRestoreSnapshotRestore + accepted?: boolean + snapshot?: SnapshotRestoreSnapshotRestore } export interface SnapshotRestoreSnapshotRestore { @@ -20039,13 +20128,10 @@ export interface XpackInfoFeatures { aggregate_metric: XpackInfoFeature analytics: XpackInfoFeature ccr: XpackInfoFeature - data_frame?: XpackInfoFeature - data_science?: XpackInfoFeature data_streams: XpackInfoFeature data_tiers: XpackInfoFeature enrich: XpackInfoFeature eql: XpackInfoFeature - flattened?: XpackInfoFeature frozen_indices: XpackInfoFeature graph: XpackInfoFeature ilm: XpackInfoFeature @@ -20060,10 +20146,8 @@ export interface XpackInfoFeatures { spatial: XpackInfoFeature sql: XpackInfoFeature transform: XpackInfoFeature - vectors?: XpackInfoFeature voting_only: XpackInfoFeature watcher: XpackInfoFeature - archive: XpackInfoFeature } export interface XpackInfoMinimalLicenseInformation { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index a8b7504..7f1d24d 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -2700,12 +2700,14 @@ export interface Retries { export interface RetrieverBase { filter?: QueryDslQueryContainer | QueryDslQueryContainer[] + min_score?: float } export interface RetrieverContainer { standard?: StandardRetriever knn?: KnnRetriever rrf?: RRFRetriever + text_similarity_reranker?: TextSimilarityReranker } export type Routing = string @@ -2833,7 +2835,7 @@ export interface ShardStatistics { } export interface ShardsOperationResponseBase { - _shards: ShardStatistics + _shards?: ShardStatistics } export interface SlicedScroll { @@ -2870,7 +2872,6 @@ export interface StandardRetriever extends RetrieverBase { search_after?: SortResults terminate_after?: integer sort?: Sort - min_score?: float collapse?: SearchFieldCollapse } @@ -2907,6 +2908,14 @@ export interface TextEmbedding { model_text: string } +export interface TextSimilarityReranker extends RetrieverBase { + retriever: RetrieverContainer + rank_window_size?: integer + inference_id?: string + inference_text?: string + field?: string +} + export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem' export type TimeOfDay = string @@ -4589,8 +4598,8 @@ export interface AnalysisEdgeNGramTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisEdgeNGramTokenizer extends AnalysisTokenizerBase { type: 'edge_ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer token_chars?: AnalysisTokenChar[] } @@ -4932,8 +4941,8 @@ export interface AnalysisNGramTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisNGramTokenizer extends AnalysisTokenizerBase { type: 'ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer token_chars?: AnalysisTokenChar[] } @@ -5406,22 +5415,28 @@ export interface MappingDateRangeProperty extends MappingRangePropertyBase { type: 'date_range' } +export type MappingDenseVectorElementType = 'bit' | 'byte' | 'float' + export interface MappingDenseVectorIndexOptions { - type: string - m?: integer - ef_construction?: integer confidence_interval?: float + ef_construction?: integer + m?: integer + type: MappingDenseVectorIndexOptionsType } +export type MappingDenseVectorIndexOptionsType = 'flat' | 'hnsw' | 'int4_flat' | 'int4_hnsw' | 'int8_flat' | 'int8_hnsw' + export interface MappingDenseVectorProperty extends MappingPropertyBase { type: 'dense_vector' - element_type?: string dims?: integer - similarity?: string + element_type?: MappingDenseVectorElementType index?: boolean index_options?: MappingDenseVectorIndexOptions + similarity?: MappingDenseVectorSimilarity } +export type MappingDenseVectorSimilarity = 'cosine' | 'dot_product' | 'l2_norm' | 'max_inner_product' + export interface MappingDocValuesPropertyBase extends MappingCorePropertyBase { doc_values?: boolean } @@ -8719,18 +8734,20 @@ export interface CcrFollowRequest extends RequestBase { wait_for_active_shards?: WaitForActiveShards /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { - leader_index?: IndexName + data_stream_name?: string + leader_index: IndexName max_outstanding_read_requests?: long - max_outstanding_write_requests?: long - max_read_request_operation_count?: long - max_read_request_size?: string + max_outstanding_write_requests?: integer + max_read_request_operation_count?: integer + max_read_request_size?: ByteSize max_retry_delay?: Duration - max_write_buffer_count?: long - max_write_buffer_size?: string - max_write_request_operation_count?: long - max_write_request_size?: string + max_write_buffer_count?: integer + max_write_buffer_size?: ByteSize + max_write_request_operation_count?: integer + max_write_request_size?: ByteSize read_poll_timeout?: Duration - remote_cluster?: string + remote_cluster: string + settings?: IndicesIndexSettings } } @@ -8749,16 +8766,16 @@ export interface CcrFollowInfoFollowerIndex { } export interface CcrFollowInfoFollowerIndexParameters { - max_outstanding_read_requests: integer - max_outstanding_write_requests: integer - max_read_request_operation_count: integer - max_read_request_size: string - max_retry_delay: Duration - max_write_buffer_count: integer - max_write_buffer_size: string - max_write_request_operation_count: integer - max_write_request_size: string - read_poll_timeout: Duration + max_outstanding_read_requests?: long + max_outstanding_write_requests?: integer + max_read_request_operation_count?: integer + max_read_request_size?: ByteSize + max_retry_delay?: Duration + max_write_buffer_count?: integer + max_write_buffer_size?: ByteSize + max_write_request_operation_count?: integer + max_write_request_size?: ByteSize + read_poll_timeout?: Duration } export type CcrFollowInfoFollowerIndexStatus = 'active' | 'paused' @@ -9572,7 +9589,7 @@ export interface ClusterStatsOperatingSystemMemoryInfo { export interface ClusterStatsRequest extends RequestBase { node_id?: NodeIds - flat_settings?: boolean + include_remotes?: boolean timeout?: Duration } @@ -9726,7 +9743,7 @@ export interface ConnectorFeatureEnabled { export interface ConnectorFilteringAdvancedSnippet { created_at?: DateTime updated_at?: DateTime - value: Record + value: any } export interface ConnectorFilteringConfig { @@ -10329,6 +10346,7 @@ export interface EqlSearchRequest extends RequestBase { fields?: QueryDslFieldAndFormat | Field | (QueryDslFieldAndFormat | Field)[] result_position?: EqlSearchResultPosition runtime_mappings?: MappingRuntimeFields + max_samples_per_key?: integer } } @@ -10777,16 +10795,16 @@ export interface IlmMoveToStepRequest extends RequestBase { index: IndexName /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { - current_step?: IlmMoveToStepStepKey - next_step?: IlmMoveToStepStepKey + current_step: IlmMoveToStepStepKey + next_step: IlmMoveToStepStepKey } } export type IlmMoveToStepResponse = AcknowledgedResponseBase export interface IlmMoveToStepStepKey { - action: string - name: string + action?: string + name?: string phase: string } @@ -10884,6 +10902,7 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration downsampling?: IndicesDataStreamLifecycleDownsampling + enabled?: boolean } export interface IndicesDataStreamLifecycleDownsampling { @@ -10903,9 +10922,7 @@ export interface IndicesDataStreamLifecycleRolloverConditions { max_primary_shard_docs?: long } -export interface IndicesDataStreamLifecycleWithRollover { - data_retention?: Duration - downsampling?: IndicesDataStreamLifecycleDownsampling +export interface IndicesDataStreamLifecycleWithRollover extends IndicesDataStreamLifecycle { rollover?: IndicesDataStreamLifecycleRolloverConditions } @@ -10915,6 +10932,7 @@ export interface IndicesDataStreamTimestampField { export interface IndicesDataStreamVisibility { hidden?: boolean + allow_custom_routing?: boolean } export interface IndicesDownsampleConfig { @@ -11772,7 +11790,7 @@ export type IndicesGetAliasResponse = Record @@ -13006,6 +13047,15 @@ export interface IngestMaxmind { account_id: Id } +export interface IngestNetworkDirectionProcessor extends IngestProcessorBase { + source_ip?: Field + destination_ip?: Field + target_field?: Field + internal_networks?: string[] + internal_networks_field?: Field + ignore_missing?: boolean +} + export interface IngestPipeline { description?: string on_failure?: IngestProcessorContainer[] @@ -13039,6 +13089,7 @@ export interface IngestProcessorContainer { attachment?: IngestAttachmentProcessor bytes?: IngestBytesProcessor circle?: IngestCircleProcessor + community_id?: IngestCommunityIDProcessor convert?: IngestConvertProcessor csv?: IngestCsvProcessor date?: IngestDateProcessor @@ -13048,6 +13099,7 @@ export interface IngestProcessorContainer { drop?: IngestDropProcessor enrich?: IngestEnrichProcessor fail?: IngestFailProcessor + fingerprint?: IngestFingerprintProcessor foreach?: IngestForeachProcessor geo_grid?: IngestGeoGridProcessor geoip?: IngestGeoIpProcessor @@ -13059,8 +13111,10 @@ export interface IngestProcessorContainer { json?: IngestJsonProcessor kv?: IngestKeyValueProcessor lowercase?: IngestLowercaseProcessor + network_direction?: IngestNetworkDirectionProcessor pipeline?: IngestPipelineProcessor redact?: IngestRedactProcessor + registered_domain?: IngestRegisteredDomainProcessor remove?: IngestRemoveProcessor rename?: IngestRenameProcessor reroute?: IngestRerouteProcessor @@ -13069,6 +13123,7 @@ export interface IngestProcessorContainer { set_security_user?: IngestSetSecurityUserProcessor sort?: IngestSortProcessor split?: IngestSplitProcessor + terminate?: IngestTerminateProcessor trim?: IngestTrimProcessor uppercase?: IngestUppercaseProcessor urldecode?: IngestUrlDecodeProcessor @@ -13084,6 +13139,13 @@ export interface IngestRedactProcessor extends IngestProcessorBase { suffix?: string ignore_missing?: boolean skip_if_unlicensed?: boolean + trace_redact?: boolean +} + +export interface IngestRegisteredDomainProcessor extends IngestProcessorBase { + field: Field + target_field?: Field + ignore_missing?: boolean } export interface IngestRemoveProcessor extends IngestProcessorBase { @@ -13141,6 +13203,9 @@ export interface IngestSplitProcessor extends IngestProcessorBase { target_field?: Field } +export interface IngestTerminateProcessor extends IngestProcessorBase { +} + export interface IngestTrimProcessor extends IngestProcessorBase { field: Field ignore_missing?: boolean @@ -13301,6 +13366,7 @@ export type IngestSimulateDocumentSimulation = IngestSimulateDocumentSimulationK & { [property: string]: string | Id | IndexName | IngestSimulateIngest | Record | SpecUtilsStringified | VersionType } export interface IngestSimulateIngest { + _redact?: IngestSimulateRedact timestamp: DateTime pipeline?: Name } @@ -13315,6 +13381,10 @@ export interface IngestSimulatePipelineSimulation { error?: ErrorCause } +export interface IngestSimulateRedact { + _is_redacted: boolean +} + export interface IngestSimulateRequest extends RequestBase { id?: Id verbose?: boolean @@ -16863,7 +16933,7 @@ export interface NodesInfoNodeInfoSettingsIngest { } export interface NodesInfoNodeInfoSettingsNetwork { - host?: Host + host?: Host | Host[] } export interface NodesInfoNodeInfoSettingsNode { @@ -16896,6 +16966,7 @@ export interface NodesInfoNodeInfoXpack { license?: NodesInfoNodeInfoXpackLicense security: NodesInfoNodeInfoXpackSecurity notification?: Record + ml?: NodesInfoNodeInfoXpackMl } export interface NodesInfoNodeInfoXpackLicense { @@ -16906,16 +16977,20 @@ export interface NodesInfoNodeInfoXpackLicenseType { type: string } +export interface NodesInfoNodeInfoXpackMl { + use_auto_machine_memory_percent?: boolean +} + export interface NodesInfoNodeInfoXpackSecurity { - http: NodesInfoNodeInfoXpackSecuritySsl + http?: NodesInfoNodeInfoXpackSecuritySsl enabled: string transport?: NodesInfoNodeInfoXpackSecuritySsl authc?: NodesInfoNodeInfoXpackSecurityAuthc } export interface NodesInfoNodeInfoXpackSecurityAuthc { - realms: NodesInfoNodeInfoXpackSecurityAuthcRealms - token: NodesInfoNodeInfoXpackSecurityAuthcToken + realms?: NodesInfoNodeInfoXpackSecurityAuthcRealms + token?: NodesInfoNodeInfoXpackSecurityAuthcToken } export interface NodesInfoNodeInfoXpackSecurityAuthcRealms { @@ -17153,6 +17228,24 @@ export interface QueryRulesPutRulesetResponse { result: Result } +export interface QueryRulesTestQueryRulesetMatchedRule { + ruleset_id: Id + rule_id: Id +} + +export interface QueryRulesTestRequest 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?: { + match_criteria: Record + } +} + +export interface QueryRulesTestResponse { + total_matched_rules: integer + matched_rules: QueryRulesTestQueryRulesetMatchedRule[] +} + export interface RollupDateHistogramGrouping { delay?: Duration field: Field @@ -17354,10 +17447,13 @@ export interface SearchApplicationEventDataStream { name: IndexName } -export interface SearchApplicationSearchApplication { +export interface SearchApplicationSearchApplication extends SearchApplicationSearchApplicationParameters { name: Name - indices: IndexName[] updated_at_millis: EpochTime +} + +export interface SearchApplicationSearchApplicationParameters { + indices: IndexName[] analytics_collection_name?: Name template?: SearchApplicationSearchApplicationTemplate } @@ -17398,21 +17494,14 @@ export interface SearchApplicationListRequest extends RequestBase { export interface SearchApplicationListResponse { count: long - results: SearchApplicationListSearchApplicationListItem[] -} - -export interface SearchApplicationListSearchApplicationListItem { - name: Name - indices: IndexName[] - updated_at_millis: EpochTime - analytics_collection_name?: Name + results: SearchApplicationSearchApplication[] } export interface SearchApplicationPutRequest extends RequestBase { name: Name create?: boolean /** @deprecated The use of the 'body' key has been deprecated, use 'search_application' instead. */ - body?: SearchApplicationSearchApplication + body?: SearchApplicationSearchApplicationParameters } export interface SearchApplicationPutResponse { @@ -17574,7 +17663,7 @@ export type SecurityIndexPrivilege = 'all' | 'auto_configure' | 'create' | 'crea export interface SecurityIndicesPrivileges { field_security?: SecurityFieldSecurity - names: Indices + names: IndexName[] privileges: SecurityIndexPrivilege[] query?: SecurityIndicesPrivilegesQuery } @@ -17593,7 +17682,7 @@ export interface SecurityRealmInfo { export interface SecurityRemoteIndicesPrivileges { clusters: Names field_security?: SecurityFieldSecurity - names: Indices + names: IndexName[] privileges: SecurityIndexPrivilege[] query?: SecurityIndicesPrivilegesQuery } @@ -17668,7 +17757,7 @@ export interface SecurityUser { export interface SecurityUserIndicesPrivileges { field_security?: SecurityFieldSecurity[] - names: Indices + names: IndexName[] privileges: SecurityIndexPrivilege[] query?: SecurityIndicesPrivilegesQuery[] allow_restricted_indices: boolean @@ -17993,7 +18082,7 @@ export interface SecurityGetBuiltinPrivilegesRequest extends RequestBase { export interface SecurityGetBuiltinPrivilegesResponse { cluster: string[] - index: Indices + index: IndexName[] } export interface SecurityGetPrivilegesRequest extends RequestBase { @@ -19148,7 +19237,8 @@ export interface SnapshotRestoreRequest extends RequestBase { } export interface SnapshotRestoreResponse { - snapshot: SnapshotRestoreSnapshotRestore + accepted?: boolean + snapshot?: SnapshotRestoreSnapshotRestore } export interface SnapshotRestoreSnapshotRestore { @@ -20546,13 +20636,10 @@ export interface XpackInfoFeatures { aggregate_metric: XpackInfoFeature analytics: XpackInfoFeature ccr: XpackInfoFeature - data_frame?: XpackInfoFeature - data_science?: XpackInfoFeature data_streams: XpackInfoFeature data_tiers: XpackInfoFeature enrich: XpackInfoFeature eql: XpackInfoFeature - flattened?: XpackInfoFeature frozen_indices: XpackInfoFeature graph: XpackInfoFeature ilm: XpackInfoFeature @@ -20567,10 +20654,8 @@ export interface XpackInfoFeatures { spatial: XpackInfoFeature sql: XpackInfoFeature transform: XpackInfoFeature - vectors?: XpackInfoFeature voting_only: XpackInfoFeature watcher: XpackInfoFeature - archive: XpackInfoFeature } export interface XpackInfoMinimalLicenseInformation {