diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 784ec90d7..5ceeca323 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -91,6 +91,7 @@ Some of the officially supported clients provide helpers to assist with bulk req * Perl: Check out `Search::Elasticsearch::Client::5_0::Bulk` and `Search::Elasticsearch::Client::5_0::Scroll` * Python: Check out `elasticsearch.helpers.*` * JavaScript: Check out `client.helpers.*` +* Java: Check out `co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester` * .NET: Check out `BulkAllObservable` * PHP: Check out bulk indexing. * Ruby: Check out `Elasticsearch::Helpers::BulkHelper` @@ -533,14 +534,14 @@ Rethrottling that speeds up the query takes effect immediately but rethrotting t {ref}/docs-delete-by-query.html[Endpoint documentation] [source,ts] ---- -client.deleteByQueryRethrottle({ task_id }) +client.deleteByQueryRethrottle({ task_id, requests_per_second }) ---- [discrete] ==== Arguments * *Request (object):* ** *`task_id` (string | number)*: The ID for the task. -** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. To disable throttling, set it to `-1`. +** *`requests_per_second` (float)*: The throttle for this request in sub-requests per second. To disable throttling, set it to `-1`. [discrete] === delete_script @@ -1599,14 +1600,14 @@ This behavior prevents scroll timeouts. {ref}/docs-reindex.html[Endpoint documentation] [source,ts] ---- -client.reindexRethrottle({ task_id }) +client.reindexRethrottle({ task_id, requests_per_second }) ---- [discrete] ==== Arguments * *Request (object):* ** *`task_id` (string)*: The task identifier, which can be found by using the tasks API. -** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. It can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level. +** *`requests_per_second` (float)*: The throttle for this request in sub-requests per second. It can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level. [discrete] === render_search_template @@ -2301,14 +2302,14 @@ Rethrottling that speeds up the query takes effect immediately but rethrotting t {ref}/docs-update-by-query.html[Endpoint documentation] [source,ts] ---- -client.updateByQueryRethrottle({ task_id }) +client.updateByQueryRethrottle({ task_id, requests_per_second }) ---- [discrete] ==== Arguments * *Request (object):* ** *`task_id` (string)*: The ID for the task. -** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. To turn off throttling, set it to `-1`. +** *`requests_per_second` (float)*: The throttle for this request in sub-requests per second. To turn off throttling, set it to `-1`. [discrete] === async_search @@ -4652,6 +4653,8 @@ client.connector.updateFiltering({ connector_id }) Update the connector draft filtering validation. Update the draft filtering validation info for a connector. + +https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-connector-update-filtering-validation[Endpoint documentation] [source,ts] ---- client.connector.updateFilteringValidation({ connector_id, validation }) @@ -4704,6 +4707,8 @@ client.connector.updateName({ connector_id }) [discrete] ==== update_native Update the connector is_native flag. + +https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-connector-update-native[Endpoint documentation] [source,ts] ---- client.connector.updateNative({ connector_id, is_native }) @@ -4797,7 +4802,7 @@ For example, this can happen if you delete more than `cluster.indices.tombstones {ref}/dangling-index-delete.html[Endpoint documentation] [source,ts] ---- -client.danglingIndices.deleteDanglingIndex({ index_uuid, accept_data_loss }) +client.danglingIndices.deleteDanglingIndex({ index_uuid }) ---- [discrete] @@ -4805,7 +4810,7 @@ client.danglingIndices.deleteDanglingIndex({ index_uuid, accept_data_loss }) * *Request (object):* ** *`index_uuid` (string)*: The UUID of the index to delete. Use the get dangling indices API to find the UUID. -** *`accept_data_loss` (boolean)*: This parameter must be set to true to acknowledge that it will no longer be possible to recove data from the dangling index. +** *`accept_data_loss` (Optional, boolean)*: This parameter must be set to true to acknowledge that it will no longer be possible to recove data from the dangling index. ** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master ** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout @@ -4819,7 +4824,7 @@ For example, this can happen if you delete more than `cluster.indices.tombstones {ref}/dangling-index-import.html[Endpoint documentation] [source,ts] ---- -client.danglingIndices.importDanglingIndex({ index_uuid, accept_data_loss }) +client.danglingIndices.importDanglingIndex({ index_uuid }) ---- [discrete] @@ -4827,7 +4832,7 @@ client.danglingIndices.importDanglingIndex({ index_uuid, accept_data_loss }) * *Request (object):* ** *`index_uuid` (string)*: The UUID of the index to import. Use the get dangling indices API to locate the UUID. -** *`accept_data_loss` (boolean)*: This parameter must be set to true to import a dangling index. +** *`accept_data_loss` (Optional, boolean)*: This parameter must be set to true to import a dangling index. Because Elasticsearch cannot know where the dangling index data came from or determine which shard copies are fresh and which are stale, it cannot guarantee that the imported data represents the latest state of the index when it was last in the cluster. ** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master ** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout @@ -5025,7 +5030,7 @@ client.eql.search({ index, query }) ** *`case_sensitive` (Optional, boolean)* ** *`event_category_field` (Optional, string)*: Field containing the event classification, such as process, file, or network. ** *`tiebreaker_field` (Optional, string)*: Field used to sort hits with the same timestamp in ascending order -** *`timestamp_field` (Optional, string)*: Field containing event timestamp. Default "@timestamp" +** *`timestamp_field` (Optional, string)*: Field containing event timestamp. ** *`fetch_size` (Optional, number)*: Maximum number of events to search at a time for sequence queries. ** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type } | { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type }[])*: Query, written in Query DSL, used to filter the events on which the EQL query runs. ** *`keep_alive` (Optional, string | -1 | 0)* @@ -16013,7 +16018,7 @@ This setting primarily has an impact when a whole message Grok pattern such as ` If the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it. ** *`explain` (Optional, boolean)*: If this parameter is set to `true`, the response includes a field named explanation, which is an array of strings that indicate how the structure finder produced its result. If the structure finder produces unexpected results for some text, use this query parameter to help you determine why the returned structure was chosen. -** *`format` (Optional, string)*: The high level structure of the text. +** *`format` (Optional, Enum("ndjson" | "xml" | "delimited" | "semi_structured_text"))*: The high level structure of the text. Valid values are `ndjson`, `xml`, `delimited`, and `semi_structured_text`. By default, the API chooses the format. In this default scenario, all rows must have the same number of fields for a delimited format to be detected. diff --git a/src/api/api/bulk.ts b/src/api/api/bulk.ts index 392d0116d..60b5854bc 100644 --- a/src/api/api/bulk.ts +++ b/src/api/api/bulk.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Bulk index or delete documents. Perform multiple `index`, `create`, `delete`, and `update` actions in a single request. This reduces overhead and can greatly increase indexing speed. If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias: * To use the `create` action, you must have the `create_doc`, `create`, `index`, or `write` index privilege. Data streams support only the `create` action. * To use the `index` action, you must have the `create`, `index`, or `write` index privilege. * To use the `delete` action, you must have the `delete` or `write` index privilege. * To use the `update` action, you must have the `index` or `write` index privilege. * To automatically create a data stream or index with a bulk API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege. * To make the result of a bulk operation visible to search using the `refresh` parameter, you must have the `maintenance` or `manage` index privilege. Automatic data stream creation requires a matching index template with data stream enabled. The actions are specified in the request body using a newline delimited JSON (NDJSON) structure: ``` action_and_meta_data\n optional_source\n action_and_meta_data\n optional_source\n .... action_and_meta_data\n optional_source\n ``` The `index` and `create` actions expect a source on the next line and have the same semantics as the `op_type` parameter in the standard index API. A `create` action fails if a document with the same ID already exists in the target An `index` action adds or replaces a document as necessary. NOTE: Data streams support only the `create` action. To update or delete a document in a data stream, you must target the backing index containing the document. An `update` action expects that the partial doc, upsert, and script and its options are specified on the next line. A `delete` action does not expect a source on the next line and has the same semantics as the standard delete API. NOTE: 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 NDJSON data to the `_bulk` endpoint, use a `Content-Type` header of `application/json` or `application/x-ndjson`. Because this format uses literal newline characters (`\n`) as delimiters, make sure that the JSON actions and sources are not pretty printed. If you provide a target in the request path, it is used for any actions that don't explicitly specify an `_index` argument. A note on the format: the idea here is to make processing as fast as possible. As some of the actions are redirected to other shards on other nodes, only `action_meta_data` is parsed on the receiving node side. Client libraries using this protocol should try and strive to do something similar on the client side, and reduce buffering as much as possible. There is no "correct" number of actions to perform in a single bulk request. Experiment with different settings to find the optimal size for your particular workload. Note that Elasticsearch limits the maximum size of a HTTP request to 100mb by default so clients must ensure that no request exceeds this size. It is not possible to index a single document that exceeds the size limit, so you must pre-process any such documents into smaller pieces before sending them to Elasticsearch. For instance, split documents into pages or chapters before indexing them, or store raw binary data in a system outside Elasticsearch and replace the raw data with a link to the external system in the documents that you send to Elasticsearch. **Client suppport for bulk requests** Some of the officially supported clients provide helpers to assist with bulk requests and reindexing: * Go: Check out `esutil.BulkIndexer` * Perl: Check out `Search::Elasticsearch::Client::5_0::Bulk` and `Search::Elasticsearch::Client::5_0::Scroll` * Python: Check out `elasticsearch.helpers.*` * JavaScript: Check out `client.helpers.*` * .NET: Check out `BulkAllObservable` * PHP: Check out bulk indexing. * Ruby: Check out `Elasticsearch::Helpers::BulkHelper` **Submitting bulk requests with cURL** If you're providing text file input to `curl`, you must use the `--data-binary` flag instead of plain `-d`. The latter doesn't preserve newlines. For example: ``` $ cat requests { "index" : { "_index" : "test", "_id" : "1" } } { "field1" : "value1" } $ curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk --data-binary "@requests"; echo {"took":7, "errors": false, "items":[{"index":{"_index":"test","_id":"1","_version":1,"result":"created","forced_refresh":false}}]} ``` **Optimistic concurrency control** Each `index` and `delete` action within a bulk API call may include the `if_seq_no` and `if_primary_term` parameters in their respective action and meta data lines. The `if_seq_no` and `if_primary_term` parameters control how operations are run, based on the last modification to existing documents. See Optimistic concurrency control for more details. **Versioning** Each bulk item can include the version value using the `version` field. It automatically follows the behavior of the index or delete operation based on the `_version` mapping. It also support the `version_type`. **Routing** Each bulk item can include the routing value using the `routing` field. It automatically follows the behavior of the index or delete operation based on the `_routing` mapping. NOTE: Data streams do not support custom routing unless they were created with the `allow_custom_routing` setting enabled in the template. **Wait for active shards** When making bulk calls, you can set the `wait_for_active_shards` parameter to require a minimum number of shard copies to be active before starting to process the bulk request. **Refresh** Control when the changes made by this request are visible to search. NOTE: Only the shards that receive the bulk request will be affected by refresh. Imagine a `_bulk?refresh=wait_for` request with three documents in it that happen to be routed to different shards in an index with five shards. The request will only wait for those three shards to refresh. The other two shards that make up the index do not participate in the `_bulk` request at all. + * Bulk index or delete documents. Perform multiple `index`, `create`, `delete`, and `update` actions in a single request. This reduces overhead and can greatly increase indexing speed. If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias: * To use the `create` action, you must have the `create_doc`, `create`, `index`, or `write` index privilege. Data streams support only the `create` action. * To use the `index` action, you must have the `create`, `index`, or `write` index privilege. * To use the `delete` action, you must have the `delete` or `write` index privilege. * To use the `update` action, you must have the `index` or `write` index privilege. * To automatically create a data stream or index with a bulk API request, you must have the `auto_configure`, `create_index`, or `manage` index privilege. * To make the result of a bulk operation visible to search using the `refresh` parameter, you must have the `maintenance` or `manage` index privilege. Automatic data stream creation requires a matching index template with data stream enabled. The actions are specified in the request body using a newline delimited JSON (NDJSON) structure: ``` action_and_meta_data\n optional_source\n action_and_meta_data\n optional_source\n .... action_and_meta_data\n optional_source\n ``` The `index` and `create` actions expect a source on the next line and have the same semantics as the `op_type` parameter in the standard index API. A `create` action fails if a document with the same ID already exists in the target An `index` action adds or replaces a document as necessary. NOTE: Data streams support only the `create` action. To update or delete a document in a data stream, you must target the backing index containing the document. An `update` action expects that the partial doc, upsert, and script and its options are specified on the next line. A `delete` action does not expect a source on the next line and has the same semantics as the standard delete API. NOTE: 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 NDJSON data to the `_bulk` endpoint, use a `Content-Type` header of `application/json` or `application/x-ndjson`. Because this format uses literal newline characters (`\n`) as delimiters, make sure that the JSON actions and sources are not pretty printed. If you provide a target in the request path, it is used for any actions that don't explicitly specify an `_index` argument. A note on the format: the idea here is to make processing as fast as possible. As some of the actions are redirected to other shards on other nodes, only `action_meta_data` is parsed on the receiving node side. Client libraries using this protocol should try and strive to do something similar on the client side, and reduce buffering as much as possible. There is no "correct" number of actions to perform in a single bulk request. Experiment with different settings to find the optimal size for your particular workload. Note that Elasticsearch limits the maximum size of a HTTP request to 100mb by default so clients must ensure that no request exceeds this size. It is not possible to index a single document that exceeds the size limit, so you must pre-process any such documents into smaller pieces before sending them to Elasticsearch. For instance, split documents into pages or chapters before indexing them, or store raw binary data in a system outside Elasticsearch and replace the raw data with a link to the external system in the documents that you send to Elasticsearch. **Client suppport for bulk requests** Some of the officially supported clients provide helpers to assist with bulk requests and reindexing: * Go: Check out `esutil.BulkIndexer` * Perl: Check out `Search::Elasticsearch::Client::5_0::Bulk` and `Search::Elasticsearch::Client::5_0::Scroll` * Python: Check out `elasticsearch.helpers.*` * JavaScript: Check out `client.helpers.*` * Java: Check out `co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester` * .NET: Check out `BulkAllObservable` * PHP: Check out bulk indexing. * Ruby: Check out `Elasticsearch::Helpers::BulkHelper` **Submitting bulk requests with cURL** If you're providing text file input to `curl`, you must use the `--data-binary` flag instead of plain `-d`. The latter doesn't preserve newlines. For example: ``` $ cat requests { "index" : { "_index" : "test", "_id" : "1" } } { "field1" : "value1" } $ curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk --data-binary "@requests"; echo {"took":7, "errors": false, "items":[{"index":{"_index":"test","_id":"1","_version":1,"result":"created","forced_refresh":false}}]} ``` **Optimistic concurrency control** Each `index` and `delete` action within a bulk API call may include the `if_seq_no` and `if_primary_term` parameters in their respective action and meta data lines. The `if_seq_no` and `if_primary_term` parameters control how operations are run, based on the last modification to existing documents. See Optimistic concurrency control for more details. **Versioning** Each bulk item can include the version value using the `version` field. It automatically follows the behavior of the index or delete operation based on the `_version` mapping. It also support the `version_type`. **Routing** Each bulk item can include the routing value using the `routing` field. It automatically follows the behavior of the index or delete operation based on the `_routing` mapping. NOTE: Data streams do not support custom routing unless they were created with the `allow_custom_routing` setting enabled in the template. **Wait for active shards** When making bulk calls, you can set the `wait_for_active_shards` parameter to require a minimum number of shard copies to be active before starting to process the bulk request. **Refresh** Control when the changes made by this request are visible to search. NOTE: Only the shards that receive the bulk request will be affected by refresh. Imagine a `_bulk?refresh=wait_for` request with three documents in it that happen to be routed to different shards in an index with five shards. The request will only wait for those three shards to refresh. The other two shards that make up the index do not participate in the `_bulk` request at all. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-bulk.html | Elasticsearch API documentation} */ export default async function BulkApi (this: That, params: T.BulkRequest | TB.BulkRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/capabilities.ts b/src/api/api/capabilities.ts index 4d6a6a473..8179f1472 100644 --- a/src/api/api/capabilities.ts +++ b/src/api/api/capabilities.ts @@ -39,13 +39,13 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported - * @see {@link https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/README.asciidoc#require-or-skip-api-capabilities | Elasticsearch API documentation} + * Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported. + * @see {@link https://github.com/elastic/elasticsearch/blob/8.19/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/README.asciidoc#require-or-skip-api-capabilities | Elasticsearch API documentation} */ -export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> -export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise -export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { +export default async function CapabilitiesApi (this: That, params?: T.CapabilitiesRequest | TB.CapabilitiesRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function CapabilitiesApi (this: That, params?: T.CapabilitiesRequest | TB.CapabilitiesRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function CapabilitiesApi (this: That, params?: T.CapabilitiesRequest | TB.CapabilitiesRequest, options?: TransportRequestOptions): Promise +export default async function CapabilitiesApi (this: That, params?: T.CapabilitiesRequest | TB.CapabilitiesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -55,6 +55,7 @@ export default async function CapabilitiesApi (this: That, params?: T.TODO | TB. if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } diff --git a/src/api/api/connector.ts b/src/api/api/connector.ts index 1253d46cd..ab543e4df 100644 --- a/src/api/api/connector.ts +++ b/src/api/api/connector.ts @@ -309,21 +309,21 @@ export default class Connector { } /** - * Deletes a connector secret + * Deletes a connector secret. */ - async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async secretDelete (this: That, params: T.ConnectorSecretDeleteRequest | TB.ConnectorSecretDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async secretDelete (this: That, params: T.ConnectorSecretDeleteRequest | TB.ConnectorSecretDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async secretDelete (this: That, params: T.ConnectorSecretDeleteRequest | TB.ConnectorSecretDeleteRequest, options?: TransportRequestOptions): Promise + async secretDelete (this: That, params: T.ConnectorSecretDeleteRequest | TB.ConnectorSecretDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined - params = params ?? {} for (const key in params) { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -340,21 +340,21 @@ export default class Connector { } /** - * Retrieves a secret stored by Connectors + * Retrieves a secret stored by Connectors. */ - async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async secretGet (this: That, params: T.ConnectorSecretGetRequest | TB.ConnectorSecretGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async secretGet (this: That, params: T.ConnectorSecretGetRequest | TB.ConnectorSecretGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async secretGet (this: That, params: T.ConnectorSecretGetRequest | TB.ConnectorSecretGetRequest, options?: TransportRequestOptions): Promise + async secretGet (this: That, params: T.ConnectorSecretGetRequest | TB.ConnectorSecretGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined - params = params ?? {} for (const key in params) { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -371,21 +371,34 @@ export default class Connector { } /** - * Creates a secret for a Connector + * Creates a secret for a Connector. */ - async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async secretPost (this: That, params?: T.ConnectorSecretPostRequest | TB.ConnectorSecretPostRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async secretPost (this: That, params?: T.ConnectorSecretPostRequest | TB.ConnectorSecretPostRequest, options?: TransportRequestOptionsWithMeta): Promise> + async secretPost (this: That, params?: T.ConnectorSecretPostRequest | TB.ConnectorSecretPostRequest, options?: TransportRequestOptions): Promise + async secretPost (this: That, params?: T.ConnectorSecretPostRequest | TB.ConnectorSecretPostRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] + const acceptedBody: string[] = ['value'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + 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] } } @@ -399,21 +412,33 @@ export default class Connector { } /** - * Creates or updates a secret for a Connector + * Creates or updates a secret for a Connector. */ - async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async secretPut (this: That, params: T.ConnectorSecretPutRequest | TB.ConnectorSecretPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async secretPut (this: That, params: T.ConnectorSecretPutRequest | TB.ConnectorSecretPutRequest, options?: TransportRequestOptionsWithMeta): Promise> + async secretPut (this: That, params: T.ConnectorSecretPutRequest | TB.ConnectorSecretPutRequest, options?: TransportRequestOptions): Promise + async secretPut (this: That, params: T.ConnectorSecretPutRequest | TB.ConnectorSecretPutRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] + const acceptedBody: string[] = ['value'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } - params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + 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] } } @@ -1014,7 +1039,7 @@ export default class 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/8.19/update-connector-filtering-validation-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-connector-update-filtering-validation | Elasticsearch API documentation} */ async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithOutMeta): Promise async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -1146,7 +1171,7 @@ export default class Connector { /** * Update the connector is_native flag. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/update-connector-native-api.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-connector-update-native | Elasticsearch API documentation} */ async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithOutMeta): Promise async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/fleet.ts b/src/api/api/fleet.ts index f574773f5..0601b64ad 100644 --- a/src/api/api/fleet.ts +++ b/src/api/api/fleet.ts @@ -45,21 +45,21 @@ export default class Fleet { } /** - * Deletes a secret stored by Fleet + * Deletes a secret stored by Fleet. */ - async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async deleteSecret (this: That, params: T.FleetDeleteSecretRequest | TB.FleetDeleteSecretRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteSecret (this: That, params: T.FleetDeleteSecretRequest | TB.FleetDeleteSecretRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteSecret (this: That, params: T.FleetDeleteSecretRequest | TB.FleetDeleteSecretRequest, options?: TransportRequestOptions): Promise + async deleteSecret (this: That, params: T.FleetDeleteSecretRequest | TB.FleetDeleteSecretRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined - params = params ?? {} for (const key in params) { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -76,21 +76,21 @@ export default class Fleet { } /** - * Retrieves a secret stored by Fleet + * Retrieves a secret stored by Fleet. */ - async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async getSecret (this: That, params: T.FleetGetSecretRequest | TB.FleetGetSecretRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getSecret (this: That, params: T.FleetGetSecretRequest | TB.FleetGetSecretRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getSecret (this: That, params: T.FleetGetSecretRequest | TB.FleetGetSecretRequest, options?: TransportRequestOptions): Promise + async getSecret (this: That, params: T.FleetGetSecretRequest | TB.FleetGetSecretRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined - params = params ?? {} for (const key in params) { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -183,21 +183,33 @@ export default class Fleet { } /** - * Creates a secret stored by Fleet + * Creates a secret stored by Fleet. */ - async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async postSecret (this: That, params: T.FleetPostSecretRequest | TB.FleetPostSecretRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async postSecret (this: That, params: T.FleetPostSecretRequest | TB.FleetPostSecretRequest, options?: TransportRequestOptionsWithMeta): Promise> + async postSecret (this: That, params: T.FleetPostSecretRequest | TB.FleetPostSecretRequest, options?: TransportRequestOptions): Promise + async postSecret (this: That, params: T.FleetPostSecretRequest | TB.FleetPostSecretRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] + const acceptedBody: string[] = ['value'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } - params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + 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] } } diff --git a/src/api/api/monitoring.ts b/src/api/api/monitoring.ts index 8a10dcea9..96f7bc197 100644 --- a/src/api/api/monitoring.ts +++ b/src/api/api/monitoring.ts @@ -52,7 +52,7 @@ export default class Monitoring { async bulk (this: That, params: T.MonitoringBulkRequest | TB.MonitoringBulkRequest, options?: TransportRequestOptionsWithMeta): Promise> async bulk (this: That, params: T.MonitoringBulkRequest | TB.MonitoringBulkRequest, options?: TransportRequestOptions): Promise async bulk (this: That, params: T.MonitoringBulkRequest | TB.MonitoringBulkRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['type'] + const acceptedPath: string[] = [] const acceptedBody: string[] = ['operations'] const querystring: Record = {} // @ts-expect-error @@ -73,10 +73,7 @@ export default class Monitoring { const method = 'POST' const path = '/_monitoring/bulk' const meta: TransportRequestMetadata = { - name: 'monitoring.bulk', - pathParts: { - type: params.type - } + name: 'monitoring.bulk' } return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } diff --git a/src/api/api/profiling.ts b/src/api/api/profiling.ts index fe346c8d4..934ad9d51 100644 --- a/src/api/api/profiling.ts +++ b/src/api/api/profiling.ts @@ -45,22 +45,27 @@ export default class Profiling { } /** - * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling + * Returns basic information about the status of Universal Profiling. * @see {@link https://www.elastic.co/guide/en/observability/8.19/universal-profiling.html | Elasticsearch API documentation} */ - async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async flamegraph (this: That, params: T.ProfilingFlamegraphRequest | TB.ProfilingFlamegraphRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async flamegraph (this: That, params: T.ProfilingFlamegraphRequest | TB.ProfilingFlamegraphRequest, options?: TransportRequestOptionsWithMeta): Promise> + async flamegraph (this: That, params: T.ProfilingFlamegraphRequest | TB.ProfilingFlamegraphRequest, options?: TransportRequestOptions): Promise + async flamegraph (this: That, params: T.ProfilingFlamegraphRequest | TB.ProfilingFlamegraphRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] + const acceptedBody: string[] = ['conditions'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + let body: any = params.body ?? undefined - params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + // @ts-expect-error + body = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -74,22 +79,27 @@ export default class Profiling { } /** - * Extracts raw stacktrace information from Universal Profiling + * Extracts raw stacktrace information from Universal Profiling. * @see {@link https://www.elastic.co/guide/en/observability/8.19/universal-profiling.html | Elasticsearch API documentation} */ - async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async stacktraces (this: That, params: T.ProfilingStacktracesRequest | TB.ProfilingStacktracesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stacktraces (this: That, params: T.ProfilingStacktracesRequest | TB.ProfilingStacktracesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stacktraces (this: That, params: T.ProfilingStacktracesRequest | TB.ProfilingStacktracesRequest, options?: TransportRequestOptions): Promise + async stacktraces (this: That, params: T.ProfilingStacktracesRequest | TB.ProfilingStacktracesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] + const acceptedBody: string[] = ['conditions'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + let body: any = params.body ?? undefined - params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + // @ts-expect-error + body = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -103,13 +113,13 @@ export default class Profiling { } /** - * Returns basic information about the status of Universal Profiling + * Returns basic information about the status of Universal Profiling. * @see {@link https://www.elastic.co/guide/en/observability/8.19/universal-profiling.html | Elasticsearch API documentation} */ - async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async status (this: That, params?: T.ProfilingStatusRequest | TB.ProfilingStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async status (this: That, params?: T.ProfilingStatusRequest | TB.ProfilingStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async status (this: That, params?: T.ProfilingStatusRequest | TB.ProfilingStatusRequest, options?: TransportRequestOptions): Promise + async status (this: That, params?: T.ProfilingStatusRequest | TB.ProfilingStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -119,6 +129,7 @@ export default class Profiling { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -132,22 +143,27 @@ export default class Profiling { } /** - * Extracts a list of topN functions from Universal Profiling + * Extracts a list of topN functions from Universal Profiling. * @see {@link https://www.elastic.co/guide/en/observability/8.19/universal-profiling.html | Elasticsearch API documentation} */ - async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async topnFunctions (this: That, params: T.ProfilingTopnFunctionsRequest | TB.ProfilingTopnFunctionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async topnFunctions (this: That, params: T.ProfilingTopnFunctionsRequest | TB.ProfilingTopnFunctionsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async topnFunctions (this: That, params: T.ProfilingTopnFunctionsRequest | TB.ProfilingTopnFunctionsRequest, options?: TransportRequestOptions): Promise + async topnFunctions (this: That, params: T.ProfilingTopnFunctionsRequest | TB.ProfilingTopnFunctionsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] + const acceptedBody: string[] = ['conditions'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + let body: any = params.body ?? undefined - params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + // @ts-expect-error + body = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } diff --git a/src/api/types.ts b/src/api/types.ts index 1a579cacd..86956a803 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -118,6 +118,28 @@ export interface BulkWriteOperation extends BulkOperationBase { require_alias?: boolean } +export interface CapabilitiesFailedNodeException { + node_id: Id +} + +export interface CapabilitiesRequest extends RequestBase { + method?: CapabilitiesRestMethod + path?: string + parameters?: string | string[] + capabilities?: string | string[] + local_only?: boolean + timeout?: Duration +} + +export interface CapabilitiesResponse { + _nodes: NodeStatistics + cluster_name: Name + supported: boolean | null + failures?: CapabilitiesFailedNodeException[] +} + +export type CapabilitiesRestMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' + export interface ClearScrollRequest extends RequestBase { scroll_id?: ScrollIds } @@ -249,7 +271,7 @@ export interface DeleteByQueryResponse { export interface DeleteByQueryRethrottleRequest extends RequestBase { task_id: TaskId - requests_per_second?: float + requests_per_second: float } export type DeleteByQueryRethrottleResponse = TasksTaskListResponseBase @@ -1109,7 +1131,7 @@ export interface ReindexRethrottleReindexTask { export interface ReindexRethrottleRequest extends RequestBase { task_id: Id - requests_per_second?: float + requests_per_second: float } export interface ReindexRethrottleResponse { @@ -2082,7 +2104,7 @@ export interface UpdateByQueryResponse { export interface UpdateByQueryRethrottleRequest extends RequestBase { task_id: Id - requests_per_second?: float + requests_per_second: float } export interface UpdateByQueryRethrottleResponse { @@ -2093,6 +2115,55 @@ export interface UpdateByQueryRethrottleUpdateByQueryRethrottleNode extends Spec tasks: Record } +export interface InternalDeleteDesiredBalanceRequest extends RequestBase { + master_timeout?: Duration +} + +export type InternalDeleteDesiredBalanceResponse = boolean + +export interface InternalDeleteDesiredNodesRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration +} + +export type InternalDeleteDesiredNodesResponse = boolean + +export interface InternalGetDesiredBalanceRequest extends RequestBase { + master_timeout?: Duration +} + +export type InternalGetDesiredBalanceResponse = any + +export interface InternalGetDesiredNodesRequest extends RequestBase { + master_timeout?: Duration +} + +export type InternalGetDesiredNodesResponse = any + +export interface InternalPrevalidateNodeRemovalRequest extends RequestBase { + names?: string[] + ids?: string[] + external_ids?: string[] + master_timeout?: Duration + timeout?: Duration +} + +export type InternalPrevalidateNodeRemovalResponse = any + +export interface InternalUpdateDesiredNodesRequest extends RequestBase { + history_id: string + version: long + dry_run?: boolean + master_timeout?: Duration + timeout?: Duration + body?: any +} + +export interface InternalUpdateDesiredNodesResponse { + replaced_existing_history_id: boolean + dry_run: boolean +} + export interface SpecUtilsBaseNode { attributes: Record host: Host @@ -7010,6 +7081,20 @@ export interface AsyncSearchAsyncSearchResponseBase { start_time_in_millis: EpochTime completion_time?: DateTime completion_time_in_millis?: EpochTime + error?: ErrorCause +} + +export interface AsyncSearchAsyncSearchResponseException { + is_partial: boolean + is_running: boolean + expiration_time?: DateTime + expiration_time_in_millis: EpochTime + start_time?: DateTime + start_time_in_millis: EpochTime + completion_time?: DateTime + completion_time_in_millis?: EpochTime + error?: ErrorCause + response?: AsyncSearchAsyncSearch> } export interface AsyncSearchDeleteRequest extends RequestBase { @@ -10480,6 +10565,40 @@ export interface ConnectorPutResponse { id: Id } +export interface ConnectorSecretDeleteRequest extends RequestBase { + id: string +} + +export interface ConnectorSecretDeleteResponse { + deleted: boolean +} + +export interface ConnectorSecretGetRequest extends RequestBase { + id: string +} + +export interface ConnectorSecretGetResponse { + id: string + value: string +} + +export interface ConnectorSecretPostRequest extends RequestBase { + value?: string +} + +export interface ConnectorSecretPostResponse { + id: string +} + +export interface ConnectorSecretPutRequest extends RequestBase { + id: string + value: string +} + +export interface ConnectorSecretPutResponse { + result: Result +} + export interface ConnectorSyncJobCancelRequest extends RequestBase { connector_sync_job_id: Id } @@ -10692,7 +10811,7 @@ export interface ConnectorUpdateStatusResponse { export interface DanglingIndicesDeleteDanglingIndexRequest extends RequestBase { index_uuid: Uuid - accept_data_loss: boolean + accept_data_loss?: boolean master_timeout?: Duration timeout?: Duration } @@ -10701,7 +10820,7 @@ export type DanglingIndicesDeleteDanglingIndexResponse = AcknowledgedResponseBas export interface DanglingIndicesImportDanglingIndexRequest extends RequestBase { index_uuid: Uuid - accept_data_loss: boolean + accept_data_loss?: boolean master_timeout?: Duration timeout?: Duration } @@ -11054,6 +11173,23 @@ export interface FeaturesResetFeaturesResponse { export type FleetCheckpoint = long +export interface FleetDeleteSecretRequest extends RequestBase { + id: string +} + +export interface FleetDeleteSecretResponse { + deleted: boolean +} + +export interface FleetGetSecretRequest extends RequestBase { + id: string +} + +export interface FleetGetSecretResponse { + id: string + value: string +} + export interface FleetGlobalCheckpointsRequest extends RequestBase { index: IndexName | IndexAlias wait_for_advance?: boolean @@ -11089,6 +11225,14 @@ export interface FleetMsearchResponse { docs: MsearchResponseItem[] } +export interface FleetPostSecretRequest extends RequestBase { + value: string +} + +export interface FleetPostSecretResponse { + id: string +} + export interface FleetSearchRequest extends RequestBase { index: IndexName | IndexAlias allow_no_indices?: boolean @@ -17829,7 +17973,6 @@ export interface MlValidateDetectorRequest extends RequestBase { export type MlValidateDetectorResponse = AcknowledgedResponseBase export interface MonitoringBulkRequest extends RequestBase { - type?: string system_id: string system_api_version: string interval: Duration @@ -18787,6 +18930,36 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { nodes: Record } +export interface ProfilingFlamegraphRequest extends RequestBase { + conditions?: any +} + +export type ProfilingFlamegraphResponse = any + +export interface ProfilingStacktracesRequest extends RequestBase { + conditions?: any +} + +export type ProfilingStacktracesResponse = any + +export type ProfilingStatusProfilingOperationMode = 'RUNNING' | 'STOPPING' | 'STOPPED' + +export interface ProfilingStatusRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration + wait_for_resources_created?: boolean +} + +export interface ProfilingStatusResponse { + operation_mode: ProfilingStatusProfilingOperationMode +} + +export interface ProfilingTopnFunctionsRequest extends RequestBase { + conditions?: any +} + +export type ProfilingTopnFunctionsResponse = any + export interface QueryRulesQueryRule { rule_id: Id type: QueryRulesQueryRuleType @@ -21594,13 +21767,15 @@ export interface TextStructureFindMessageStructureResponse { timestamp_field?: Field } +export type TextStructureFindStructureFindStructureFormat = 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text' + export interface TextStructureFindStructureRequest { charset?: string column_names?: string delimiter?: string ecs_compatibility?: string explain?: boolean - format?: string + format?: TextStructureFindStructureFindStructureFormat grok_pattern?: GrokPattern has_header_row?: boolean line_merge_size_limit?: uint diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index b61d17fc2..78147a571 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -119,6 +119,28 @@ export interface BulkWriteOperation extends BulkOperationBase { require_alias?: boolean } +export interface CapabilitiesFailedNodeException { + node_id: Id +} + +export interface CapabilitiesRequest extends RequestBase { + method?: CapabilitiesRestMethod + path?: string + parameters?: string | string[] + capabilities?: string | string[] + local_only?: boolean + timeout?: Duration +} + +export interface CapabilitiesResponse { + _nodes: NodeStatistics + cluster_name: Name + supported: boolean | null + failures?: CapabilitiesFailedNodeException[] +} + +export type CapabilitiesRestMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' + export interface ClearScrollRequest extends RequestBase { scroll_id?: ScrollIds /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ @@ -264,7 +286,7 @@ export interface DeleteByQueryResponse { export interface DeleteByQueryRethrottleRequest extends RequestBase { task_id: TaskId - requests_per_second?: float + requests_per_second: float } export type DeleteByQueryRethrottleResponse = TasksTaskListResponseBase @@ -1154,7 +1176,7 @@ export interface ReindexRethrottleReindexTask { export interface ReindexRethrottleRequest extends RequestBase { task_id: Id - requests_per_second?: float + requests_per_second: float } export interface ReindexRethrottleResponse { @@ -2159,7 +2181,7 @@ export interface UpdateByQueryResponse { export interface UpdateByQueryRethrottleRequest extends RequestBase { task_id: Id - requests_per_second?: float + requests_per_second: float } export interface UpdateByQueryRethrottleResponse { @@ -2170,6 +2192,56 @@ export interface UpdateByQueryRethrottleUpdateByQueryRethrottleNode extends Spec tasks: Record } +export interface InternalDeleteDesiredBalanceRequest extends RequestBase { + master_timeout?: Duration +} + +export type InternalDeleteDesiredBalanceResponse = boolean + +export interface InternalDeleteDesiredNodesRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration +} + +export type InternalDeleteDesiredNodesResponse = boolean + +export interface InternalGetDesiredBalanceRequest extends RequestBase { + master_timeout?: Duration +} + +export type InternalGetDesiredBalanceResponse = any + +export interface InternalGetDesiredNodesRequest extends RequestBase { + master_timeout?: Duration +} + +export type InternalGetDesiredNodesResponse = any + +export interface InternalPrevalidateNodeRemovalRequest extends RequestBase { + names?: string[] + ids?: string[] + external_ids?: string[] + master_timeout?: Duration + timeout?: Duration +} + +export type InternalPrevalidateNodeRemovalResponse = any + +export interface InternalUpdateDesiredNodesRequest extends RequestBase { + history_id: string + version: long + dry_run?: boolean + master_timeout?: Duration + timeout?: Duration + /** @deprecated The use of the 'body' key has been deprecated, use 'body' instead. */ + body?: any +} + +export interface InternalUpdateDesiredNodesResponse { + replaced_existing_history_id: boolean + dry_run: boolean +} + export interface SpecUtilsBaseNode { attributes: Record host: Host @@ -7087,6 +7159,20 @@ export interface AsyncSearchAsyncSearchResponseBase { start_time_in_millis: EpochTime completion_time?: DateTime completion_time_in_millis?: EpochTime + error?: ErrorCause +} + +export interface AsyncSearchAsyncSearchResponseException { + is_partial: boolean + is_running: boolean + expiration_time?: DateTime + expiration_time_in_millis: EpochTime + start_time?: DateTime + start_time_in_millis: EpochTime + completion_time?: DateTime + completion_time_in_millis?: EpochTime + error?: ErrorCause + response?: AsyncSearchAsyncSearch> } export interface AsyncSearchDeleteRequest extends RequestBase { @@ -10594,6 +10680,46 @@ export interface ConnectorPutResponse { id: Id } +export interface ConnectorSecretDeleteRequest extends RequestBase { + id: string +} + +export interface ConnectorSecretDeleteResponse { + deleted: boolean +} + +export interface ConnectorSecretGetRequest extends RequestBase { + id: string +} + +export interface ConnectorSecretGetResponse { + id: string + value: string +} + +export interface ConnectorSecretPostRequest extends RequestBase { + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + value?: string + } +} + +export interface ConnectorSecretPostResponse { + id: string +} + +export interface ConnectorSecretPutRequest extends RequestBase { + id: string + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + value: string + } +} + +export interface ConnectorSecretPutResponse { + result: Result +} + export interface ConnectorSyncJobCancelRequest extends RequestBase { connector_sync_job_id: Id } @@ -10857,7 +10983,7 @@ export interface ConnectorUpdateStatusResponse { export interface DanglingIndicesDeleteDanglingIndexRequest extends RequestBase { index_uuid: Uuid - accept_data_loss: boolean + accept_data_loss?: boolean master_timeout?: Duration timeout?: Duration } @@ -10866,7 +10992,7 @@ export type DanglingIndicesDeleteDanglingIndexResponse = AcknowledgedResponseBas export interface DanglingIndicesImportDanglingIndexRequest extends RequestBase { index_uuid: Uuid - accept_data_loss: boolean + accept_data_loss?: boolean master_timeout?: Duration timeout?: Duration } @@ -11231,6 +11357,23 @@ export interface FeaturesResetFeaturesResponse { export type FleetCheckpoint = long +export interface FleetDeleteSecretRequest extends RequestBase { + id: string +} + +export interface FleetDeleteSecretResponse { + deleted: boolean +} + +export interface FleetGetSecretRequest extends RequestBase { + id: string +} + +export interface FleetGetSecretResponse { + id: string + value: string +} + export interface FleetGlobalCheckpointsRequest extends RequestBase { index: IndexName | IndexAlias wait_for_advance?: boolean @@ -11267,6 +11410,17 @@ export interface FleetMsearchResponse { docs: MsearchResponseItem[] } +export interface FleetPostSecretRequest extends RequestBase { + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + value: string + } +} + +export interface FleetPostSecretResponse { + id: string +} + export interface FleetSearchRequest extends RequestBase { index: IndexName | IndexAlias allow_no_indices?: boolean @@ -18282,7 +18436,6 @@ export interface MlValidateDetectorRequest extends RequestBase { export type MlValidateDetectorResponse = AcknowledgedResponseBase export interface MonitoringBulkRequest extends RequestBase { - type?: string system_id: string system_api_version: string interval: Duration @@ -19244,6 +19397,39 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { nodes: Record } +export interface ProfilingFlamegraphRequest extends RequestBase { + /** @deprecated The use of the 'body' key has been deprecated, use 'conditions' instead. */ + body?: any +} + +export type ProfilingFlamegraphResponse = any + +export interface ProfilingStacktracesRequest extends RequestBase { + /** @deprecated The use of the 'body' key has been deprecated, use 'conditions' instead. */ + body?: any +} + +export type ProfilingStacktracesResponse = any + +export type ProfilingStatusProfilingOperationMode = 'RUNNING' | 'STOPPING' | 'STOPPED' + +export interface ProfilingStatusRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration + wait_for_resources_created?: boolean +} + +export interface ProfilingStatusResponse { + operation_mode: ProfilingStatusProfilingOperationMode +} + +export interface ProfilingTopnFunctionsRequest extends RequestBase { + /** @deprecated The use of the 'body' key has been deprecated, use 'conditions' instead. */ + body?: any +} + +export type ProfilingTopnFunctionsResponse = any + export interface QueryRulesQueryRule { rule_id: Id type: QueryRulesQueryRuleType @@ -22215,13 +22401,15 @@ export interface TextStructureFindMessageStructureResponse { timestamp_field?: Field } +export type TextStructureFindStructureFindStructureFormat = 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text' + export interface TextStructureFindStructureRequest { charset?: string column_names?: string delimiter?: string ecs_compatibility?: string explain?: boolean - format?: string + format?: TextStructureFindStructureFindStructureFormat grok_pattern?: GrokPattern has_header_row?: boolean line_merge_size_limit?: uint