From a3d9fc22fbbcb525ac461ee4d21f1fe139d315a9 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 21 Apr 2025 06:04:13 +0000 Subject: [PATCH] Auto-generated API code --- docs/reference/api-reference.md | 18 ++++++--- src/api/api/esql.ts | 23 ++++++------ src/api/types.ts | 66 +++++++++++++++++++++++++++++++-- 3 files changed, 86 insertions(+), 21 deletions(-) diff --git a/docs/reference/api-reference.md b/docs/reference/api-reference.md index 7381b5ff2..c446c3b4a 100644 --- a/docs/reference/api-reference.md +++ b/docs/reference/api-reference.md @@ -4860,14 +4860,20 @@ A query ID is also provided when the request was submitted with the `keep_on_com If `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns. ## client.esql.getQuery [_esql.get_query] -Executes a get ESQL query request +Get a specific running ES|QL query information. +Returns an object extended information about a running ES|QL query. ```ts -client.esql.getQuery() +client.esql.getQuery({ id }) ``` +### Arguments [_arguments_esql.get_query] + +#### Request (object) [_request_esql.get_query] +- **`id` (string)**: The query ID ## client.esql.listQueries [_esql.list_queries] -Executes a list ESQL queries request +Get running ES|QL queries information. +Returns an object containing IDs and other information about the running ES|QL queries. ```ts client.esql.listQueries() ``` @@ -6732,7 +6738,7 @@ a new date field is added instead of string. not used at all by Elasticsearch, but can be used to store application-specific metadata. - **`numeric_detection` (Optional, boolean)**: Automatically map strings into numeric data types for all fields. -- **`properties` (Optional, Record)**: Mapping for a field. For new fields, this mapping can include: +- **`properties` (Optional, Record)**: Mapping for a field. For new fields, this mapping can include: - Field name - Field data type @@ -12365,7 +12371,7 @@ client.security.hasPrivileges({ ... }) #### Request (object) [_request_security.has_privileges] - **`user` (Optional, string)**: Username - **`application` (Optional, { application, privileges, resources }[])** -- **`cluster` (Optional, Enum("all" | "cancel_task" | "create_snapshot" | "cross_cluster_replication" | "cross_cluster_search" | "delegate_pki" | "grant_api_key" | "manage" | "manage_api_key" | "manage_autoscaling" | "manage_behavioral_analytics" | "manage_ccr" | "manage_data_frame_transforms" | "manage_data_stream_global_retention" | "manage_enrich" | "manage_ilm" | "manage_index_templates" | "manage_inference" | "manage_ingest_pipelines" | "manage_logstash_pipelines" | "manage_ml" | "manage_oidc" | "manage_own_api_key" | "manage_pipeline" | "manage_rollup" | "manage_saml" | "manage_search_application" | "manage_search_query_rules" | "manage_search_synonyms" | "manage_security" | "manage_service_account" | "manage_slm" | "manage_token" | "manage_transform" | "manage_user_profile" | "manage_watcher" | "monitor" | "monitor_data_frame_transforms" | "monitor_data_stream_global_retention" | "monitor_enrich" | "monitor_inference" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_stats" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])**: A list of the cluster privileges that you want to check. +- **`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_esql" | "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_esql" | "monitor_inference" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_stats" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])**: A list of the cluster privileges that you want to check. - **`index` (Optional, { names, privileges, allow_restricted_indices }[])** ## client.security.hasPrivilegesUserProfile [_security.has_privileges_user_profile] @@ -12591,7 +12597,7 @@ client.security.putRole({ name }) #### Request (object) [_request_security.put_role] - **`name` (string)**: The name of the role that is being created or updated. On Elasticsearch Serverless, the role name must begin with a letter or digit and can only contain letters, digits and the characters '_', '-', and '.'. Each role must have a unique name, as this will serve as the identifier for that role. - **`applications` (Optional, { application, privileges, resources }[])**: A list of application privilege entries. -- **`cluster` (Optional, Enum("all" | "cancel_task" | "create_snapshot" | "cross_cluster_replication" | "cross_cluster_search" | "delegate_pki" | "grant_api_key" | "manage" | "manage_api_key" | "manage_autoscaling" | "manage_behavioral_analytics" | "manage_ccr" | "manage_data_frame_transforms" | "manage_data_stream_global_retention" | "manage_enrich" | "manage_ilm" | "manage_index_templates" | "manage_inference" | "manage_ingest_pipelines" | "manage_logstash_pipelines" | "manage_ml" | "manage_oidc" | "manage_own_api_key" | "manage_pipeline" | "manage_rollup" | "manage_saml" | "manage_search_application" | "manage_search_query_rules" | "manage_search_synonyms" | "manage_security" | "manage_service_account" | "manage_slm" | "manage_token" | "manage_transform" | "manage_user_profile" | "manage_watcher" | "monitor" | "monitor_data_frame_transforms" | "monitor_data_stream_global_retention" | "monitor_enrich" | "monitor_inference" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_stats" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])**: A list of cluster privileges. These privileges define the cluster-level actions for users with this role. +- **`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_esql" | "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_esql" | "monitor_inference" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_stats" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])**: A list of cluster privileges. These privileges define the cluster-level actions for users with this role. - **`global` (Optional, Record)**: An object defining global privileges. A global privilege is a form of cluster privilege that is request-aware. Support for global privileges is currently limited to the management of application privileges. - **`indices` (Optional, { field_security, names, privileges, query, allow_restricted_indices }[])**: A list of indices permissions entries. - **`remote_indices` (Optional, { clusters, field_security, names, privileges, query, allow_restricted_indices }[])**: A list of remote indices permissions entries. diff --git a/src/api/api/esql.ts b/src/api/api/esql.ts index 98f952bfd..50711262b 100644 --- a/src/api/api/esql.ts +++ b/src/api/api/esql.ts @@ -309,12 +309,12 @@ export default class Esql { } /** - * Executes a get ESQL query request + * Get a specific running ES|QL query information. Returns an object extended information about a running ES|QL query. */ - async getQuery (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getQuery (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getQuery (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise - async getQuery (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { + async getQuery (this: That, params: T.EsqlGetQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getQuery (this: That, params: T.EsqlGetQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getQuery (this: That, params: T.EsqlGetQueryRequest, options?: TransportRequestOptions): Promise + async getQuery (this: That, params: T.EsqlGetQueryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath } = this.acceptedParams['esql.get_query'] @@ -332,11 +332,11 @@ export default class Esql { } } - params = params ?? {} for (const key in params) { if (acceptedPath.includes(key)) { continue } else if (key !== 'body' && key !== 'querystring') { + // @ts-expect-error querystring[key] = params[key] } } @@ -353,12 +353,12 @@ export default class Esql { } /** - * Executes a list ESQL queries request + * Get running ES|QL queries information. Returns an object containing IDs and other information about the running ES|QL queries. */ - async listQueries (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async listQueries (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async listQueries (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise - async listQueries (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { + async listQueries (this: That, params?: T.EsqlListQueriesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async listQueries (this: That, params?: T.EsqlListQueriesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async listQueries (this: That, params?: T.EsqlListQueriesRequest, options?: TransportRequestOptions): Promise + async listQueries (this: That, params?: T.EsqlListQueriesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath } = this.acceptedParams['esql.list_queries'] @@ -381,6 +381,7 @@ export default class Esql { if (acceptedPath.includes(key)) { continue } else if (key !== 'body' && key !== 'querystring') { + // @ts-expect-error querystring[key] = params[key] } } diff --git a/src/api/types.ts b/src/api/types.ts index 19cf61017..202f1b299 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -7606,6 +7606,22 @@ export interface MappingByteNumberProperty extends MappingNumberPropertyBase { null_value?: byte } +export interface MappingChunkingSettings { + /** The chunking strategy: `sentence` or `word`. */ + strategy: string + /** The maximum size of a chunk in words. + * This value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy). */ + max_chunk_size: integer + /** The number of overlapping words for chunks. + * It is applicable only to a `word` chunking strategy. + * This value cannot be higher than half the `max_chunk_size` value. */ + overlap?: integer + /** The number of overlapping sentences for chunks. + * It is applicable only for a `sentence` chunking strategy. + * It can be either `1` or `0`. */ + sentence_overlap?: integer +} + export interface MappingCompletionProperty extends MappingDocValuesPropertyBase { analyzer?: string contexts?: MappingSuggestContext[] @@ -8108,6 +8124,10 @@ export interface MappingSemanticTextProperty { * You can update this parameter by using the Update mapping API. Use the Create inference API to create the endpoint. * If not specified, the inference endpoint defined by inference_id will be used at both index and query time. */ search_inference_id?: Id + /** Settings for chunking text into smaller passages. If specified, these will override the + * chunking settings sent in the inference endpoint associated with inference_id. If chunking settings are updated, + * they will not be applied to existing documents until they are reindexed. */ + chunking_settings?: MappingChunkingSettings } export interface MappingShapeProperty extends MappingDocValuesPropertyBase { @@ -17451,6 +17471,44 @@ export interface EsqlAsyncQueryStopRequest extends RequestBase { export type EsqlAsyncQueryStopResponse = EsqlEsqlResult +export interface EsqlGetQueryRequest extends RequestBase { + /** The query ID */ + id: Id + /** All values in `body` will be added to the request body. */ + body?: string | { [key: string]: any } & { id?: never } + /** All values in `querystring` will be added to the request querystring. */ + querystring?: { [key: string]: any } & { id?: never } +} + +export interface EsqlGetQueryResponse { + id: long + node: NodeId + start_time_millis: long + running_time_nanos: long + query: string + coordinating_node: NodeId + data_nodes: NodeId[] +} + +export interface EsqlListQueriesBody { + id: long + node: NodeId + start_time_millis: long + running_time_nanos: long + query: string +} + +export interface EsqlListQueriesRequest extends RequestBase { + /** All values in `body` will be added to the request body. */ + body?: string | { [key: string]: any } + /** All values in `querystring` will be added to the request querystring. */ + querystring?: { [key: string]: any } +} + +export interface EsqlListQueriesResponse { + queries: Record +} + export interface EsqlQueryRequest extends RequestBase { /** A short version of the Accept header, e.g. json, yaml. */ format?: EsqlEsqlFormat @@ -30949,7 +31007,7 @@ export interface SecurityClusterNode { name: Name } -export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_stats' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string +export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_esql' | '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_esql' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_stats' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string export interface SecurityCreatedStatus { created: boolean @@ -37459,6 +37517,9 @@ export interface SpecUtilsCommonQueryParameters { pretty?: boolean } +export interface SpecUtilsOverloadOf { +} + export interface SpecUtilsCommonCatQueryParameters { /** Specifies the format to return the columnar data in, can be set to * `text`, `json`, `cbor`, `yaml`, or `smile`. */ @@ -37469,6 +37530,3 @@ export interface SpecUtilsCommonCatQueryParameters { /** When set to `true` will enable verbose output. */ v?: boolean } - -export interface SpecUtilsOverloadOf { -}