From 0b504428f129227ed1d256a498bd03d14a2d9881 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Tue, 9 Jul 2024 04:32:23 +1000 Subject: [PATCH] Auto-generated code for 8.14 (#2307) --- docs/reference.asciidoc | 612 ++++++++++++++-------- src/api/api/async_search.ts | 33 +- src/api/api/autoscaling.ts | 30 +- src/api/api/bulk.ts | 9 +- src/api/api/cat.ts | 182 ++++++- src/api/api/ccr.ts | 102 +++- src/api/api/clear_scroll.ts | 9 +- src/api/api/close_point_in_time.ts | 6 +- src/api/api/cluster.ts | 106 +++- src/api/api/count.ts | 9 +- src/api/api/create.ts | 10 +- src/api/api/dangling_indices.ts | 22 +- src/api/api/delete.ts | 10 +- src/api/api/delete_by_query.ts | 9 +- src/api/api/delete_by_query_rethrottle.ts | 9 +- src/api/api/delete_script.ts | 9 +- src/api/api/enrich.ts | 38 +- src/api/api/eql.ts | 33 +- src/api/api/esql.ts | 67 ++- src/api/api/exists.ts | 10 +- src/api/api/exists_source.ts | 10 +- src/api/api/explain.ts | 10 +- src/api/api/features.ts | 11 +- src/api/api/field_caps.ts | 9 +- src/api/api/fleet.ts | 46 +- src/api/api/get.ts | 10 +- src/api/api/get_script.ts | 9 +- src/api/api/get_script_context.ts | 6 +- src/api/api/get_script_languages.ts | 6 +- src/api/api/get_source.ts | 10 +- src/api/api/graph.ts | 9 +- src/api/api/health_report.ts | 9 +- src/api/api/ilm.ts | 77 ++- src/api/api/index.ts | 10 +- src/api/api/indices.ts | 480 ++++++++++++++--- src/api/api/inference.ts | 42 +- src/api/api/info.ts | 6 +- src/api/api/ingest.ts | 43 +- src/api/api/knn_search.ts | 9 +- src/api/api/license.ts | 36 +- src/api/api/logstash.ts | 25 +- src/api/api/mget.ts | 9 +- src/api/api/migration.ts | 19 +- src/api/api/ml.ts | 582 +++++++++++++++++--- src/api/api/monitoring.ts | 9 +- src/api/api/msearch.ts | 9 +- src/api/api/msearch_template.ts | 9 +- src/api/api/mtermvectors.ts | 9 +- src/api/api/nodes.ts | 62 ++- src/api/api/open_point_in_time.ts | 9 +- src/api/api/ping.ts | 6 +- src/api/api/profiling.ts | 162 ++++++ src/api/api/put_script.ts | 10 +- src/api/api/query_ruleset.ts | 30 +- src/api/api/rank_eval.ts | 9 +- src/api/api/reindex.ts | 6 +- src/api/api/reindex_rethrottle.ts | 9 +- src/api/api/render_search_template.ts | 9 +- src/api/api/rollup.ts | 65 ++- src/api/api/scripts_painless_execute.ts | 6 +- src/api/api/scroll.ts | 9 +- src/api/api/search.ts | 9 +- src/api/api/search_application.ts | 79 ++- src/api/api/search_mvt.ts | 13 +- src/api/api/search_shards.ts | 9 +- src/api/api/search_template.ts | 9 +- src/api/api/searchable_snapshots.ts | 34 +- src/api/api/security.ts | 428 ++++++++++++--- src/api/api/shutdown.ts | 25 +- src/api/api/simulate.ts | 85 +++ src/api/api/slm.ts | 58 +- src/api/api/snapshot.ts | 104 +++- src/api/api/sql.ts | 40 +- src/api/api/ssl.ts | 6 +- src/api/api/synonyms.ts | 57 +- src/api/api/tasks.ts | 22 +- src/api/api/terms_enum.ts | 9 +- src/api/api/termvectors.ts | 10 +- src/api/api/text_structure.ts | 69 ++- src/api/api/transform.ts | 86 ++- src/api/api/update.ts | 10 +- src/api/api/update_by_query.ts | 11 +- src/api/api/update_by_query_rethrottle.ts | 9 +- src/api/api/watcher.ts | 91 +++- src/api/api/xpack.ts | 11 +- src/api/index.ts | 16 + src/api/types.ts | 10 +- src/api/typesWithBodyKey.ts | 10 +- 88 files changed, 3870 insertions(+), 676 deletions(-) create mode 100644 src/api/api/profiling.ts create mode 100644 src/api/api/simulate.ts diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 400238eda..612db6d1b 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -1271,8 +1271,7 @@ Set to 'all' or any positive integer up to the total number of shards in the ind [discrete] === update_by_query -Updates documents that match the specified query. If no query is specified, - performs an update on every document in the index without changing the source, +Performs an update on every document in the index without changing the source, for example to pick up a mapping change. {ref}/docs-update-by-query.html[Endpoint documentation] @@ -1517,6 +1516,68 @@ A partial reduction is performed every time the coordinating node has received a ** *`_source_includes` (Optional, string | string[])*: A list of fields to extract and return from the _source field ** *`q` (Optional, string)*: Query in the Lucene query string syntax +[discrete] +=== autoscaling +[discrete] +==== delete_autoscaling_policy +Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +{ref}/autoscaling-delete-autoscaling-policy.html[Endpoint documentation] +[source,ts] +---- +client.autoscaling.deleteAutoscalingPolicy({ name }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (string)*: the name of the autoscaling policy + +[discrete] +==== get_autoscaling_capacity +Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +{ref}/autoscaling-get-autoscaling-capacity.html[Endpoint documentation] +[source,ts] +---- +client.autoscaling.getAutoscalingCapacity() +---- + + +[discrete] +==== get_autoscaling_policy +Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +{ref}/autoscaling-get-autoscaling-capacity.html[Endpoint documentation] +[source,ts] +---- +client.autoscaling.getAutoscalingPolicy({ name }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (string)*: the name of the autoscaling policy + +[discrete] +==== put_autoscaling_policy +Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +{ref}/autoscaling-put-autoscaling-policy.html[Endpoint documentation] +[source,ts] +---- +client.autoscaling.putAutoscalingPolicy({ name }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (string)*: the name of the autoscaling policy +** *`policy` (Optional, { roles, deciders })* + [discrete] === cat [discrete] @@ -2855,6 +2916,24 @@ client.features.resetFeatures() [discrete] === fleet +[discrete] +==== delete_secret +Deletes a secret stored by Fleet. +[source,ts] +---- +client.fleet.deleteSecret() +---- + + +[discrete] +==== get_secret +Retrieves a secret stored by Fleet. +[source,ts] +---- +client.fleet.getSecret() +---- + + [discrete] ==== global_checkpoints Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. @@ -2911,6 +2990,15 @@ Elasticsearch to immediately execute the search. an error with no partial results. Defaults to the configured cluster setting `search.default_allow_partial_results` which is true by default. +[discrete] +==== post_secret +Creates a secret stored by Fleet. +[source,ts] +---- +client.fleet.postSecret() +---- + + [discrete] ==== search Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. @@ -4766,83 +4854,6 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. ** *`rewrite` (Optional, boolean)*: If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed. ** *`q` (Optional, string)*: Query in the Lucene query string syntax. -[discrete] -=== inference -[discrete] -==== delete_model -Delete model in the Inference API - -{ref}/delete-inference-api.html[Endpoint documentation] -[source,ts] ----- -client.inference.deleteModel({ inference_id }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`inference_id` (string)*: The inference Id -** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding" | "rerank" | "completion"))*: The task type - -[discrete] -==== get_model -Get a model in the Inference API - -{ref}/get-inference-api.html[Endpoint documentation] -[source,ts] ----- -client.inference.getModel({ inference_id }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`inference_id` (string)*: The inference Id -** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding" | "rerank" | "completion"))*: The task type - -[discrete] -==== inference -Perform inference on a model - -{ref}/post-inference-api.html[Endpoint documentation] -[source,ts] ----- -client.inference.inference({ inference_id, input }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`inference_id` (string)*: The inference Id -** *`input` (string | string[])*: Text input to the model. -Either a string or an array of strings. -** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding" | "rerank" | "completion"))*: The task type -** *`query` (Optional, string)*: Query input, required for rerank task. -Not required for other tasks. -** *`task_settings` (Optional, User-defined value)*: Optional task settings -** *`timeout` (Optional, string | -1 | 0)*: Specifies the amount of time to wait for the inference request to complete. - -[discrete] -==== put_model -Configure a model for use in the Inference API - -{ref}/put-inference-api.html[Endpoint documentation] -[source,ts] ----- -client.inference.putModel({ inference_id }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`inference_id` (string)*: The inference Id -** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding" | "rerank" | "completion"))*: The task type -** *`model_config` (Optional, { service, service_settings, task_settings })* - [discrete] === ingest [discrete] @@ -6977,6 +6988,68 @@ client.ml.upgradeJobSnapshot({ job_id, snapshot_id }) Otherwise, it responds as soon as the upgrade task is assigned to a node. ** *`timeout` (Optional, string | -1 | 0)*: Controls the time to wait for the request to complete. +[discrete] +==== validate +Validates an anomaly detection job. + +https://www.elastic.co/guide/en/machine-learning/8.14/ml-jobs.html[Endpoint documentation] +[source,ts] +---- +client.ml.validate({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`job_id` (Optional, string)* +** *`analysis_config` (Optional, { bucket_span, categorization_analyzer, categorization_field_name, categorization_filters, detectors, influencers, latency, model_prune_window, multivariate_by_fields, per_partition_categorization, summary_count_field_name })* +** *`analysis_limits` (Optional, { categorization_examples_limit, model_memory_limit })* +** *`data_description` (Optional, { format, time_field, time_format, field_delimiter })* +** *`description` (Optional, string)* +** *`model_plot` (Optional, { annotations_enabled, enabled, terms })* +** *`model_snapshot_id` (Optional, string)* +** *`model_snapshot_retention_days` (Optional, number)* +** *`results_index_name` (Optional, string)* + +[discrete] +==== validate_detector +Validates an anomaly detection detector. + +https://www.elastic.co/guide/en/machine-learning/8.14/ml-jobs.html[Endpoint documentation] +[source,ts] +---- +client.ml.validateDetector({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`detector` (Optional, { by_field_name, custom_rules, detector_description, detector_index, exclude_frequent, field_name, function, over_field_name, partition_field_name, use_null })* + +[discrete] +=== monitoring +[discrete] +==== bulk +Used by the monitoring features to send monitoring data. + +{ref}/monitor-elasticsearch-cluster.html[Endpoint documentation] +[source,ts] +---- +client.monitoring.bulk({ system_id, system_api_version, interval }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`system_id` (string)*: Identifier of the monitored system +** *`system_api_version` (string)* +** *`interval` (string | -1 | 0)*: Collection interval (e.g., '10s' or '10000ms') of the payload +** *`type` (Optional, string)*: Default document type for items which don't provide one +** *`operations` (Optional, { index, create, update, delete } | { detect_noop, doc, doc_as_upsert, script, scripted_upsert, _source, upsert } | object[])* + [discrete] === nodes [discrete] @@ -7129,6 +7202,52 @@ A list of the following options: `_all`, `rest_actions`. ** *`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] +=== profiling +[discrete] +==== flamegraph +Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. + +https://www.elastic.co/guide/en/observability/8.14/universal-profiling.html[Endpoint documentation] +[source,ts] +---- +client.profiling.flamegraph() +---- + + +[discrete] +==== stacktraces +Extracts raw stacktrace information from Universal Profiling. + +https://www.elastic.co/guide/en/observability/8.14/universal-profiling.html[Endpoint documentation] +[source,ts] +---- +client.profiling.stacktraces() +---- + + +[discrete] +==== status +Returns basic information about the status of Universal Profiling. + +https://www.elastic.co/guide/en/observability/8.14/universal-profiling.html[Endpoint documentation] +[source,ts] +---- +client.profiling.status() +---- + + +[discrete] +==== topn_functions +Extracts a list of topN functions from Universal Profiling. + +https://www.elastic.co/guide/en/observability/8.14/universal-profiling.html[Endpoint documentation] +[source,ts] +---- +client.profiling.topnFunctions() +---- + + [discrete] === query_ruleset [discrete] @@ -7448,17 +7567,6 @@ client.searchApplication.list({ ... }) ** *`from` (Optional, number)*: Starting offset. ** *`size` (Optional, number)*: Specifies a max number of results to get. -[discrete] -==== post_behavioral_analytics_event -Creates a behavioral analytics event for existing collection. - -http://todo.com/tbd[Endpoint documentation] -[source,ts] ----- -client.searchApplication.postBehavioralAnalyticsEvent() ----- - - [discrete] ==== put Creates or updates a search application. @@ -7493,17 +7601,6 @@ client.searchApplication.putBehavioralAnalytics({ name }) * *Request (object):* ** *`name` (string)*: The name of the analytics collection to be created or updated. -[discrete] -==== render_query -Renders a query for given search application search parameters - -{ref}/search-application-render-query.html[Endpoint documentation] -[source,ts] ----- -client.searchApplication.renderQuery() ----- - - [discrete] ==== search Perform a search against a search application @@ -7605,6 +7702,25 @@ client.searchableSnapshots.stats({ ... }) [discrete] === security +[discrete] +==== activate_user_profile +Creates or updates the user profile on behalf of another user. + +{ref}/security-api-activate-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.activateUserProfile({ grant_type }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`grant_type` (Enum("password" | "access_token"))* +** *`access_token` (Optional, string)* +** *`password` (Optional, string)* +** *`username` (Optional, string)* + [discrete] ==== authenticate Enables authentication as a user and retrieve information about the authenticated user. @@ -7616,17 +7732,6 @@ client.security.authenticate() ---- -[discrete] -==== bulk_update_api_keys -Updates the attributes of multiple existing API keys. - -{ref}/security-api-bulk-update-api-keys.html[Endpoint documentation] -[source,ts] ----- -client.security.bulkUpdateApiKeys() ----- - - [discrete] ==== change_password Changes the passwords of users in the native realm and built-in users. @@ -7755,17 +7860,6 @@ 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] -==== create_cross_cluster_api_key -Creates a cross-cluster API key for API key based remote cluster access. - -{ref}/security-api-create-cross-cluster-api-key.html[Endpoint documentation] -[source,ts] ----- -client.security.createCrossClusterApiKey() ----- - - [discrete] ==== create_service_token Creates a service account token for access without requiring basic authentication. @@ -7890,6 +7984,25 @@ client.security.disableUser({ username }) ** *`username` (string)*: The username of the user to disable ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. +[discrete] +==== disable_user_profile +Disables a user profile so it's not visible in user profile searches. + +{ref}/security-api-disable-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.disableUserProfile({ uid }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`uid` (string)*: Unique identifier for the user profile. +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If 'true', Elasticsearch refreshes the affected shards to make this operation +visible to search, if 'wait_for' then wait for a refresh to make this operation +visible to search, if 'false' do nothing with refreshes. + [discrete] ==== enable_user Enables users in the native realm. @@ -7907,6 +8020,25 @@ client.security.enableUser({ username }) ** *`username` (string)*: The username of the user to enable ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. +[discrete] +==== enable_user_profile +Enables a user profile so it's visible in user profile searches. + +{ref}/security-api-enable-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.enableUserProfile({ uid }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`uid` (string)*: Unique identifier for the user profile. +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If 'true', Elasticsearch refreshes the affected shards to make this operation +visible to search, if 'wait_for' then wait for a refresh to make this operation +visible to search, if 'false' do nothing with refreshes. + [discrete] ==== enroll_kibana Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. @@ -8055,17 +8187,6 @@ client.security.getServiceCredentials({ namespace, service }) ** *`namespace` (string)*: Name of the namespace. ** *`service` (string)*: Name of the service name. -[discrete] -==== get_settings -Retrieve settings for the security system indices - -{ref}/security-api-get-settings.html[Endpoint documentation] -[source,ts] ----- -client.security.getSettings() ----- - - [discrete] ==== get_token Creates a bearer token for access without requiring basic authentication. @@ -8122,6 +8243,26 @@ client.security.getUserPrivileges({ ... }) ** *`priviledge` (Optional, string)*: The name of the privilege. If you do not specify this parameter, the API returns information about all privileges for the requested application. ** *`username` (Optional, string | null)* +[discrete] +==== get_user_profile +Retrieves user profiles for the given unique ID(s). + +{ref}/security-api-get-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.getUserProfile({ uid }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`uid` (string | string[])*: A unique identifier for the user profile. +** *`data` (Optional, string | string[])*: List of filters for the `data` field of the profile document. +To return all content use `data=*`. To return a subset of content +use `data=` to retrieve content nested under the specified ``. +By default returns no `data` content. + [discrete] ==== grant_api_key Creates an API key on behalf of another user. @@ -8167,6 +8308,23 @@ client.security.hasPrivileges({ ... }) ** *`cluster` (Optional, Enum("all" | "cancel_task" | "create_snapshot" | "cross_cluster_replication" | "cross_cluster_search" | "delegate_pki" | "grant_api_key" | "manage" | "manage_api_key" | "manage_autoscaling" | "manage_behavioral_analytics" | "manage_ccr" | "manage_data_frame_transforms" | "manage_data_stream_global_retention" | "manage_enrich" | "manage_ilm" | "manage_index_templates" | "manage_inference" | "manage_ingest_pipelines" | "manage_logstash_pipelines" | "manage_ml" | "manage_oidc" | "manage_own_api_key" | "manage_pipeline" | "manage_rollup" | "manage_saml" | "manage_search_application" | "manage_search_query_rules" | "manage_search_synonyms" | "manage_security" | "manage_service_account" | "manage_slm" | "manage_token" | "manage_transform" | "manage_user_profile" | "manage_watcher" | "monitor" | "monitor_data_frame_transforms" | "monitor_data_stream_global_retention" | "monitor_enrich" | "monitor_inference" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_connector_secrets" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])*: A list of the cluster privileges that you want to check. ** *`index` (Optional, { names, privileges, allow_restricted_indices }[])* +[discrete] +==== has_privileges_user_profile +Determines whether the users associated with the specified profile IDs have all the requested privileges. + +{ref}/security-api-has-privileges-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.hasPrivilegesUserProfile({ uids, privileges }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`uids` (string[])*: A list of profile IDs. The privileges are checked for associated users of the profiles. +** *`privileges` ({ application, cluster, index })* + [discrete] ==== invalidate_api_key Invalidates one or more API keys. @@ -8212,39 +8370,6 @@ client.security.invalidateToken({ ... }) ** *`realm_name` (Optional, string)* ** *`username` (Optional, string)* -[discrete] -==== oidc_authenticate -Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair - -{ref}/security-api-oidc-authenticate.html[Endpoint documentation] -[source,ts] ----- -client.security.oidcAuthenticate() ----- - - -[discrete] -==== oidc_logout -Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API - -{ref}/security-api-oidc-logout.html[Endpoint documentation] -[source,ts] ----- -client.security.oidcLogout() ----- - - -[discrete] -==== oidc_prepare_authentication -Creates an OAuth 2.0 authentication request as a URL string - -{ref}/security-api-oidc-prepare-authentication.html[Endpoint documentation] -[source,ts] ----- -client.security.oidcPrepareAuthentication() ----- - - [discrete] ==== put_privileges Adds or updates application privileges. @@ -8487,6 +8612,32 @@ client.security.samlServiceProviderMetadata({ realm_name }) * *Request (object):* ** *`realm_name` (string)*: The name of the SAML realm in Elasticsearch. +[discrete] +==== suggest_user_profiles +Get suggestions for user profiles that match specified search criteria. + +{ref}/security-api-suggest-user-profile.html[Endpoint documentation] +[source,ts] +---- +client.security.suggestUserProfiles({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (Optional, string)*: Query string used to match name-related fields in user profile documents. +Name-related fields are the user's `username`, `full_name`, and `email`. +** *`size` (Optional, number)*: Number of profiles to return. +** *`data` (Optional, string | string[])*: List of filters for the `data` field of the profile document. +To return all content use `data=*`. To return a subset of content +use `data=` to retrieve content nested under the specified ``. +By default returns no `data` content. +** *`hint` (Optional, { uids, labels })*: Extra search criteria to improve relevance of the suggestion result. +Profiles matching the spcified hint are ranked higher in the response. +Profiles not matching the hint don't exclude the profile from the response +as long as the profile matches the `name` field query. + [discrete] ==== update_api_key Updates attributes of an existing API key. @@ -8507,26 +8658,102 @@ client.security.updateApiKey({ id }) ** *`expiration` (Optional, string | -1 | 0)*: Expiration time for the API key. [discrete] -==== update_cross_cluster_api_key -Updates attributes of an existing cross-cluster API key. +==== update_user_profile_data +Update application specific data for the user profile of the given unique ID. -{ref}/security-api-update-cross-cluster-api-key.html[Endpoint documentation] +{ref}/security-api-update-user-profile-data.html[Endpoint documentation] [source,ts] ---- -client.security.updateCrossClusterApiKey() +client.security.updateUserProfileData({ uid }) ---- - [discrete] -==== update_settings -Update settings for the security system index +==== Arguments -{ref}/security-api-update-settings.html[Endpoint documentation] +* *Request (object):* +** *`uid` (string)*: A unique identifier for the user profile. +** *`labels` (Optional, Record)*: Searchable data that you want to associate with the user profile. This +field supports a nested data structure. +** *`data` (Optional, Record)*: Non-searchable data that you want to associate with the user profile. +This field supports a nested data structure. +** *`if_seq_no` (Optional, number)*: Only perform the operation if the document has this sequence number. +** *`if_primary_term` (Optional, number)*: Only perform the operation if the document has this primary term. +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If 'true', Elasticsearch refreshes the affected shards to make this operation +visible to search, if 'wait_for' then wait for a refresh to make this operation +visible to search, if 'false' do nothing with refreshes. + +[discrete] +=== shutdown +[discrete] +==== delete_node +Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +https://www.elastic.co/guide/en/elasticsearch/reference/current[Endpoint documentation] [source,ts] ---- -client.security.updateSettings() +client.shutdown.deleteNode({ node_id }) ---- +[discrete] +==== Arguments + +* *Request (object):* +** *`node_id` (string)*: The node id of node to be removed from the shutdown state +** *`master_timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. +** *`timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + +[discrete] +==== get_node +Retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +https://www.elastic.co/guide/en/elasticsearch/reference/current[Endpoint documentation] +[source,ts] +---- +client.shutdown.getNode({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`node_id` (Optional, string | string[])*: Which node for which to retrieve the shutdown status +** *`master_timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. +** *`timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + +[discrete] +==== put_node +Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + +https://www.elastic.co/guide/en/elasticsearch/reference/current[Endpoint documentation] +[source,ts] +---- +client.shutdown.putNode({ node_id, type, reason }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`node_id` (string)*: The node id of node to be shut down +** *`type` (Enum("restart" | "remove" | "replace"))*: Valid values are restart, remove, or replace. +Use restart when you need to temporarily shut down a node to perform an upgrade, make configuration changes, or perform other maintenance. +Because the node is expected to rejoin the cluster, data is not migrated off of the node. +Use remove when you need to permanently remove a node from the cluster. +The node is not marked ready for shutdown until data is migrated off of the node Use replace to do a 1:1 replacement of a node with another node. +Certain allocation decisions will be ignored (such as disk watermarks) in the interest of true replacement of the source node with the target node. +During a replace-type shutdown, rollover and index creation may result in unassigned shards, and shrink may fail until the replacement is complete. +** *`reason` (string)*: A human-readable reason that the node is being shut down. +This field provides information for other cluster operators; it does not affect the shut down process. +** *`allocation_delay` (Optional, string)*: Only valid if type is restart. +Controls how long Elasticsearch will wait for the node to restart and join the cluster before reassigning its shards to other nodes. +This works the same as delaying allocation with the index.unassigned.node_left.delayed_timeout setting. +If you specify both a restart allocation delay and an index-level allocation delay, the longer of the two is used. +** *`target_node_name` (Optional, string)*: Only valid if type is replace. +Specifies the name of the node that is replacing the node being shut down. +Shards from the shut down node are only allowed to be allocated to the target node, and no other data will be allocated to the target node. +During relocation of data certain allocation rules are ignored, such as disk watermarks or user attribute filtering rules. +** *`master_timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. +** *`timeout` (Optional, Enum("nanos" | "micros" | "ms" | "s" | "m" | "h" | "d"))*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. [discrete] === slm @@ -8827,17 +9054,6 @@ client.snapshot.getRepository({ ... }) ** *`local` (Optional, boolean)*: Return local information, do not retrieve the state from master node (default: false) ** *`master_timeout` (Optional, string | -1 | 0)*: Explicit operation timeout for connection to master node -[discrete] -==== repository_analyze -Analyzes a repository for correctness and performance - -{ref}/modules-snapshots.html[Endpoint documentation] -[source,ts] ----- -client.snapshot.repositoryAnalyze() ----- - - [discrete] ==== restore Restores a snapshot. @@ -9667,17 +9883,6 @@ client.watcher.executeWatch({ ... }) ** *`watch` (Optional, { actions, condition, input, metadata, status, throttle_period, throttle_period_in_millis, transform, trigger })*: When present, this watch is used instead of the one specified in the request. This watch is not persisted to the index and record_execution cannot be set. ** *`debug` (Optional, boolean)*: Defines whether the watch runs in debug mode. -[discrete] -==== get_settings -Retrieve settings for the watcher system index - -{ref}/watcher-api-get-settings.html[Endpoint documentation] -[source,ts] ----- -client.watcher.getSettings() ----- - - [discrete] ==== get_watch Retrieves a watch by its ID. @@ -9780,17 +9985,6 @@ client.watcher.stop() ---- -[discrete] -==== update_settings -Update settings for the watcher system index - -{ref}/watcher-api-update-settings.html[Endpoint documentation] -[source,ts] ----- -client.watcher.updateSettings() ----- - - [discrete] === xpack [discrete] diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index d1362109e..ae45a90e8 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class AsyncSearch { const method = 'DELETE' const path = `/_async_search/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'async_search.delete', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,13 @@ export default class AsyncSearch { const method = 'GET' const path = `/_async_search/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'async_search.get', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -118,7 +131,13 @@ export default class AsyncSearch { const method = 'GET' const path = `/_async_search/status/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'async_search.status', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -170,6 +189,12 @@ export default class AsyncSearch { method = 'POST' path = '/_async_search' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'async_search.submit', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/autoscaling.ts b/src/api/api/autoscaling.ts index c00816de7..9daec32c5 100644 --- a/src/api/api/autoscaling.ts +++ b/src/api/api/autoscaling.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Autoscaling { const method = 'DELETE' const path = `/_autoscaling/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'autoscaling.delete_autoscaling_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -93,7 +100,10 @@ export default class Autoscaling { const method = 'GET' const path = '/_autoscaling/capacity' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'autoscaling.get_autoscaling_capacity' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -119,7 +129,13 @@ export default class Autoscaling { const method = 'GET' const path = `/_autoscaling/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'autoscaling.get_autoscaling_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -150,6 +166,12 @@ export default class Autoscaling { const method = 'PUT' const path = `/_autoscaling/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'autoscaling.put_autoscaling_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/bulk.ts b/src/api/api/bulk.ts index 5fc0e39c2..0c48c0c77 100644 --- a/src/api/api/bulk.ts +++ b/src/api/api/bulk.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function BulkApi (this: That, params const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_create/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'create', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/dangling_indices.ts b/src/api/api/dangling_indices.ts index caa7ead83..09e0bbea8 100644 --- a/src/api/api/dangling_indices.ts +++ b/src/api/api/dangling_indices.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class DanglingIndices { const method = 'DELETE' const path = `/_dangling/${encodeURIComponent(params.index_uuid.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'dangling_indices.delete_dangling_index', + pathParts: { + index_uuid: params.index_uuid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,13 @@ export default class DanglingIndices { const method = 'POST' const path = `/_dangling/${encodeURIComponent(params.index_uuid.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'dangling_indices.import_dangling_index', + pathParts: { + index_uuid: params.index_uuid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -119,6 +132,9 @@ export default class DanglingIndices { const method = 'GET' const path = '/_dangling' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'dangling_indices.list_dangling_indices' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/delete.ts b/src/api/api/delete.ts index 106bc6ded..b000682cb 100644 --- a/src/api/api/delete.ts +++ b/src/api/api/delete.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,12 @@ export default async function DeleteApi (this: That, params: T.DeleteRequest | T const method = 'DELETE' const path = `/${encodeURIComponent(params.index.toString())}/_doc/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'delete', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_by_query.ts b/src/api/api/delete_by_query.ts index 02a6393e2..f1a699cc6 100644 --- a/src/api/api/delete_by_query.ts +++ b/src/api/api/delete_by_query.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function DeleteByQueryApi (this: That, params: T.DeleteByQu const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_delete_by_query` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'delete_by_query', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_by_query_rethrottle.ts b/src/api/api/delete_by_query_rethrottle.ts index f8c5a3e28..15a4e8a7b 100644 --- a/src/api/api/delete_by_query_rethrottle.ts +++ b/src/api/api/delete_by_query_rethrottle.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,11 @@ export default async function DeleteByQueryRethrottleApi (this: That, params: T. const method = 'POST' const path = `/_delete_by_query/${encodeURIComponent(params.task_id.toString())}/_rethrottle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'delete_by_query_rethrottle', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_script.ts b/src/api/api/delete_script.ts index 8d5571e5c..0b0a3628d 100644 --- a/src/api/api/delete_script.ts +++ b/src/api/api/delete_script.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,11 @@ export default async function DeleteScriptApi (this: That, params: T.DeleteScrip const method = 'DELETE' const path = `/_scripts/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'delete_script', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/enrich.ts b/src/api/api/enrich.ts index 0bf22c994..96466cde0 100644 --- a/src/api/api/enrich.ts +++ b/src/api/api/enrich.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Enrich { const method = 'DELETE' const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.delete_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,13 @@ export default class Enrich { const method = 'PUT' const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}/_execute` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.execute_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -126,7 +139,13 @@ export default class Enrich { method = 'GET' path = '/_enrich/policy' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.get_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -164,7 +183,13 @@ export default class Enrich { const method = 'PUT' const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.put_policy', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -191,6 +216,9 @@ export default class Enrich { const method = 'GET' const path = '/_enrich/_stats' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'enrich.stats' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/eql.ts b/src/api/api/eql.ts index d68de2bbe..51711f2af 100644 --- a/src/api/api/eql.ts +++ b/src/api/api/eql.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Eql { const method = 'DELETE' const path = `/_eql/search/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'eql.delete', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,13 @@ export default class Eql { const method = 'GET' const path = `/_eql/search/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'eql.get', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -118,7 +131,13 @@ export default class Eql { const method = 'GET' const path = `/_eql/search/status/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'eql.get_status', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -156,6 +175,12 @@ export default class Eql { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_eql/search` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'eql.search', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/esql.ts b/src/api/api/esql.ts index 44f9b02a6..72782e4d3 100644 --- a/src/api/api/esql.ts +++ b/src/api/api/esql.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -43,6 +44,67 @@ export default class Esql { this.transport = transport } + /** + * Executes an ESQL request asynchronously + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/esql-async-query-api.html | Elasticsearch API documentation} + */ + async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_query/async' + const meta: TransportRequestMetadata = { + name: 'esql.async_query' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Retrieves the results of a previously submitted async query request given its ID. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/esql-async-query-get-api.html | Elasticsearch API documentation} + */ + async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_query/async/${encodeURIComponent(params.id.toString())}` + const meta: TransportRequestMetadata = { + name: 'esql.async_query_get', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + /** * Executes an ESQL request * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/esql-rest.html | Elasticsearch API documentation} @@ -78,6 +140,9 @@ export default class Esql { const method = 'POST' const path = '/_query' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'esql.query' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/exists.ts b/src/api/api/exists.ts index 2d12dc4f2..7492e0733 100644 --- a/src/api/api/exists.ts +++ b/src/api/api/exists.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,12 @@ export default async function ExistsApi (this: That, params: T.ExistsRequest | T const method = 'HEAD' const path = `/${encodeURIComponent(params.index.toString())}/_doc/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'exists', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/exists_source.ts b/src/api/api/exists_source.ts index dbe69e099..d43c35fa9 100644 --- a/src/api/api/exists_source.ts +++ b/src/api/api/exists_source.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,12 @@ export default async function ExistsSourceApi (this: That, params: T.ExistsSourc const method = 'HEAD' const path = `/${encodeURIComponent(params.index.toString())}/_source/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'exists_source', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/explain.ts b/src/api/api/explain.ts index 348d44467..c04e2fdb4 100644 --- a/src/api/api/explain.ts +++ b/src/api/api/explain.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,12 @@ export default async function ExplainApi (this: That, param const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_explain/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'explain', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/features.ts b/src/api/api/features.ts index cf5c5fbb3..d92078104 100644 --- a/src/api/api/features.ts +++ b/src/api/api/features.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -67,7 +68,10 @@ export default class Features { const method = 'GET' const path = '/_features' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'features.get_features' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -94,6 +98,9 @@ export default class Features { const method = 'POST' const path = '/_features/_reset' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'features.reset_features' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/field_caps.ts b/src/api/api/field_caps.ts index 41c8d948e..80291b923 100644 --- a/src/api/api/field_caps.ts +++ b/src/api/api/field_caps.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -80,5 +81,11 @@ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequ method = body != null ? 'POST' : 'GET' path = '/_field_caps' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'field_caps', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/fleet.ts b/src/api/api/fleet.ts index d7f611437..31bebfdf0 100644 --- a/src/api/api/fleet.ts +++ b/src/api/api/fleet.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -65,7 +66,13 @@ export default class Fleet { const method = 'DELETE' const path = `/_fleet/secret/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.delete_secret', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -90,7 +97,13 @@ export default class Fleet { const method = 'GET' const path = `/_fleet/secret/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.get_secret', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -116,7 +129,13 @@ export default class Fleet { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_fleet/global_checkpoints` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.global_checkpoints', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -153,7 +172,13 @@ export default class Fleet { method = body != null ? 'POST' : 'GET' path = '/_fleet/_fleet_msearch' } - return await this.transport.request({ path, method, querystring, bulkBody: body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.msearch', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } /** @@ -178,7 +203,10 @@ export default class Fleet { const method = 'POST' const path = '/_fleet/secret' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.post_secret' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -215,6 +243,12 @@ export default class Fleet { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_fleet/_fleet_search` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'fleet.search', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/get.ts b/src/api/api/get.ts index 63ccffe77..53ebf824d 100644 --- a/src/api/api/get.ts +++ b/src/api/api/get.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,12 @@ export default async function GetApi (this: That, params: T const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_doc/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script.ts b/src/api/api/get_script.ts index 9a501b0f2..5f7efd2b0 100644 --- a/src/api/api/get_script.ts +++ b/src/api/api/get_script.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,11 @@ export default async function GetScriptApi (this: That, params: T.GetScriptReque const method = 'GET' const path = `/_scripts/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get_script', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script_context.ts b/src/api/api/get_script_context.ts index 51ba27dfc..273ed22cf 100644 --- a/src/api/api/get_script_context.ts +++ b/src/api/api/get_script_context.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -61,5 +62,8 @@ export default async function GetScriptContextApi (this: That, params?: T.GetScr const method = 'GET' const path = '/_script_context' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get_script_context' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script_languages.ts b/src/api/api/get_script_languages.ts index dbda591fa..fd35a9909 100644 --- a/src/api/api/get_script_languages.ts +++ b/src/api/api/get_script_languages.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -61,5 +62,8 @@ export default async function GetScriptLanguagesApi (this: That, params?: T.GetS const method = 'GET' const path = '/_script_language' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get_script_languages' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_source.ts b/src/api/api/get_source.ts index 798760626..1fde6935d 100644 --- a/src/api/api/get_source.ts +++ b/src/api/api/get_source.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,12 @@ export default async function GetSourceApi (this: That, par const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_source/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'get_source', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/graph.ts b/src/api/api/graph.ts index cc9e649a2..3c440bb03 100644 --- a/src/api/api/graph.ts +++ b/src/api/api/graph.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -78,6 +79,12 @@ export default class Graph { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_graph/explore` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'graph.explore', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/health_report.ts b/src/api/api/health_report.ts index f063f0ed3..5efb34d93 100644 --- a/src/api/api/health_report.ts +++ b/src/api/api/health_report.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -68,5 +69,11 @@ export default async function HealthReportApi (this: That, params?: T.HealthRepo method = 'GET' path = '/_health_report' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'health_report', + pathParts: { + feature: params.feature + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ilm.ts b/src/api/api/ilm.ts index e7886ce87..5179842cf 100644 --- a/src/api/api/ilm.ts +++ b/src/api/api/ilm.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Ilm { const method = 'DELETE' const path = `/_ilm/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.delete_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,13 @@ export default class Ilm { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_ilm/explain` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.explain_lifecycle', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -126,7 +139,13 @@ export default class Ilm { method = 'GET' path = '/_ilm/policy' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.get_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -153,7 +172,10 @@ export default class Ilm { const method = 'GET' const path = '/_ilm/status' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.get_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -192,7 +214,10 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/migrate_to_data_tiers' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.migrate_to_data_tiers' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -230,7 +255,13 @@ export default class Ilm { const method = 'POST' const path = `/_ilm/move/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.move_to_step', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -268,7 +299,13 @@ export default class Ilm { const method = 'PUT' const path = `/_ilm/policy/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.put_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -294,7 +331,13 @@ export default class Ilm { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_ilm/remove` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.remove_policy', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -320,7 +363,13 @@ export default class Ilm { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_ilm/retry` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.retry', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -347,7 +396,10 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/start' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.start' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -374,6 +426,9 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/stop' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ilm.stop' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/index.ts b/src/api/api/index.ts index 3d77ce76a..7e0b489d2 100644 --- a/src/api/api/index.ts +++ b/src/api/api/index.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,12 @@ export default async function IndexApi (this: That, params: method = 'POST' path = `/${encodeURIComponent(params.index.toString())}/_doc` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'index', + pathParts: { + id: params.id, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index 10f1b5cb7..41cd0c21e 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,14 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_block/${encodeURIComponent(params.block.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.add_block', + pathParts: { + index: params.index, + block: params.block + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -112,7 +120,13 @@ export default class Indices { method = body != null ? 'POST' : 'GET' path = '/_analyze' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.analyze', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -146,7 +160,13 @@ export default class Indices { method = 'POST' path = '/_cache/clear' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.clear_cache', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -184,7 +204,14 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_clone/${encodeURIComponent(params.target.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.clone', + pathParts: { + index: params.index, + target: params.target + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -210,7 +237,13 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_close` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.close', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -248,7 +281,13 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.create', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -274,7 +313,13 @@ export default class Indices { const method = 'PUT' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.create_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -308,7 +353,13 @@ export default class Indices { method = 'GET' path = '/_data_stream/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.data_streams_stats', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -334,7 +385,13 @@ export default class Indices { const method = 'DELETE' const path = `/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -367,7 +424,14 @@ export default class Indices { method = 'DELETE' path = `/${encodeURIComponent(params.index.toString())}/_aliases/${encodeURIComponent(params.name.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_alias', + pathParts: { + index: params.index, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -393,7 +457,13 @@ export default class Indices { const method = 'DELETE' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_data_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -419,7 +489,13 @@ export default class Indices { const method = 'DELETE' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -445,7 +521,13 @@ export default class Indices { const method = 'DELETE' const path = `/_index_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -471,7 +553,13 @@ export default class Indices { const method = 'DELETE' const path = `/_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.delete_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -497,7 +585,13 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_disk_usage` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.disk_usage', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -528,7 +622,14 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_downsample/${encodeURIComponent(params.target_index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.downsample', + pathParts: { + index: params.index, + target_index: params.target_index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -554,7 +655,13 @@ export default class Indices { const method = 'HEAD' const path = `/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.exists', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -587,7 +694,14 @@ export default class Indices { method = 'HEAD' path = `/_alias/${encodeURIComponent(params.name.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.exists_alias', + pathParts: { + name: params.name, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -613,7 +727,13 @@ export default class Indices { const method = 'HEAD' const path = `/_index_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.exists_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -639,7 +759,13 @@ export default class Indices { const method = 'HEAD' const path = `/_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.exists_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -665,7 +791,13 @@ export default class Indices { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_lifecycle/explain` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.explain_data_lifecycle', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -691,7 +823,13 @@ export default class Indices { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_field_usage_stats` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.field_usage_stats', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -725,7 +863,13 @@ export default class Indices { method = body != null ? 'POST' : 'GET' path = '/_flush' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.flush', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -759,7 +903,13 @@ export default class Indices { method = 'POST' path = '/_forcemerge' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.forcemerge', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -785,7 +935,13 @@ export default class Indices { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -825,7 +981,14 @@ export default class Indices { method = 'GET' path = '/_alias' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_alias', + pathParts: { + name: params.name, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -851,7 +1014,13 @@ export default class Indices { const method = 'GET' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_data_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -885,7 +1054,13 @@ export default class Indices { method = 'GET' path = '/_data_stream' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -918,7 +1093,14 @@ export default class Indices { method = 'GET' path = `/_mapping/field/${encodeURIComponent(params.fields.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_field_mapping', + pathParts: { + fields: params.fields, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -952,7 +1134,13 @@ export default class Indices { method = 'GET' path = '/_index_template' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -986,7 +1174,13 @@ export default class Indices { method = 'GET' path = '/_mapping' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_mapping', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1026,7 +1220,14 @@ export default class Indices { method = 'GET' path = '/_settings' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_settings', + pathParts: { + index: params.index, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1060,7 +1261,13 @@ export default class Indices { method = 'GET' path = '/_template' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.get_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1086,7 +1293,13 @@ export default class Indices { const method = 'POST' const path = `/_data_stream/_migrate/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.migrate_to_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1124,7 +1337,10 @@ export default class Indices { const method = 'POST' const path = '/_data_stream/_modify' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.modify_data_stream' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1150,7 +1366,13 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_open` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.open', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1176,7 +1398,13 @@ export default class Indices { const method = 'POST' const path = `/_data_stream/_promote/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.promote_data_stream', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1221,7 +1449,14 @@ export default class Indices { method = 'PUT' path = `/${encodeURIComponent(params.index.toString())}/_aliases/${encodeURIComponent(params.name.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_alias', + pathParts: { + index: params.index, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1259,7 +1494,13 @@ export default class Indices { const method = 'PUT' const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_data_lifecycle', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1297,7 +1538,13 @@ export default class Indices { const method = 'PUT' const path = `/_index_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1335,7 +1582,13 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_mapping` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_mapping', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1373,7 +1626,13 @@ export default class Indices { method = 'PUT' path = '/_settings' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_settings', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1411,7 +1670,13 @@ export default class Indices { const method = 'PUT' const path = `/_template/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.put_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1445,7 +1710,13 @@ export default class Indices { method = 'GET' path = '/_recovery' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.recovery', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1479,7 +1750,13 @@ export default class Indices { method = body != null ? 'POST' : 'GET' path = '/_refresh' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.refresh', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1505,7 +1782,13 @@ export default class Indices { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_reload_search_analyzers` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.reload_search_analyzers', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1531,7 +1814,13 @@ export default class Indices { const method = 'GET' const path = `/_resolve/cluster/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.resolve_cluster', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1557,7 +1846,13 @@ export default class Indices { const method = 'GET' const path = `/_resolve/index/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.resolve_index', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1602,7 +1897,14 @@ export default class Indices { method = 'POST' path = `/${encodeURIComponent(params.alias.toString())}/_rollover` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.rollover', + pathParts: { + alias: params.alias, + new_index: params.new_index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1636,7 +1938,13 @@ export default class Indices { method = 'GET' path = '/_segments' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.segments', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1670,7 +1978,13 @@ export default class Indices { method = 'GET' path = '/_shard_stores' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.shard_stores', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1708,7 +2022,14 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_shrink/${encodeURIComponent(params.target.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.shrink', + pathParts: { + index: params.index, + target: params.target + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1734,7 +2055,13 @@ export default class Indices { const method = 'POST' const path = `/_index_template/_simulate_index/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.simulate_index_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1780,7 +2107,13 @@ export default class Indices { method = 'POST' path = '/_index_template/_simulate' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.simulate_template', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1818,7 +2151,14 @@ export default class Indices { const method = 'PUT' const path = `/${encodeURIComponent(params.index.toString())}/_split/${encodeURIComponent(params.target.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.split', + pathParts: { + index: params.index, + target: params.target + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1858,7 +2198,14 @@ export default class Indices { method = 'GET' path = '/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.stats', + pathParts: { + metric: params.metric, + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1884,7 +2231,13 @@ export default class Indices { const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_unfreeze` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.unfreeze', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1923,7 +2276,10 @@ export default class Indices { const method = 'POST' const path = '/_aliases' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.update_aliases' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1969,6 +2325,12 @@ export default class Indices { method = body != null ? 'POST' : 'GET' path = '/_validate/query' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'indices.validate_query', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/inference.ts b/src/api/api/inference.ts index de9e46de8..973880e3a 100644 --- a/src/api/api/inference.ts +++ b/src/api/api/inference.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -73,7 +74,14 @@ export default class Inference { method = 'DELETE' path = `/_inference/${encodeURIComponent(params.inference_id.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'inference.delete_model', + pathParts: { + task_type: params.task_type, + inference_id: params.inference_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -102,11 +110,21 @@ export default class Inference { if (params.task_type != null && params.inference_id != null) { method = 'GET' path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}` - } else { + } else if (params.inference_id != null) { method = 'GET' path = `/_inference/${encodeURIComponent(params.inference_id.toString())}` + } else { + method = 'GET' + path = '/_inference' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'inference.get_model', + pathParts: { + task_type: params.task_type, + inference_id: params.inference_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -151,7 +169,14 @@ export default class Inference { method = 'POST' path = `/_inference/${encodeURIComponent(params.inference_id.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'inference.inference', + pathParts: { + task_type: params.task_type, + inference_id: params.inference_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -189,6 +214,13 @@ export default class Inference { method = 'PUT' path = `/_inference/${encodeURIComponent(params.inference_id.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'inference.put_model', + pathParts: { + task_type: params.task_type, + inference_id: params.inference_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/info.ts b/src/api/api/info.ts index 703937ad3..6471fa9a2 100644 --- a/src/api/api/info.ts +++ b/src/api/api/info.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -61,5 +62,8 @@ export default async function InfoApi (this: That, params?: T.InfoRequest | TB.I const method = 'GET' const path = '/' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'info' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ingest.ts b/src/api/api/ingest.ts index b74a27059..28449e7be 100644 --- a/src/api/api/ingest.ts +++ b/src/api/api/ingest.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Ingest { const method = 'DELETE' const path = `/_ingest/pipeline/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.delete_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -93,7 +100,10 @@ export default class Ingest { const method = 'GET' const path = '/_ingest/geoip/stats' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.geo_ip_stats' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -127,7 +137,13 @@ export default class Ingest { method = 'GET' path = '/_ingest/pipeline' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.get_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -154,7 +170,10 @@ export default class Ingest { const method = 'GET' const path = '/_ingest/processor/grok' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.processor_grok' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -192,7 +211,13 @@ export default class Ingest { const method = 'PUT' const path = `/_ingest/pipeline/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.put_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -238,6 +263,12 @@ export default class Ingest { method = body != null ? 'POST' : 'GET' path = '/_ingest/pipeline/_simulate' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ingest.simulate', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/knn_search.ts b/src/api/api/knn_search.ts index 442a88450..30fdce0c2 100644 --- a/src/api/api/knn_search.ts +++ b/src/api/api/knn_search.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function KnnSearchApi (this: That, par const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_knn_search` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'knn_search', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/license.ts b/src/api/api/license.ts index f160a3837..8b95eeb01 100644 --- a/src/api/api/license.ts +++ b/src/api/api/license.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -67,7 +68,10 @@ export default class License { const method = 'DELETE' const path = '/_license' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.delete' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -94,7 +98,10 @@ export default class License { const method = 'GET' const path = '/_license' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.get' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -121,7 +128,10 @@ export default class License { const method = 'GET' const path = '/_license/basic_status' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.get_basic_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -148,7 +158,10 @@ export default class License { const method = 'GET' const path = '/_license/trial_status' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.get_trial_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -187,7 +200,10 @@ export default class License { const method = 'PUT' const path = '/_license' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.post' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -214,7 +230,10 @@ export default class License { const method = 'POST' const path = '/_license/start_basic' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.post_start_basic' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -241,6 +260,9 @@ export default class License { const method = 'POST' const path = '/_license/start_trial' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'license.post_start_trial' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/logstash.ts b/src/api/api/logstash.ts index d7b35a72d..06cae4a58 100644 --- a/src/api/api/logstash.ts +++ b/src/api/api/logstash.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Logstash { const method = 'DELETE' const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'logstash.delete_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -100,7 +107,13 @@ export default class Logstash { method = 'GET' path = '/_logstash/pipeline' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'logstash.get_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -131,6 +144,12 @@ export default class Logstash { const method = 'PUT' const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'logstash.put_pipeline', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/mget.ts b/src/api/api/mget.ts index 0c6a9cb2c..5c4d2463b 100644 --- a/src/api/api/mget.ts +++ b/src/api/api/mget.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -80,5 +81,11 @@ export default async function MgetApi (this: That, params?: method = body != null ? 'POST' : 'GET' path = '/_mget' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'mget', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/migration.ts b/src/api/api/migration.ts index 700dbd442..9ceecae55 100644 --- a/src/api/api/migration.ts +++ b/src/api/api/migration.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -74,7 +75,13 @@ export default class Migration { method = 'GET' path = '/_migration/deprecations' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'migration.deprecations', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -101,7 +108,10 @@ export default class Migration { const method = 'GET' const path = '/_migration/system_features' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'migration.get_feature_upgrade_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -128,6 +138,9 @@ export default class Migration { const method = 'POST' const path = '/_migration/system_features' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'migration.post_feature_upgrade' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index a4a8757cf..c7e828078 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/cache/_clear` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.clear_trained_model_deployment_cache', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -104,7 +111,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_close` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.close_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -130,7 +143,13 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_calendar', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -156,7 +175,14 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/events/${encodeURIComponent(params.event_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_calendar_event', + pathParts: { + calendar_id: params.calendar_id, + event_id: params.event_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -182,7 +208,14 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/jobs/${encodeURIComponent(params.job_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_calendar_job', + pathParts: { + calendar_id: params.calendar_id, + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -208,7 +241,13 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -234,7 +273,13 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -280,7 +325,13 @@ export default class Ml { method = 'DELETE' path = '/_ml/_delete_expired_data' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_expired_data', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -306,7 +357,13 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/filters/${encodeURIComponent(params.filter_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_filter', + pathParts: { + filter_id: params.filter_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -339,7 +396,14 @@ export default class Ml { method = 'DELETE' path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_forecast` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_forecast', + pathParts: { + job_id: params.job_id, + forecast_id: params.forecast_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -365,7 +429,13 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -391,7 +461,14 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_model_snapshot', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -417,7 +494,13 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_trained_model', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -443,7 +526,14 @@ export default class Ml { const method = 'DELETE' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/model_aliases/${encodeURIComponent(params.model_alias.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.delete_trained_model_alias', + pathParts: { + model_alias: params.model_alias, + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -482,7 +572,10 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_estimate_model_memory' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.estimate_model_memory' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -520,7 +613,10 @@ export default class Ml { const method = 'POST' const path = '/_ml/data_frame/_evaluate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.evaluate_data_frame' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -566,7 +662,13 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = '/_ml/data_frame/analytics/_explain' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.explain_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -604,7 +706,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_flush` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.flush_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -642,7 +750,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_forecast` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.forecast', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -687,7 +801,14 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/buckets` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_buckets', + pathParts: { + job_id: params.job_id, + timestamp: params.timestamp + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -713,7 +834,13 @@ export default class Ml { const method = 'GET' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/events` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_calendar_events', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -759,7 +886,13 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = '/_ml/calendars' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_calendars', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -804,7 +937,14 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/categories` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_categories', + pathParts: { + job_id: params.job_id, + category_id: params.category_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -838,7 +978,13 @@ export default class Ml { method = 'GET' path = '/_ml/data_frame/analytics' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -872,7 +1018,13 @@ export default class Ml { method = 'GET' path = '/_ml/data_frame/analytics/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_data_frame_analytics_stats', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -906,7 +1058,13 @@ export default class Ml { method = 'GET' path = '/_ml/datafeeds/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_datafeed_stats', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -940,7 +1098,13 @@ export default class Ml { method = 'GET' path = '/_ml/datafeeds' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_datafeeds', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -974,7 +1138,13 @@ export default class Ml { method = 'GET' path = '/_ml/filters' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_filters', + pathParts: { + filter_id: params.filter_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1012,7 +1182,13 @@ export default class Ml { const method = body != null ? 'POST' : 'GET' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/influencers` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_influencers', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1046,7 +1222,13 @@ export default class Ml { method = 'GET' path = '/_ml/anomaly_detectors/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_job_stats', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1080,7 +1262,13 @@ export default class Ml { method = 'GET' path = '/_ml/anomaly_detectors' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_jobs', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1114,7 +1302,13 @@ export default class Ml { method = 'GET' path = '/_ml/memory/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_memory_stats', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1140,7 +1334,14 @@ export default class Ml { const method = 'GET' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_upgrade/_stats` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_model_snapshot_upgrade_stats', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1185,7 +1386,14 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_model_snapshots', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1223,7 +1431,13 @@ export default class Ml { const method = body != null ? 'POST' : 'GET' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/overall_buckets` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_overall_buckets', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1261,7 +1475,13 @@ export default class Ml { const method = body != null ? 'POST' : 'GET' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/records` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_records', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1295,7 +1515,13 @@ export default class Ml { method = 'GET' path = '/_ml/trained_models' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_trained_models', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1329,7 +1555,13 @@ export default class Ml { method = 'GET' path = '/_ml/trained_models/_stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.get_trained_models_stats', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1367,7 +1599,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/_infer` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.infer_trained_model', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1394,7 +1632,10 @@ export default class Ml { const method = 'GET' const path = '/_ml/info' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.info' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1432,7 +1673,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_open` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.open_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1470,7 +1717,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/events` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.post_calendar_events', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1501,7 +1754,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_data` - return await this.transport.request({ path, method, querystring, bulkBody: body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.post_data', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } /** @@ -1547,7 +1806,13 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = '/_ml/data_frame/analytics/_preview' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.preview_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1593,7 +1858,13 @@ export default class Ml { method = body != null ? 'POST' : 'GET' path = '/_ml/datafeeds/_preview' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.preview_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1631,7 +1902,13 @@ export default class Ml { const method = 'PUT' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_calendar', + pathParts: { + calendar_id: params.calendar_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1657,7 +1934,14 @@ export default class Ml { const method = 'PUT' const path = `/_ml/calendars/${encodeURIComponent(params.calendar_id.toString())}/jobs/${encodeURIComponent(params.job_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_calendar_job', + pathParts: { + calendar_id: params.calendar_id, + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1695,7 +1979,13 @@ export default class Ml { const method = 'PUT' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1733,7 +2023,13 @@ export default class Ml { const method = 'PUT' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1771,7 +2067,13 @@ export default class Ml { const method = 'PUT' const path = `/_ml/filters/${encodeURIComponent(params.filter_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_filter', + pathParts: { + filter_id: params.filter_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1809,7 +2111,13 @@ export default class Ml { const method = 'PUT' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1847,7 +2155,13 @@ export default class Ml { const method = 'PUT' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_trained_model', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1873,7 +2187,14 @@ export default class Ml { const method = 'PUT' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/model_aliases/${encodeURIComponent(params.model_alias.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_trained_model_alias', + pathParts: { + model_alias: params.model_alias, + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1911,7 +2232,14 @@ export default class Ml { const method = 'PUT' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/definition/${encodeURIComponent(params.part.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_trained_model_definition_part', + pathParts: { + model_id: params.model_id, + part: params.part + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1949,7 +2277,13 @@ export default class Ml { const method = 'PUT' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/vocabulary` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.put_trained_model_vocabulary', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1975,7 +2309,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_reset` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.reset_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2013,7 +2353,14 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_revert` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.revert_model_snapshot', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2040,7 +2387,10 @@ export default class Ml { const method = 'POST' const path = '/_ml/set_upgrade_mode' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.set_upgrade_mode' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2066,7 +2416,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.start_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2104,7 +2460,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.start_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2130,7 +2492,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.start_trained_model_deployment', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2156,7 +2524,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.stop_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2194,7 +2568,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.stop_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2220,7 +2600,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.stop_trained_model_deployment', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2258,7 +2644,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/data_frame/analytics/${encodeURIComponent(params.id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_data_frame_analytics', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2296,7 +2688,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/datafeeds/${encodeURIComponent(params.datafeed_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_datafeed', + pathParts: { + datafeed_id: params.datafeed_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2334,7 +2732,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/filters/${encodeURIComponent(params.filter_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_filter', + pathParts: { + filter_id: params.filter_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2372,7 +2776,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_job', + pathParts: { + job_id: params.job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2410,7 +2820,14 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_model_snapshot', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2448,7 +2865,13 @@ export default class Ml { const method = 'POST' const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.update_trained_model_deployment', + pathParts: { + model_id: params.model_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2474,7 +2897,14 @@ export default class Ml { const method = 'POST' const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_upgrade` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.upgrade_job_snapshot', + pathParts: { + job_id: params.job_id, + snapshot_id: params.snapshot_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2513,7 +2943,10 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_validate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.validate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -2544,6 +2977,9 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_validate/detector' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ml.validate_detector' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/monitoring.ts b/src/api/api/monitoring.ts index 7fc3ca71e..4badbdf54 100644 --- a/src/api/api/monitoring.ts +++ b/src/api/api/monitoring.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -71,6 +72,12 @@ export default class Monitoring { const method = 'POST' const path = '/_monitoring/bulk' - return await this.transport.request({ path, method, querystring, bulkBody: body }, options) + const meta: TransportRequestMetadata = { + name: 'monitoring.bulk', + pathParts: { + type: params.type + } + } + return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } } diff --git a/src/api/api/msearch.ts b/src/api/api/msearch.ts index b7086bc1c..2b1fd8f14 100644 --- a/src/api/api/msearch.ts +++ b/src/api/api/msearch.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function MsearchApi + async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_profiling/flamegraph' + const meta: TransportRequestMetadata = { + name: 'profiling.flamegraph' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Extracts raw stacktrace information from Universal Profiling. + * @see {@link https://www.elastic.co/guide/en/observability/8.14/universal-profiling.html | Elasticsearch API documentation} + */ + async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_profiling/stacktraces' + const meta: TransportRequestMetadata = { + name: 'profiling.stacktraces' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Returns basic information about the status of Universal Profiling. + * @see {@link https://www.elastic.co/guide/en/observability/8.14/universal-profiling.html | Elasticsearch API documentation} + */ + async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_profiling/status' + const meta: TransportRequestMetadata = { + name: 'profiling.status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Extracts a list of topN functions from Universal Profiling. + * @see {@link https://www.elastic.co/guide/en/observability/8.14/universal-profiling.html | Elasticsearch API documentation} + */ + async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_profiling/topn/functions' + const meta: TransportRequestMetadata = { + name: 'profiling.topn_functions' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } +} diff --git a/src/api/api/put_script.ts b/src/api/api/put_script.ts index 634a9475f..7fbef1057 100644 --- a/src/api/api/put_script.ts +++ b/src/api/api/put_script.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -79,5 +80,12 @@ export default async function PutScriptApi (this: That, params: T.PutScriptReque method = 'PUT' path = `/_scripts/${encodeURIComponent(params.id.toString())}` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'put_script', + pathParts: { + id: params.id, + context: params.context + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/query_ruleset.ts b/src/api/api/query_ruleset.ts index a0c112813..d7061e944 100644 --- a/src/api/api/query_ruleset.ts +++ b/src/api/api/query_ruleset.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class QueryRuleset { const method = 'DELETE' const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'query_ruleset.delete', + pathParts: { + ruleset_id: params.ruleset_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,13 @@ export default class QueryRuleset { const method = 'GET' const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'query_ruleset.get', + pathParts: { + ruleset_id: params.ruleset_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -119,7 +132,10 @@ export default class QueryRuleset { const method = 'GET' const path = '/_query_rules' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'query_ruleset.list' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -157,6 +173,12 @@ export default class QueryRuleset { const method = 'PUT' const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'query_ruleset.put', + pathParts: { + ruleset_id: params.ruleset_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/rank_eval.ts b/src/api/api/rank_eval.ts index ffd845a16..e3fca26a4 100644 --- a/src/api/api/rank_eval.ts +++ b/src/api/api/rank_eval.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -79,5 +80,11 @@ export default async function RankEvalApi (this: That, params: T.RankEvalRequest method = body != null ? 'POST' : 'GET' path = '/_rank_eval' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rank_eval', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/reindex.ts b/src/api/api/reindex.ts index 41d42366a..5eab9009f 100644 --- a/src/api/api/reindex.ts +++ b/src/api/api/reindex.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,8 @@ export default async function ReindexApi (this: That, params: T.ReindexRequest | const method = 'POST' const path = '/_reindex' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'reindex' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/reindex_rethrottle.ts b/src/api/api/reindex_rethrottle.ts index a44baeb62..6d593511f 100644 --- a/src/api/api/reindex_rethrottle.ts +++ b/src/api/api/reindex_rethrottle.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,11 @@ export default async function ReindexRethrottleApi (this: That, params: T.Reinde const method = 'POST' const path = `/_reindex/${encodeURIComponent(params.task_id.toString())}/_rethrottle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'reindex_rethrottle', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/render_search_template.ts b/src/api/api/render_search_template.ts index 81b2b05a5..01224f4c4 100644 --- a/src/api/api/render_search_template.ts +++ b/src/api/api/render_search_template.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -80,5 +81,11 @@ export default async function RenderSearchTemplateApi (this: That, params?: T.Re method = body != null ? 'POST' : 'GET' path = '/_render/template' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'render_search_template', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/rollup.ts b/src/api/api/rollup.ts index 0765f9b97..105164900 100644 --- a/src/api/api/rollup.ts +++ b/src/api/api/rollup.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Rollup { const method = 'DELETE' const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.delete_job', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -100,7 +107,13 @@ export default class Rollup { method = 'GET' path = '/_rollup/job' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.get_jobs', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -134,7 +147,13 @@ export default class Rollup { method = 'GET' path = '/_rollup/data' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.get_rollup_caps', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -160,7 +179,13 @@ export default class Rollup { const method = 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_rollup/data` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.get_rollup_index_caps', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -198,7 +223,13 @@ export default class Rollup { const method = 'PUT' const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.put_job', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -236,7 +267,13 @@ export default class Rollup { const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_rollup_search` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.rollup_search', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -262,7 +299,13 @@ export default class Rollup { const method = 'POST' const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.start_job', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -288,6 +331,12 @@ export default class Rollup { const method = 'POST' const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'rollup.stop_job', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/scripts_painless_execute.ts b/src/api/api/scripts_painless_execute.ts index e62cfc5d9..730744cb7 100644 --- a/src/api/api/scripts_painless_execute.ts +++ b/src/api/api/scripts_painless_execute.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -73,5 +74,8 @@ export default async function ScriptsPainlessExecuteApi (this const method = body != null ? 'POST' : 'GET' const path = '/_scripts/painless/_execute' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'scripts_painless_execute' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/scroll.ts b/src/api/api/scroll.ts index 11f7817f1..11577c719 100644 --- a/src/api/api/scroll.ts +++ b/src/api/api/scroll.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function ScrollApi (this: That method = body != null ? 'POST' : 'GET' path = '/_search/template' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'search_template', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/searchable_snapshots.ts b/src/api/api/searchable_snapshots.ts index ed3552e98..e70c95648 100644 --- a/src/api/api/searchable_snapshots.ts +++ b/src/api/api/searchable_snapshots.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -74,7 +75,13 @@ export default class SearchableSnapshots { method = 'GET' path = '/_searchable_snapshots/cache/stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'searchable_snapshots.cache_stats', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -108,7 +115,13 @@ export default class SearchableSnapshots { method = 'POST' path = '/_searchable_snapshots/cache/clear' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'searchable_snapshots.clear_cache', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -146,7 +159,14 @@ export default class SearchableSnapshots { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}/_mount` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'searchable_snapshots.mount', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -180,6 +200,12 @@ export default class SearchableSnapshots { method = 'GET' path = '/_searchable_snapshots/stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'searchable_snapshots.stats', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/security.ts b/src/api/api/security.ts index 8454348c0..49b33ef2c 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -78,7 +79,10 @@ export default class Security { const method = 'POST' const path = '/_security/profile/_activate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.activate_user_profile' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -105,7 +109,10 @@ export default class Security { const method = 'GET' const path = '/_security/_authenticate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.authenticate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -131,7 +138,10 @@ export default class Security { const method = 'POST' const path = '/_security/api_key/_bulk_update' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.bulk_update_api_keys' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -177,7 +187,13 @@ export default class Security { method = 'PUT' path = '/_security/user/_password' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.change_password', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -203,7 +219,13 @@ export default class Security { const method = 'POST' const path = `/_security/api_key/${encodeURIComponent(params.ids.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_api_key_cache', + pathParts: { + ids: params.ids + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -229,7 +251,13 @@ export default class Security { const method = 'POST' const path = `/_security/privilege/${encodeURIComponent(params.application.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_cached_privileges', + pathParts: { + application: params.application + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -255,7 +283,13 @@ export default class Security { const method = 'POST' const path = `/_security/realm/${encodeURIComponent(params.realms.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_cached_realms', + pathParts: { + realms: params.realms + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -281,7 +315,13 @@ export default class Security { const method = 'POST' const path = `/_security/role/${encodeURIComponent(params.name.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_cached_roles', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -307,7 +347,15 @@ export default class Security { const method = 'POST' const path = `/_security/service/${encodeURIComponent(params.namespace.toString())}/${encodeURIComponent(params.service.toString())}/credential/token/${encodeURIComponent(params.name.toString())}/_clear_cache` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.clear_cached_service_tokens', + pathParts: { + namespace: params.namespace, + service: params.service, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -346,7 +394,10 @@ export default class Security { const method = 'PUT' const path = '/_security/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.create_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -372,7 +423,10 @@ export default class Security { const method = 'POST' const path = '/_security/cross_cluster/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.create_cross_cluster_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -405,7 +459,15 @@ export default class Security { method = 'POST' path = `/_security/service/${encodeURIComponent(params.namespace.toString())}/${encodeURIComponent(params.service.toString())}/credential/token` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.create_service_token', + pathParts: { + namespace: params.namespace, + service: params.service, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -431,7 +493,14 @@ export default class Security { const method = 'DELETE' const path = `/_security/privilege/${encodeURIComponent(params.application.toString())}/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_privileges', + pathParts: { + application: params.application, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -457,7 +526,13 @@ export default class Security { const method = 'DELETE' const path = `/_security/role/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_role', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -483,7 +558,13 @@ export default class Security { const method = 'DELETE' const path = `/_security/role_mapping/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_role_mapping', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -509,7 +590,15 @@ export default class Security { const method = 'DELETE' const path = `/_security/service/${encodeURIComponent(params.namespace.toString())}/${encodeURIComponent(params.service.toString())}/credential/token/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_service_token', + pathParts: { + namespace: params.namespace, + service: params.service, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -535,7 +624,13 @@ export default class Security { const method = 'DELETE' const path = `/_security/user/${encodeURIComponent(params.username.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.delete_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -561,7 +656,13 @@ export default class Security { const method = 'PUT' const path = `/_security/user/${encodeURIComponent(params.username.toString())}/_disable` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.disable_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -587,7 +688,13 @@ export default class Security { const method = 'PUT' const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_disable` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.disable_user_profile', + pathParts: { + uid: params.uid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -613,7 +720,13 @@ export default class Security { const method = 'PUT' const path = `/_security/user/${encodeURIComponent(params.username.toString())}/_enable` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.enable_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -639,7 +752,13 @@ export default class Security { const method = 'PUT' const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_enable` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.enable_user_profile', + pathParts: { + uid: params.uid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -666,7 +785,10 @@ export default class Security { const method = 'GET' const path = '/_security/enroll/kibana' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.enroll_kibana' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -693,7 +815,10 @@ export default class Security { const method = 'GET' const path = '/_security/enroll/node' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.enroll_node' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -720,7 +845,10 @@ export default class Security { const method = 'GET' const path = '/_security/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -747,7 +875,10 @@ export default class Security { const method = 'GET' const path = '/_security/privilege/_builtin' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_builtin_privileges' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -784,7 +915,14 @@ export default class Security { method = 'GET' path = '/_security/privilege' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_privileges', + pathParts: { + application: params.application, + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -818,7 +956,13 @@ export default class Security { method = 'GET' path = '/_security/role' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_role', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -852,7 +996,13 @@ export default class Security { method = 'GET' path = '/_security/role_mapping' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_role_mapping', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -889,7 +1039,14 @@ export default class Security { method = 'GET' path = '/_security/service' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_service_accounts', + pathParts: { + namespace: params.namespace, + service: params.service + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -915,7 +1072,14 @@ export default class Security { const method = 'GET' const path = `/_security/service/${encodeURIComponent(params.namespace.toString())}/${encodeURIComponent(params.service.toString())}/credential` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_service_credentials', + pathParts: { + namespace: params.namespace, + service: params.service + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -941,7 +1105,10 @@ export default class Security { const method = 'GET' const path = '/_security/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -980,7 +1147,10 @@ export default class Security { const method = 'POST' const path = '/_security/oauth2/token' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_token' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1014,7 +1184,13 @@ export default class Security { method = 'GET' path = '/_security/user' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1041,7 +1217,10 @@ export default class Security { const method = 'GET' const path = '/_security/user/_privileges' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_user_privileges' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1067,7 +1246,13 @@ export default class Security { const method = 'GET' const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.get_user_profile', + pathParts: { + uid: params.uid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1105,7 +1290,10 @@ export default class Security { const method = 'POST' const path = '/_security/api_key/grant' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.grant_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1151,7 +1339,13 @@ export default class Security { method = body != null ? 'POST' : 'GET' path = '/_security/user/_has_privileges' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.has_privileges', + pathParts: { + user: params.user + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1189,7 +1383,10 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/profile/_has_privileges' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.has_privileges_user_profile' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1228,7 +1425,10 @@ export default class Security { const method = 'DELETE' const path = '/_security/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.invalidate_api_key' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1267,7 +1467,10 @@ export default class Security { const method = 'DELETE' const path = '/_security/oauth2/token' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.invalidate_token' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1293,7 +1496,10 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/authenticate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.oidc_authenticate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1319,7 +1525,10 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/logout' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.oidc_logout' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1345,7 +1554,10 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/prepare' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.oidc_prepare_authentication' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1376,7 +1588,10 @@ export default class Security { const method = 'PUT' const path = '/_security/privilege' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.put_privileges' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1414,7 +1629,13 @@ export default class Security { const method = 'PUT' const path = `/_security/role/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.put_role', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1452,7 +1673,13 @@ export default class Security { const method = 'PUT' const path = `/_security/role_mapping/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.put_role_mapping', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1490,7 +1717,13 @@ export default class Security { const method = 'PUT' const path = `/_security/user/${encodeURIComponent(params.username.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.put_user', + pathParts: { + username: params.username + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1529,7 +1762,39 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/_query/api_key' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.query_api_keys' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Retrieves information for Users using a subset of query DSL + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/security-api-query-user.html | Elasticsearch API documentation} + */ + async queryUser (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async queryUser (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async queryUser (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async queryUser (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = body != null ? 'POST' : 'GET' + const path = '/_security/_query/user' + const meta: TransportRequestMetadata = { + name: 'security.query_user' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1567,7 +1832,10 @@ export default class Security { const method = 'POST' const path = '/_security/saml/authenticate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_authenticate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1605,7 +1873,10 @@ export default class Security { const method = 'POST' const path = '/_security/saml/complete_logout' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_complete_logout' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1643,7 +1914,10 @@ export default class Security { const method = 'POST' const path = '/_security/saml/invalidate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_invalidate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1681,7 +1955,10 @@ export default class Security { const method = 'POST' const path = '/_security/saml/logout' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_logout' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1720,7 +1997,10 @@ export default class Security { const method = 'POST' const path = '/_security/saml/prepare' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_prepare_authentication' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1746,7 +2026,13 @@ export default class Security { const method = 'GET' const path = `/_security/saml/metadata/${encodeURIComponent(params.realm_name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.saml_service_provider_metadata', + pathParts: { + realm_name: params.realm_name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1785,7 +2071,10 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/profile/_suggest' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.suggest_user_profiles' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1823,7 +2112,13 @@ export default class Security { const method = 'PUT' const path = `/_security/api_key/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.update_api_key', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1849,7 +2144,13 @@ export default class Security { const method = 'PUT' const path = `/_security/cross_cluster/api_key/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.update_cross_cluster_api_key', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1875,7 +2176,10 @@ export default class Security { const method = 'PUT' const path = '/_security/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.update_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -1913,6 +2217,12 @@ export default class Security { const method = 'PUT' const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_data` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'security.update_user_profile_data', + pathParts: { + uid: params.uid + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/shutdown.ts b/src/api/api/shutdown.ts index 3fc62d09a..cf83485f3 100644 --- a/src/api/api/shutdown.ts +++ b/src/api/api/shutdown.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Shutdown { const method = 'DELETE' const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/shutdown` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'shutdown.delete_node', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -100,7 +107,13 @@ export default class Shutdown { method = 'GET' path = '/_nodes/shutdown' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'shutdown.get_node', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -138,6 +151,12 @@ export default class Shutdown { const method = 'PUT' const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/shutdown` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'shutdown.put_node', + pathParts: { + node_id: params.node_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/simulate.ts b/src/api/api/simulate.ts new file mode 100644 index 000000000..da91ac734 --- /dev/null +++ b/src/api/api/simulate.ts @@ -0,0 +1,85 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestMetadata, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class Simulate { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Simulates running ingest with example documents. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/simulate-ingest-api.html | Elasticsearch API documentation} + */ + async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['index'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + let method = '' + let path = '' + if (params.index != null) { + method = body != null ? 'POST' : 'GET' + path = `/_ingest/${encodeURIComponent(params.index.toString())}/_simulate` + } else { + method = body != null ? 'POST' : 'GET' + path = '/_ingest/_simulate' + } + const meta: TransportRequestMetadata = { + name: 'simulate.ingest', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } +} diff --git a/src/api/api/slm.ts b/src/api/api/slm.ts index fab0bfa37..231439b14 100644 --- a/src/api/api/slm.ts +++ b/src/api/api/slm.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Slm { const method = 'DELETE' const path = `/_slm/policy/${encodeURIComponent(params.policy_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.delete_lifecycle', + pathParts: { + policy_id: params.policy_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,13 @@ export default class Slm { const method = 'PUT' const path = `/_slm/policy/${encodeURIComponent(params.policy_id.toString())}/_execute` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.execute_lifecycle', + pathParts: { + policy_id: params.policy_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -119,7 +132,10 @@ export default class Slm { const method = 'POST' const path = '/_slm/_execute_retention' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.execute_retention' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -153,7 +169,13 @@ export default class Slm { method = 'GET' path = '/_slm/policy' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.get_lifecycle', + pathParts: { + policy_id: params.policy_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -180,7 +202,10 @@ export default class Slm { const method = 'GET' const path = '/_slm/stats' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.get_stats' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -207,7 +232,10 @@ export default class Slm { const method = 'GET' const path = '/_slm/status' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.get_status' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -245,7 +273,13 @@ export default class Slm { const method = 'PUT' const path = `/_slm/policy/${encodeURIComponent(params.policy_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.put_lifecycle', + pathParts: { + policy_id: params.policy_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -272,7 +306,10 @@ export default class Slm { const method = 'POST' const path = '/_slm/start' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.start' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -299,6 +336,9 @@ export default class Slm { const method = 'POST' const path = '/_slm/stop' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'slm.stop' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/snapshot.ts b/src/api/api/snapshot.ts index a408e335e..fec2638f9 100644 --- a/src/api/api/snapshot.ts +++ b/src/api/api/snapshot.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Snapshot { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.name.toString())}/_cleanup` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.cleanup_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -104,7 +111,15 @@ export default class Snapshot { const method = 'PUT' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}/_clone/${encodeURIComponent(params.target_snapshot.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.clone', + pathParts: { + repository: params.repository, + snapshot: params.snapshot, + target_snapshot: params.target_snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -142,7 +157,14 @@ export default class Snapshot { const method = 'PUT' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.create', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -173,7 +195,13 @@ export default class Snapshot { const method = 'PUT' const path = `/_snapshot/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.create_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -199,7 +227,14 @@ export default class Snapshot { const method = 'DELETE' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.delete', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -225,7 +260,13 @@ export default class Snapshot { const method = 'DELETE' const path = `/_snapshot/${encodeURIComponent(params.name.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.delete_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -251,7 +292,14 @@ export default class Snapshot { const method = 'GET' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.get', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -285,7 +333,13 @@ export default class Snapshot { method = 'GET' path = '/_snapshot' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.get_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -311,7 +365,13 @@ export default class Snapshot { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/_analyze` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.repository_analyze', + pathParts: { + repository: params.repository + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -349,7 +409,14 @@ export default class Snapshot { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.repository.toString())}/${encodeURIComponent(params.snapshot.toString())}/_restore` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.restore', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -386,7 +453,14 @@ export default class Snapshot { method = 'GET' path = '/_snapshot/_status' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.status', + pathParts: { + repository: params.repository, + snapshot: params.snapshot + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -412,6 +486,12 @@ export default class Snapshot { const method = 'POST' const path = `/_snapshot/${encodeURIComponent(params.name.toString())}/_verify` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'snapshot.verify_repository', + pathParts: { + name: params.name + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/sql.ts b/src/api/api/sql.ts index c7e4785e9..492f71535 100644 --- a/src/api/api/sql.ts +++ b/src/api/api/sql.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -78,7 +79,10 @@ export default class Sql { const method = 'POST' const path = '/_sql/close' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.clear_cursor' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -104,7 +108,13 @@ export default class Sql { const method = 'DELETE' const path = `/_sql/async/delete/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.delete_async', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -130,7 +140,13 @@ export default class Sql { const method = 'GET' const path = `/_sql/async/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.get_async', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -156,7 +172,13 @@ export default class Sql { const method = 'GET' const path = `/_sql/async/status/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.get_async_status', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -195,7 +217,10 @@ export default class Sql { const method = body != null ? 'POST' : 'GET' const path = '/_sql' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.query' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -233,6 +258,9 @@ export default class Sql { const method = body != null ? 'POST' : 'GET' const path = '/_sql/translate' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'sql.translate' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/ssl.ts b/src/api/api/ssl.ts index e3ff824ec..89c1bd6c6 100644 --- a/src/api/api/ssl.ts +++ b/src/api/api/ssl.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -67,6 +68,9 @@ export default class Ssl { const method = 'GET' const path = '/_ssl/certificates' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'ssl.certificates' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/synonyms.ts b/src/api/api/synonyms.ts index 6ef6d291b..21e2827db 100644 --- a/src/api/api/synonyms.ts +++ b/src/api/api/synonyms.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Synonyms { const method = 'DELETE' const path = `/_synonyms/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.delete_synonym', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -92,7 +99,14 @@ export default class Synonyms { const method = 'DELETE' const path = `/_synonyms/${encodeURIComponent(params.set_id.toString())}/${encodeURIComponent(params.rule_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.delete_synonym_rule', + pathParts: { + set_id: params.set_id, + rule_id: params.rule_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -118,7 +132,13 @@ export default class Synonyms { const method = 'GET' const path = `/_synonyms/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.get_synonym', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -144,7 +164,14 @@ export default class Synonyms { const method = 'GET' const path = `/_synonyms/${encodeURIComponent(params.set_id.toString())}/${encodeURIComponent(params.rule_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.get_synonym_rule', + pathParts: { + set_id: params.set_id, + rule_id: params.rule_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -171,7 +198,10 @@ export default class Synonyms { const method = 'GET' const path = '/_synonyms' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.get_synonyms_sets' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -209,7 +239,13 @@ export default class Synonyms { const method = 'PUT' const path = `/_synonyms/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.put_synonym', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -247,6 +283,13 @@ export default class Synonyms { const method = 'PUT' const path = `/_synonyms/${encodeURIComponent(params.set_id.toString())}/${encodeURIComponent(params.rule_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'synonyms.put_synonym_rule', + pathParts: { + set_id: params.set_id, + rule_id: params.rule_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/tasks.ts b/src/api/api/tasks.ts index 1963da961..7bdb30de1 100644 --- a/src/api/api/tasks.ts +++ b/src/api/api/tasks.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -74,7 +75,13 @@ export default class Tasks { method = 'POST' path = '/_tasks/_cancel' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'tasks.cancel', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -100,7 +107,13 @@ export default class Tasks { const method = 'GET' const path = `/_tasks/${encodeURIComponent(params.task_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'tasks.get', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -127,6 +140,9 @@ export default class Tasks { const method = 'GET' const path = '/_tasks' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'tasks.list' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/terms_enum.ts b/src/api/api/terms_enum.ts index 5a9775a3c..0b7c03742 100644 --- a/src/api/api/terms_enum.ts +++ b/src/api/api/terms_enum.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,11 @@ export default async function TermsEnumApi (this: That, params: T.TermsEnumReque const method = body != null ? 'POST' : 'GET' const path = `/${encodeURIComponent(params.index.toString())}/_terms_enum` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'terms_enum', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/termvectors.ts b/src/api/api/termvectors.ts index 37504ac1d..3db6c369f 100644 --- a/src/api/api/termvectors.ts +++ b/src/api/api/termvectors.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -79,5 +80,12 @@ export default async function TermvectorsApi (this: That, p method = body != null ? 'POST' : 'GET' path = `/${encodeURIComponent(params.index.toString())}/_termvectors` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'termvectors', + pathParts: { + index: params.index, + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/text_structure.ts b/src/api/api/text_structure.ts index 408ff53eb..e537012ba 100644 --- a/src/api/api/text_structure.ts +++ b/src/api/api/text_structure.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -43,6 +44,64 @@ export default class TextStructure { this.transport = transport } + /** + * Finds the structure of a text field in an index. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/find-field-structure.html | Elasticsearch API documentation} + */ + async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_text_structure/find_field_structure' + const meta: TransportRequestMetadata = { + name: 'text_structure.find_field_structure' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/find-message-structure.html | Elasticsearch API documentation} + */ + async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = body != null ? 'POST' : 'GET' + const path = '/_text_structure/find_message_structure' + const meta: TransportRequestMetadata = { + name: 'text_structure.find_message_structure' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + /** * Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/find-structure.html | Elasticsearch API documentation} @@ -71,7 +130,10 @@ export default class TextStructure { const method = 'POST' const path = '/_text_structure/find_structure' - return await this.transport.request({ path, method, querystring, bulkBody: body }, options) + const meta: TransportRequestMetadata = { + name: 'text_structure.find_structure' + } + return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } /** @@ -109,6 +171,9 @@ export default class TextStructure { const method = body != null ? 'POST' : 'GET' const path = '/_text_structure/test_grok_pattern' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'text_structure.test_grok_pattern' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/transform.ts b/src/api/api/transform.ts index d65179804..f77efbb48 100644 --- a/src/api/api/transform.ts +++ b/src/api/api/transform.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -66,7 +67,13 @@ export default class Transform { const method = 'DELETE' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.delete_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -100,7 +107,13 @@ export default class Transform { method = 'GET' path = '/_transform' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.get_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -126,7 +139,13 @@ export default class Transform { const method = 'GET' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_stats` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.get_transform_stats', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -172,7 +191,13 @@ export default class Transform { method = body != null ? 'POST' : 'GET' path = '/_transform/_preview' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.preview_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -210,7 +235,13 @@ export default class Transform { const method = 'PUT' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.put_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -236,7 +267,13 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_reset` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.reset_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -262,7 +299,13 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_schedule_now` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.schedule_now_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -288,7 +331,13 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_start` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.start_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -314,7 +363,13 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_stop` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.stop_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -352,7 +407,13 @@ export default class Transform { const method = 'POST' const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_update` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.update_transform', + pathParts: { + transform_id: params.transform_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -379,6 +440,9 @@ export default class Transform { const method = 'POST' const path = '/_transform/_upgrade' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'transform.upgrade_transforms' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/update.ts b/src/api/api/update.ts index a72accf2c..c3d9083ce 100644 --- a/src/api/api/update.ts +++ b/src/api/api/update.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -72,5 +73,12 @@ export default async function UpdateApi @@ -72,5 +73,11 @@ export default async function UpdateByQueryApi (this: That, params: T.UpdateByQu const method = 'POST' const path = `/${encodeURIComponent(params.index.toString())}/_update_by_query` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'update_by_query', + pathParts: { + index: params.index + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/update_by_query_rethrottle.ts b/src/api/api/update_by_query_rethrottle.ts index 78c71cc32..9429d11b5 100644 --- a/src/api/api/update_by_query_rethrottle.ts +++ b/src/api/api/update_by_query_rethrottle.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -60,5 +61,11 @@ export default async function UpdateByQueryRethrottleApi (this: That, params: T. const method = 'POST' const path = `/_update_by_query/${encodeURIComponent(params.task_id.toString())}/_rethrottle` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'update_by_query_rethrottle', + pathParts: { + task_id: params.task_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/watcher.ts b/src/api/api/watcher.ts index a0e44a72a..e1c8d99f4 100644 --- a/src/api/api/watcher.ts +++ b/src/api/api/watcher.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -73,7 +74,14 @@ export default class Watcher { method = 'PUT' path = `/_watcher/watch/${encodeURIComponent(params.watch_id.toString())}/_ack` } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.ack_watch', + pathParts: { + watch_id: params.watch_id, + action_id: params.action_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -99,7 +107,13 @@ export default class Watcher { const method = 'PUT' const path = `/_watcher/watch/${encodeURIComponent(params.watch_id.toString())}/_activate` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.activate_watch', + pathParts: { + watch_id: params.watch_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -125,7 +139,13 @@ export default class Watcher { const method = 'PUT' const path = `/_watcher/watch/${encodeURIComponent(params.watch_id.toString())}/_deactivate` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.deactivate_watch', + pathParts: { + watch_id: params.watch_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -151,7 +171,13 @@ export default class Watcher { const method = 'DELETE' const path = `/_watcher/watch/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.delete_watch', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -197,7 +223,13 @@ export default class Watcher { method = 'PUT' path = '/_watcher/watch/_execute' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.execute_watch', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -223,7 +255,10 @@ export default class Watcher { const method = 'GET' const path = '/_watcher/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.get_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -249,7 +284,13 @@ export default class Watcher { const method = 'GET' const path = `/_watcher/watch/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.get_watch', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -287,7 +328,13 @@ export default class Watcher { const method = 'PUT' const path = `/_watcher/watch/${encodeURIComponent(params.id.toString())}` - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.put_watch', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -326,7 +373,10 @@ export default class Watcher { const method = body != null ? 'POST' : 'GET' const path = '/_watcher/_query/watches' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.query_watches' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -353,7 +403,10 @@ export default class Watcher { const method = 'POST' const path = '/_watcher/_start' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.start' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -387,7 +440,13 @@ export default class Watcher { method = 'GET' path = '/_watcher/stats' } - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.stats', + pathParts: { + metric: params.metric + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -414,7 +473,10 @@ export default class Watcher { const method = 'POST' const path = '/_watcher/_stop' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.stop' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -440,6 +502,9 @@ export default class Watcher { const method = 'PUT' const path = '/_watcher/settings' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'watcher.update_settings' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/api/xpack.ts b/src/api/api/xpack.ts index 53075f5ee..e99b83766 100644 --- a/src/api/api/xpack.ts +++ b/src/api/api/xpack.ts @@ -28,6 +28,7 @@ import { Transport, + TransportRequestMetadata, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, @@ -67,7 +68,10 @@ export default class Xpack { const method = 'GET' const path = '/_xpack' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'xpack.info' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } /** @@ -94,6 +98,9 @@ export default class Xpack { const method = 'GET' const path = '/_xpack/usage' - return await this.transport.request({ path, method, querystring, body }, options) + const meta: TransportRequestMetadata = { + name: 'xpack.usage' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) } } diff --git a/src/api/index.ts b/src/api/index.ts index 286a59bb7..684575aa9 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -76,6 +76,7 @@ import mtermvectorsApi from './api/mtermvectors' import NodesApi from './api/nodes' import openPointInTimeApi from './api/open_point_in_time' import pingApi from './api/ping' +import ProfilingApi from './api/profiling' import putScriptApi from './api/put_script' import QueryRulesetApi from './api/query_ruleset' import rankEvalApi from './api/rank_eval' @@ -93,6 +94,7 @@ import searchTemplateApi from './api/search_template' import SearchableSnapshotsApi from './api/searchable_snapshots' import SecurityApi from './api/security' import ShutdownApi from './api/shutdown' +import SimulateApi from './api/simulate' import SlmApi from './api/slm' import SnapshotApi from './api/snapshot' import SqlApi from './api/sql' @@ -161,6 +163,7 @@ export default interface API { nodes: NodesApi openPointInTime: typeof openPointInTimeApi ping: typeof pingApi + profiling: ProfilingApi putScript: typeof putScriptApi queryRuleset: QueryRulesetApi rankEval: typeof rankEvalApi @@ -178,6 +181,7 @@ export default interface API { searchableSnapshots: SearchableSnapshotsApi security: SecurityApi shutdown: ShutdownApi + simulate: SimulateApi slm: SlmApi snapshot: SnapshotApi sql: SqlApi @@ -217,12 +221,14 @@ const kMigration = Symbol('Migration') const kMl = Symbol('Ml') const kMonitoring = Symbol('Monitoring') const kNodes = Symbol('Nodes') +const kProfiling = Symbol('Profiling') const kQueryRuleset = Symbol('QueryRuleset') const kRollup = Symbol('Rollup') const kSearchApplication = Symbol('SearchApplication') const kSearchableSnapshots = Symbol('SearchableSnapshots') const kSecurity = Symbol('Security') const kShutdown = Symbol('Shutdown') +const kSimulate = Symbol('Simulate') const kSlm = Symbol('Slm') const kSnapshot = Symbol('Snapshot') const kSql = Symbol('Sql') @@ -257,12 +263,14 @@ export default class API { [kMl]: symbol | null [kMonitoring]: symbol | null [kNodes]: symbol | null + [kProfiling]: symbol | null [kQueryRuleset]: symbol | null [kRollup]: symbol | null [kSearchApplication]: symbol | null [kSearchableSnapshots]: symbol | null [kSecurity]: symbol | null [kShutdown]: symbol | null + [kSimulate]: symbol | null [kSlm]: symbol | null [kSnapshot]: symbol | null [kSql]: symbol | null @@ -296,12 +304,14 @@ export default class API { this[kMl] = null this[kMonitoring] = null this[kNodes] = null + this[kProfiling] = null this[kQueryRuleset] = null this[kRollup] = null this[kSearchApplication] = null this[kSearchableSnapshots] = null this[kSecurity] = null this[kShutdown] = null + this[kSimulate] = null this[kSlm] = null this[kSnapshot] = null this[kSql] = null @@ -427,6 +437,9 @@ Object.defineProperties(API.prototype, { nodes: { get () { return this[kNodes] === null ? (this[kNodes] = new NodesApi(this.transport)) : this[kNodes] } }, + profiling: { + get () { return this[kProfiling] === null ? (this[kProfiling] = new ProfilingApi(this.transport)) : this[kProfiling] } + }, queryRuleset: { get () { return this[kQueryRuleset] === null ? (this[kQueryRuleset] = new QueryRulesetApi(this.transport)) : this[kQueryRuleset] } }, @@ -445,6 +458,9 @@ Object.defineProperties(API.prototype, { shutdown: { get () { return this[kShutdown] === null ? (this[kShutdown] = new ShutdownApi(this.transport)) : this[kShutdown] } }, + simulate: { + get () { return this[kSimulate] === null ? (this[kSimulate] = new SimulateApi(this.transport)) : this[kSimulate] } + }, slm: { get () { return this[kSlm] === null ? (this[kSlm] = new SlmApi(this.transport)) : this[kSlm] } }, diff --git a/src/api/types.ts b/src/api/types.ts index 67504e24e..0523ed483 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -3036,7 +3036,7 @@ export type AggregationsBuckets = Record | T export type AggregationsBucketsPath = string | string[] | Record -export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1Y' +export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1y' export interface AggregationsCardinalityAggregate extends AggregationsAggregateBase { value: long @@ -4082,6 +4082,7 @@ export interface AggregationsTermsAggregation extends AggregationsBucketAggregat value_type?: string order?: AggregationsAggregateOrder script?: Script + shard_min_doc_count?: long shard_size?: integer show_term_doc_count_error?: boolean size?: integer @@ -5419,7 +5420,7 @@ export interface QueryDslConstantScoreQuery extends QueryDslQueryBase { export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5531,7 +5532,7 @@ export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5791,7 +5792,7 @@ export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' @@ -10434,6 +10435,7 @@ export interface IndicesMappingLimitSettingsNestedObjects { export interface IndicesMappingLimitSettingsTotalFields { limit?: long + ignore_dynamic_beyond_limit?: boolean } export interface IndicesMerge { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index aab35c695..6712bbadc 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -3109,7 +3109,7 @@ export type AggregationsBuckets = Record | T export type AggregationsBucketsPath = string | string[] | Record -export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1Y' +export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1y' export interface AggregationsCardinalityAggregate extends AggregationsAggregateBase { value: long @@ -4155,6 +4155,7 @@ export interface AggregationsTermsAggregation extends AggregationsBucketAggregat value_type?: string order?: AggregationsAggregateOrder script?: Script + shard_min_doc_count?: long shard_size?: integer show_term_doc_count_error?: boolean size?: integer @@ -5492,7 +5493,7 @@ export interface QueryDslConstantScoreQuery extends QueryDslQueryBase { export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5604,7 +5605,7 @@ export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5864,7 +5865,7 @@ export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' @@ -10608,6 +10609,7 @@ export interface IndicesMappingLimitSettingsNestedObjects { export interface IndicesMappingLimitSettingsTotalFields { limit?: long + ignore_dynamic_beyond_limit?: boolean } export interface IndicesMerge {