Auto-generated code for main (#2306)

This commit is contained in:
Elastic Machine
2024-07-25 07:38:52 +10:00
committed by GitHub
parent 94bf5b2aa7
commit 384debee9e
90 changed files with 6331 additions and 1489 deletions

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class AsyncSearch {
}
/**
* Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
* Deletes an async search by identifier. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
*/
async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchDeleteResponse>
@ -66,11 +67,17 @@ export default class AsyncSearch {
const method = 'DELETE'
const path = `/_async_search/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'async_search.delete',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Retrieves the results of a previously submitted async search request given its ID.
* Retrieves the results of a previously submitted async search request given its identifier. If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
*/
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchGetResponse<TDocument, TAggregations>>
@ -92,11 +99,17 @@ export default class AsyncSearch {
const method = 'GET'
const path = `/_async_search/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'async_search.get',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Retrieves the status of a previously submitted async search request given its ID.
* Get async search status Retrieves the status of a previously submitted async search request given its identifier, without retrieving search results. If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
*/
async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchStatusResponse>
@ -118,11 +131,17 @@ export default class AsyncSearch {
const method = 'GET'
const path = `/_async_search/status/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'async_search.status',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Executes a search request asynchronously.
* Runs a search request asynchronously. When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested. Warning: Async search does not support scroll nor search requests that only include the suggest section. By default, Elasticsearch doesnt allow you to store an async search response larger than 10Mb and an attempt to do this results in an error. The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
*/
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>
@ -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)
}
}

View File

@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Allows to perform multiple index/update/delete operations in a single request.
* Performs multiple indexing or delete operations in a single API call. This reduces overhead and can greatly increase indexing speed.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html | Elasticsearch API documentation}
*/
export default async function BulkApi<TDocument = unknown, TPartialDocument = unknown> (this: That, params: T.BulkRequest<TDocument, TPartialDocument> | TB.BulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptionsWithOutMeta): Promise<T.BulkResponse>
@ -72,5 +73,11 @@ export default async function BulkApi<TDocument = unknown, TPartialDocument = un
method = 'POST'
path = '/_bulk'
}
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
const meta: TransportRequestMetadata = {
name: 'bulk',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
}

View File

@ -0,0 +1,68 @@
/*
* 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 }
/**
* Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported
* @see {@link https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/README.asciidoc#require-or-skip-api-capabilities | Elasticsearch API documentation}
*/
export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'GET'
const path = '/_capabilities'
const meta: TransportRequestMetadata = {
name: 'capabilities'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class Cat {
}
/**
* Shows information about currently configured aliases to indices including filter and routing infos.
* Retrieves the clusters index aliases, including filter and routing information. The API does not return data stream aliases. IMPORTANT: cat APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html | Elasticsearch API documentation}
*/
async aliases (this: That, params?: T.CatAliasesRequest | TB.CatAliasesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatAliasesResponse>
@ -74,11 +75,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/aliases'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.aliases',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using.
* Provides a snapshot of the number of shards allocated to each data node and their disk space. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html | Elasticsearch API documentation}
*/
async allocation (this: That, params?: T.CatAllocationRequest | TB.CatAllocationRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatAllocationResponse>
@ -108,11 +115,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/allocation'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.allocation',
pathParts: {
node_id: params.node_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about existing component_templates templates.
* Returns information about component templates in a cluster. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get component template API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html | Elasticsearch API documentation}
*/
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatComponentTemplatesResponse>
@ -142,11 +155,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/component_templates'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.component_templates',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Provides quick access to the document count of the entire cluster, or individual indices.
* Provides quick access to a document count for a data stream, an index, or an entire cluster. NOTE: The document count only includes live documents, not deleted documents which have not yet been removed by the merge process. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the count API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html | Elasticsearch API documentation}
*/
async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatCountResponse>
@ -176,11 +195,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/count'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.count',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Shows how much heap memory is currently being used by fielddata on every data node in the cluster.
* Returns the amount of heap memory currently used by the field data cache on every data node in the cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes stats API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html | Elasticsearch API documentation}
*/
async fielddata (this: That, params?: T.CatFielddataRequest | TB.CatFielddataRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatFielddataResponse>
@ -210,11 +235,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/fielddata'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.fielddata',
pathParts: {
fields: params.fields
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns a concise representation of the cluster health.
* Returns the health status of a cluster, similar to the cluster health API. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the cluster health API. This API is often used to check malfunctioning clusters. To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats: `HH:MM:SS`, which is human-readable but includes no date information; `Unix epoch time`, which is machine-sortable and includes date information. The latter format is useful for cluster recoveries that take multiple days. You can use the cat health API to verify cluster health across multiple nodes. You also can use the API to track the recovery of a large cluster over a longer period of time.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html | Elasticsearch API documentation}
*/
async health (this: That, params?: T.CatHealthRequest | TB.CatHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatHealthResponse>
@ -237,7 +268,10 @@ export default class Cat {
const method = 'GET'
const path = '/_cat/health'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.health'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -264,11 +298,14 @@ export default class Cat {
const method = 'GET'
const path = '/_cat'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.help'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about indices: number of primaries and replicas, document counts, disk size, ...
* Returns high-level information about indices in a cluster, including backing indices for data streams. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index API. Use the cat indices API to get the following information for each index in a cluster: shard count; document count; deleted document count; primary store size; total store size of all shards, including shard replicas. These metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents. To get an accurate count of Elasticsearch documents, use the cat count or count APIs.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html | Elasticsearch API documentation}
*/
async indices (this: That, params?: T.CatIndicesRequest | TB.CatIndicesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatIndicesResponse>
@ -298,11 +335,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/indices'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.indices',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about the master node.
* Returns information about the master node, including the ID, bound IP address, and name. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html | Elasticsearch API documentation}
*/
async master (this: That, params?: T.CatMasterRequest | TB.CatMasterRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMasterResponse>
@ -325,11 +368,14 @@ export default class Cat {
const method = 'GET'
const path = '/_cat/master'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.master'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Gets configuration and usage information about data frame analytics jobs.
* Returns configuration and usage information about data frame analytics jobs. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get data frame analytics jobs statistics API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-dfanalytics.html | Elasticsearch API documentation}
*/
async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest | TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMlDataFrameAnalyticsResponse>
@ -359,11 +405,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/ml/data_frame/analytics'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.ml_data_frame_analytics',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Gets configuration and usage information about datafeeds.
* Returns configuration and usage information about datafeeds. This API returns a maximum of 10,000 datafeeds. If the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get datafeed statistics API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-datafeeds.html | Elasticsearch API documentation}
*/
async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest | TB.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMlDatafeedsResponse>
@ -393,11 +445,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/ml/datafeeds'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.ml_datafeeds',
pathParts: {
datafeed_id: params.datafeed_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Gets configuration and usage information about anomaly detection jobs.
* Returns configuration and usage information for anomaly detection jobs. This API returns a maximum of 10,000 jobs. If the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get anomaly detection job statistics API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-anomaly-detectors.html | Elasticsearch API documentation}
*/
async mlJobs (this: That, params?: T.CatMlJobsRequest | TB.CatMlJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMlJobsResponse>
@ -427,11 +485,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/ml/anomaly_detectors'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.ml_jobs',
pathParts: {
job_id: params.job_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Gets configuration and usage information about inference trained models.
* Returns configuration and usage information about inference trained models. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get trained models statistics API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-trained-model.html | Elasticsearch API documentation}
*/
async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest | TB.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMlTrainedModelsResponse>
@ -461,11 +525,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/ml/trained_models'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.ml_trained_models',
pathParts: {
model_id: params.model_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about custom node attributes.
* Returns information about custom node attributes. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html | Elasticsearch API documentation}
*/
async nodeattrs (this: That, params?: T.CatNodeattrsRequest | TB.CatNodeattrsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatNodeattrsResponse>
@ -488,11 +558,14 @@ export default class Cat {
const method = 'GET'
const path = '/_cat/nodeattrs'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.nodeattrs'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns basic statistics about performance of cluster nodes.
* Returns information about the nodes in a cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html | Elasticsearch API documentation}
*/
async nodes (this: That, params?: T.CatNodesRequest | TB.CatNodesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatNodesResponse>
@ -515,11 +588,14 @@ export default class Cat {
const method = 'GET'
const path = '/_cat/nodes'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.nodes'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns a concise representation of the cluster pending tasks.
* Returns cluster-level changes that have not yet been executed. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the pending cluster tasks API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html | Elasticsearch API documentation}
*/
async pendingTasks (this: That, params?: T.CatPendingTasksRequest | TB.CatPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatPendingTasksResponse>
@ -542,11 +618,14 @@ export default class Cat {
const method = 'GET'
const path = '/_cat/pending_tasks'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.pending_tasks'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about installed plugins across nodes node.
* Returns a list of plugins running on each node of a cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html | Elasticsearch API documentation}
*/
async plugins (this: That, params?: T.CatPluginsRequest | TB.CatPluginsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatPluginsResponse>
@ -569,11 +648,14 @@ export default class Cat {
const method = 'GET'
const path = '/_cat/plugins'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.plugins'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about index shard recoveries, both on-going completed.
* Returns information about ongoing and completed shard recoveries. Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or syncing a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing. For data streams, the API returns information about the streams backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html | Elasticsearch API documentation}
*/
async recovery (this: That, params?: T.CatRecoveryRequest | TB.CatRecoveryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatRecoveryResponse>
@ -603,11 +685,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/recovery'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.recovery',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about snapshot repositories registered in the cluster.
* Returns the snapshot repositories for a cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot repository API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html | Elasticsearch API documentation}
*/
async repositories (this: That, params?: T.CatRepositoriesRequest | TB.CatRepositoriesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatRepositoriesResponse>
@ -630,11 +718,14 @@ export default class Cat {
const method = 'GET'
const path = '/_cat/repositories'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.repositories'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Provides low-level information about the segments in the shards of an index.
* Returns low-level information about the Lucene segments in index shards. For data streams, the API returns information about the backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html | Elasticsearch API documentation}
*/
async segments (this: That, params?: T.CatSegmentsRequest | TB.CatSegmentsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatSegmentsResponse>
@ -664,11 +755,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/segments'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.segments',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Provides a detailed view of shard allocation on nodes.
* Returns information about the shards in a cluster. For data streams, the API returns information about the backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html | Elasticsearch API documentation}
*/
async shards (this: That, params?: T.CatShardsRequest | TB.CatShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatShardsResponse>
@ -698,11 +795,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/shards'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.shards',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns all snapshots in a specific repository.
* Returns information about the snapshots stored in one or more repositories. A snapshot is a backup of an index or running Elasticsearch cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html | Elasticsearch API documentation}
*/
async snapshots (this: That, params?: T.CatSnapshotsRequest | TB.CatSnapshotsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatSnapshotsResponse>
@ -732,11 +835,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/snapshots'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.snapshots',
pathParts: {
repository: params.repository
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about the tasks currently executing on one or more nodes in the cluster.
* Returns information about tasks currently executing in the cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html | Elasticsearch API documentation}
*/
async tasks (this: That, params?: T.CatTasksRequest | TB.CatTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatTasksResponse>
@ -759,11 +868,14 @@ export default class Cat {
const method = 'GET'
const path = '/_cat/tasks'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.tasks'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about existing templates.
* Returns information about index templates in a cluster. You can use index templates to apply index settings and field mappings to new indices at creation. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index template API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html | Elasticsearch API documentation}
*/
async templates (this: That, params?: T.CatTemplatesRequest | TB.CatTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatTemplatesResponse>
@ -793,11 +905,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/templates'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.templates',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools.
* Returns thread pool statistics for each node in a cluster. Returned information includes all built-in thread pools and custom thread pools. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html | Elasticsearch API documentation}
*/
async threadPool (this: That, params?: T.CatThreadPoolRequest | TB.CatThreadPoolRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatThreadPoolResponse>
@ -827,11 +945,17 @@ export default class Cat {
method = 'GET'
path = '/_cat/thread_pool'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.thread_pool',
pathParts: {
thread_pool_patterns: params.thread_pool_patterns
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Gets configuration and usage information about transforms.
* Returns configuration and usage information about transforms. IMPORTANT: cat APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get transform statistics API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-transforms.html | Elasticsearch API documentation}
*/
async transforms (this: That, params?: T.CatTransformsRequest | TB.CatTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatTransformsResponse>
@ -861,6 +985,12 @@ export default class Cat {
method = 'GET'
path = '/_cat/transforms'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cat.transforms',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -66,7 +67,13 @@ export default class Ccr {
const method = 'DELETE'
const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.delete_auto_follow_pattern',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -104,7 +111,13 @@ export default class Ccr {
const method = 'PUT'
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/follow`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.follow',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -130,7 +143,13 @@ export default class Ccr {
const method = 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/info`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.follow_info',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -156,7 +175,13 @@ export default class Ccr {
const method = 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/stats`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.follow_stats',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -194,7 +219,13 @@ export default class Ccr {
const method = 'POST'
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/forget_follower`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.forget_follower',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -228,7 +259,13 @@ export default class Ccr {
method = 'GET'
path = '/_ccr/auto_follow'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.get_auto_follow_pattern',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -254,7 +291,13 @@ export default class Ccr {
const method = 'POST'
const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}/pause`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.pause_auto_follow_pattern',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -280,7 +323,13 @@ export default class Ccr {
const method = 'POST'
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/pause_follow`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.pause_follow',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -318,7 +367,13 @@ export default class Ccr {
const method = 'PUT'
const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.put_auto_follow_pattern',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -344,7 +399,13 @@ export default class Ccr {
const method = 'POST'
const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}/resume`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.resume_auto_follow_pattern',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -382,7 +443,13 @@ export default class Ccr {
const method = 'POST'
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/resume_follow`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.resume_follow',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -409,7 +476,10 @@ export default class Ccr {
const method = 'GET'
const path = '/_ccr/stats'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.stats'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -435,6 +505,12 @@ export default class Ccr {
const method = 'POST'
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/unfollow`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ccr.unfollow',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Explicitly clears the search context for a scroll.
* Clears the search context and results for a scrolling search.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html | Elasticsearch API documentation}
*/
export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClearScrollResponse>
@ -73,5 +74,11 @@ export default async function ClearScrollApi (this: That, params?: T.ClearScroll
const method = 'DELETE'
const path = '/_search/scroll'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'clear_scroll',
pathParts: {
scroll_id: params.scroll_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Close a point in time
* Closes a point-in-time.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html | Elasticsearch API documentation}
*/
export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest | TB.ClosePointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClosePointInTimeResponse>
@ -72,5 +73,8 @@ export default async function ClosePointInTimeApi (this: That, params: T.ClosePo
const method = 'DELETE'
const path = '/_pit'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'close_point_in_time'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -79,11 +80,14 @@ export default class Cluster {
const method = body != null ? 'POST' : 'GET'
const path = '/_cluster/allocation/explain'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.allocation_explain'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Deletes a component template
* Deletes component templates. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation}
*/
async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest | TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterDeleteComponentTemplateResponse>
@ -105,7 +109,13 @@ export default class Cluster {
const method = 'DELETE'
const path = `/_component_template/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.delete_component_template',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -132,7 +142,10 @@ export default class Cluster {
const method = 'DELETE'
const path = '/_cluster/voting_config_exclusions'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.delete_voting_config_exclusions'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -158,11 +171,17 @@ export default class Cluster {
const method = 'HEAD'
const path = `/_component_template/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.exists_component_template',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns one or more component templates
* Retrieves information about component templates.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation}
*/
async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest | TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterGetComponentTemplateResponse>
@ -192,11 +211,17 @@ export default class Cluster {
method = 'GET'
path = '/_component_template'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.get_component_template',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns cluster settings.
* Returns cluster-wide settings. By default, it returns only settings that have been explicitly defined.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html | Elasticsearch API documentation}
*/
async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterGetSettingsResponse>
@ -219,11 +244,14 @@ export default class Cluster {
const method = 'GET'
const path = '/_cluster/settings'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.get_settings'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns basic information about the health of the cluster.
* The cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the streams backing indices. The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html | Elasticsearch API documentation}
*/
async health (this: That, params?: T.ClusterHealthRequest | TB.ClusterHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterHealthResponse>
@ -253,7 +281,13 @@ export default class Cluster {
method = 'GET'
path = '/_cluster/health'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.health',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -279,11 +313,17 @@ export default class Cluster {
const method = 'GET'
const path = `/_info/${encodeURIComponent(params.target.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.info',
pathParts: {
target: params.target
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed.
* Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed. NOTE: This API returns a list of any pending updates to the cluster state. These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests. However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html | Elasticsearch API documentation}
*/
async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterPendingTasksResponse>
@ -306,7 +346,10 @@ export default class Cluster {
const method = 'GET'
const path = '/_cluster/pending_tasks'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.pending_tasks'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -333,11 +376,14 @@ export default class Cluster {
const method = 'POST'
const path = '/_cluster/voting_config_exclusions'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.post_voting_config_exclusions'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Creates or updates a component template
* Creates or updates a component template. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. An index template can be composed of multiple component templates. To use a component template, specify it in an index templates `composed_of` list. Component templates are only applied to new data streams and indices as part of a matching index template. Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. Component templates are only used during index creation. For data streams, this includes data stream creation and the creation of a streams backing indices. Changes to component templates do not affect existing indices, including a streams backing indices. You can use C-style `/* *\/` block comments in component templates. You can include comments anywhere in the request body except before the opening curly bracket.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation}
*/
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterPutComponentTemplateResponse>
@ -371,7 +417,13 @@ export default class Cluster {
const method = 'PUT'
const path = `/_component_template/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.put_component_template',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -410,11 +462,14 @@ export default class Cluster {
const method = 'PUT'
const path = '/_cluster/settings'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.put_settings'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns the information about configured remote clusters.
* The cluster remote info API allows you to retrieve all of the configured remote cluster information. It returns connection and endpoint information keyed by the configured remote cluster alias.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html | Elasticsearch API documentation}
*/
async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest | TB.ClusterRemoteInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterRemoteInfoResponse>
@ -437,7 +492,10 @@ export default class Cluster {
const method = 'GET'
const path = '/_remote/info'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.remote_info'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -476,7 +534,10 @@ export default class Cluster {
const method = 'POST'
const path = '/_cluster/reroute'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.reroute'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -513,11 +574,18 @@ export default class Cluster {
method = 'GET'
path = '/_cluster/state'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.state',
pathParts: {
metric: params.metric,
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns high-level overview of cluster statistics.
* Returns cluster statistics. It returns basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html | Elasticsearch API documentation}
*/
async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterStatsResponse>
@ -547,6 +615,12 @@ export default class Cluster {
method = 'GET'
path = '/_cluster/stats'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'cluster.stats',
pathParts: {
node_id: params.node_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -80,5 +81,11 @@ export default async function CountApi (this: That, params?: T.CountRequest | TB
method = body != null ? 'POST' : 'GET'
path = '/_count'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'count',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index.
* Adds a JSON document to the specified data stream or index and makes it searchable. If the target is an index and the document already exists, the request updates the document and increments its version.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html | Elasticsearch API documentation}
*/
export default async function CreateApi<TDocument = unknown> (this: That, params: T.CreateRequest<TDocument> | TB.CreateRequest<TDocument>, options?: TransportRequestOptionsWithOutMeta): Promise<T.CreateResponse>
@ -65,5 +66,12 @@ export default async function CreateApi<TDocument = unknown> (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)
}

View File

@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Removes a document from the index.
* Removes a JSON document from the specified index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html | Elasticsearch API documentation}
*/
export default async function DeleteApi (this: That, params: T.DeleteRequest | TB.DeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.DeleteResponse>
@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Deletes documents matching the provided query.
* Deletes documents that match the specified query.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html | Elasticsearch API documentation}
*/
export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest | TB.DeleteByQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.DeleteByQueryResponse>
@ -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)
}

View File

@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Deletes a script.
* Deletes a stored script or search template.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation}
*/
export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.DeleteScriptResponse>
@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -66,7 +67,13 @@ export default class Enrich {
const method = 'DELETE'
const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'enrich.delete_policy',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -92,11 +99,17 @@ export default class Enrich {
const method = 'PUT'
const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}/_execute`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'enrich.execute_policy',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Gets information about an enrich policy.
* Returns information about an enrich policy.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-enrich-policy-api.html | Elasticsearch API documentation}
*/
async getPolicy (this: That, params?: T.EnrichGetPolicyRequest | TB.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EnrichGetPolicyResponse>
@ -126,11 +139,17 @@ export default class Enrich {
method = 'GET'
path = '/_enrich/policy'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'enrich.get_policy',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Creates a new enrich policy.
* Creates an enrich policy.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-enrich-policy-api.html | Elasticsearch API documentation}
*/
async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EnrichPutPolicyResponse>
@ -164,11 +183,17 @@ export default class Enrich {
const method = 'PUT'
const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'enrich.put_policy',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Gets enrich coordinator statistics and information about enrich policies that are currently executing.
* Returns enrich coordinator statistics and information about enrich policies that are currently executing.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/enrich-stats-api.html | Elasticsearch API documentation}
*/
async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EnrichStatsResponse>
@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class Eql {
}
/**
* Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
* Deletes an async EQL search or a stored synchronous EQL search. The API also deletes results for the search.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html | Elasticsearch API documentation}
*/
async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlDeleteResponse>
@ -66,11 +67,17 @@ export default class Eql {
const method = 'DELETE'
const path = `/_eql/search/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'eql.delete',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns async results from previously executed Event Query Language (EQL) search
* Returns the current status and available results for an async EQL search or a stored synchronous EQL search.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html | Elasticsearch API documentation}
*/
async get<TEvent = unknown> (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlGetResponse<TEvent>>
@ -92,11 +99,17 @@ export default class Eql {
const method = 'GET'
const path = `/_eql/search/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'eql.get',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns the status of a previously submitted async or stored Event Query Language (EQL) search
* Returns the current status for an async EQL search or a stored synchronous EQL search without returning results.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html | Elasticsearch API documentation}
*/
async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlGetStatusResponse>
@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,68 @@ export default class Esql {
}
/**
* Executes an ESQL request
* Executes an ESQL request asynchronously
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html | Elasticsearch API documentation}
*/
async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'POST'
const path = '/_query/async'
const meta: TransportRequestMetadata = {
name: 'esql.async_query'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Retrieves the results of a previously submitted async query request given its ID.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html | Elasticsearch API documentation}
*/
async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['id']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'GET'
const path = `/_query/async/${encodeURIComponent(params.id.toString())}`
const meta: TransportRequestMetadata = {
name: 'esql.async_query_get',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Executes an ES|QL request
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-rest.html | Elasticsearch API documentation}
*/
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlQueryResponse>
@ -52,7 +114,7 @@ export default class Esql {
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlQueryResponse>
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'query']
const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
@ -78,6 +140,9 @@ export default class Esql {
const method = 'POST'
const path = '/_query'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'esql.query'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Returns information about whether a document exists in an index.
* Checks if a document in an index exists.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation}
*/
export default async function ExistsApi (this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExistsResponse>
@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Returns information about whether a document source exists in an index.
* Checks if a document's `_source` is stored.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation}
*/
export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExistsSourceResponse>
@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Returns information about why a specific matches (or doesn't match) a query.
* Returns information about why a specific document matches (or doesnt match) a query.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html | Elasticsearch API documentation}
*/
export default async function ExplainApi<TDocument = unknown> (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExplainResponse<TDocument>>
@ -72,5 +73,12 @@ export default async function ExplainApi<TDocument = unknown> (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)
}

View File

@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Returns the information about the capabilities of fields among multiple indices.
* The field capabilities API returns the information about the capabilities of fields among multiple indices. The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type of keyword is returned as any other field that belongs to the `keyword` family.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html | Elasticsearch API documentation}
*/
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -65,7 +66,13 @@ export default class Fleet {
const method = 'DELETE'
const path = `/_fleet/secret/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.delete_secret',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -90,7 +97,13 @@ export default class Fleet {
const method = 'GET'
const path = `/_fleet/secret/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.get_secret',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -116,11 +129,17 @@ export default class Fleet {
const method = 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_fleet/global_checkpoints`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.global_checkpoints',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project.
* Executes several [fleet searches](https://www.elastic.co/guide/en/elasticsearch/reference/current/fleet-search.html) with a single API request. The API follows the same structure as the [multi search](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html) API. However, similar to the fleet search API, it supports the wait_for_checkpoints parameter.
*/
async msearch<TDocument = unknown> (this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetMsearchResponse<TDocument>>
async msearch<TDocument = unknown> (this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetMsearchResponse<TDocument>, unknown>>
@ -153,7 +172,13 @@ export default class Fleet {
method = body != null ? 'POST' : 'GET'
path = '/_fleet/_fleet_msearch'
}
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.msearch',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
}
/**
@ -178,11 +203,14 @@ export default class Fleet {
const method = 'POST'
const path = '/_fleet/secret'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.post_secret'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project.
* The purpose of the fleet search api is to provide a search api where the search will only be executed after provided checkpoint has been processed and is visible for searches inside of Elasticsearch.
*/
async search<TDocument = unknown> (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetSearchResponse<TDocument>>
async search<TDocument = unknown> (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetSearchResponse<TDocument>, unknown>>
@ -215,6 +243,12 @@ export default class Fleet {
const method = body != null ? 'POST' : 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_fleet/_fleet_search`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.search',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -60,5 +61,12 @@ export default async function GetApi<TDocument = unknown> (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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Returns a script.
* Retrieves a stored script or search template.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation}
*/
export default async function GetScriptApi (this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GetScriptResponse>
@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -60,5 +61,12 @@ export default async function GetSourceApi<TDocument = unknown> (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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class Graph {
}
/**
* Explore extracted and summarized information about the documents and terms in an index.
* Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/graph-explore-api.html | Elasticsearch API documentation}
*/
async explore (this: That, params: T.GraphExploreRequest | TB.GraphExploreRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GraphExploreResponse>
@ -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)
}
}

View File

@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class Ilm {
}
/**
* Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted.
* Deletes the specified lifecycle policy definition. You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-delete-lifecycle.html | Elasticsearch API documentation}
*/
async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest | TB.IlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmDeleteLifecycleResponse>
@ -66,11 +67,17 @@ export default class Ilm {
const method = 'DELETE'
const path = `/_ilm/policy/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ilm.delete_lifecycle',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step.
* Retrieves information about the indexs current lifecycle state, such as the currently executing phase, action, and step. Shows when the index entered each one, the definition of the running phase, and information about any failures.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-explain-lifecycle.html | Elasticsearch API documentation}
*/
async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest | TB.IlmExplainLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmExplainLifecycleResponse>
@ -92,11 +99,17 @@ export default class Ilm {
const method = 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_ilm/explain`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ilm.explain_lifecycle',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns the specified policy definition. Includes the policy version and last modified date.
* Retrieves a lifecycle policy.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-get-lifecycle.html | Elasticsearch API documentation}
*/
async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest | TB.IlmGetLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmGetLifecycleResponse>
@ -126,7 +139,13 @@ export default class Ilm {
method = 'GET'
path = '/_ilm/policy'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ilm.get_lifecycle',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -153,11 +172,14 @@ export default class Ilm {
const method = 'GET'
const path = '/_ilm/status'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ilm.get_status'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing
* Switches the indices, ILM policies, and legacy, composable and component templates from using custom node attributes and attribute-based allocation filters to using data tiers, and optionally deletes one legacy index template.+ Using node roles enables ILM to automatically move the indices between data tiers.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-migrate-to-data-tiers.html | Elasticsearch API documentation}
*/
async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest | TB.IlmMigrateToDataTiersRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmMigrateToDataTiersResponse>
@ -192,7 +214,10 @@ export default class Ilm {
const method = 'POST'
const path = '/_ilm/migrate_to_data_tiers'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ilm.migrate_to_data_tiers'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -230,11 +255,17 @@ export default class Ilm {
const method = 'POST'
const path = `/_ilm/move/${encodeURIComponent(params.index.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ilm.move_to_step',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Creates a lifecycle policy
* Creates a lifecycle policy. If the specified policy exists, the policy is replaced and the policy version is incremented.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-put-lifecycle.html | Elasticsearch API documentation}
*/
async putLifecycle (this: That, params: T.IlmPutLifecycleRequest | TB.IlmPutLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmPutLifecycleResponse>
@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Creates or updates a document in an index.
* Adds a JSON document to the specified data stream or index and makes it searchable. If the target is an index and the document already exists, the request updates the document and increments its version.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html | Elasticsearch API documentation}
*/
export default async function IndexApi<TDocument = unknown> (this: That, params: T.IndexRequest<TDocument> | TB.IndexRequest<TDocument>, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndexResponse>
@ -72,5 +73,12 @@ export default async function IndexApi<TDocument = unknown> (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)
}

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -73,7 +74,14 @@ export default class Inference {
method = 'DELETE'
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'inference.delete',
pathParts: {
task_type: params.task_type,
inference_id: params.inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -110,11 +118,18 @@ export default class Inference {
method = 'GET'
path = '/_inference'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'inference.get',
pathParts: {
task_type: params.task_type,
inference_id: params.inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Perform inference
* Perform inference on the service
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html | Elasticsearch API documentation}
*/
async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceInferenceResponse>
@ -155,11 +170,18 @@ export default class Inference {
method = 'POST'
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'inference.inference',
pathParts: {
task_type: params.task_type,
inference_id: params.inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Configure an inference endpoint for use in the Inference API
* Create an inference endpoint
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html | Elasticsearch API documentation}
*/
async put (this: That, params: T.InferencePutRequest | TB.InferencePutRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutResponse>
@ -193,6 +215,13 @@ export default class Inference {
method = 'PUT'
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'inference.put',
pathParts: {
task_type: params.task_type,
inference_id: params.inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,39 @@ export default class Ingest {
}
/**
* Deletes a pipeline.
* Deletes a geoip database configuration
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html | Elasticsearch API documentation}
*/
async deleteGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async deleteGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async deleteGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async deleteGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['id']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'DELETE'
const path = `/_ingest/geoip/database/${encodeURIComponent(params.id.toString())}`
const meta: TransportRequestMetadata = {
name: 'ingest.delete_geoip_database',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Deletes one or more existing ingest pipeline.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html | Elasticsearch API documentation}
*/
async deletePipeline (this: That, params: T.IngestDeletePipelineRequest | TB.IngestDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestDeletePipelineResponse>
@ -66,11 +99,17 @@ export default class Ingest {
const method = 'DELETE'
const path = `/_ingest/pipeline/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ingest.delete_pipeline',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns statistical information about geoip databases
* Gets download statistics for GeoIP2 databases used with the geoip processor.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-processor.html | Elasticsearch API documentation}
*/
async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest | TB.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestGeoIpStatsResponse>
@ -93,11 +132,53 @@ export default class Ingest {
const method = 'GET'
const path = '/_ingest/geoip/stats'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ingest.geo_ip_stats'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns a pipeline.
* Returns geoip database configuration.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html | Elasticsearch API documentation}
*/
async getGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['id']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
let method = ''
let path = ''
if (params.id != null) {
method = 'GET'
path = `/_ingest/geoip/database/${encodeURIComponent(params.id.toString())}`
} else {
method = 'GET'
path = '/_ingest/geoip/database'
}
const meta: TransportRequestMetadata = {
name: 'ingest.get_geoip_database',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about one or more ingest pipelines. This API returns a local reference of the pipeline.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html | Elasticsearch API documentation}
*/
async getPipeline (this: That, params?: T.IngestGetPipelineRequest | TB.IngestGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestGetPipelineResponse>
@ -127,11 +208,17 @@ export default class Ingest {
method = 'GET'
path = '/_ingest/pipeline'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ingest.get_pipeline',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns a list of the built-in patterns.
* Extracts structured fields out of a single text field within a document. You choose which field to extract matched fields from, as well as the grok pattern you expect will match. A grok pattern is like a regular expression that supports aliased expressions that can be reused.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html | Elasticsearch API documentation}
*/
async processorGrok (this: That, params?: T.IngestProcessorGrokRequest | TB.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestProcessorGrokResponse>
@ -154,11 +241,46 @@ export default class Ingest {
const method = 'GET'
const path = '/_ingest/processor/grok'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ingest.processor_grok'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Creates or updates a pipeline.
* Puts the configuration for a geoip database to be downloaded
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html | Elasticsearch API documentation}
*/
async putGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async putGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async putGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async putGeoipDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['id']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_ingest/geoip/database/${encodeURIComponent(params.id.toString())}`
const meta: TransportRequestMetadata = {
name: 'ingest.put_geoip_database',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Creates or updates an ingest pipeline. Changes made using this API take effect immediately.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html | Elasticsearch API documentation}
*/
async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestPutPipelineResponse>
@ -192,11 +314,17 @@ export default class Ingest {
const method = 'PUT'
const path = `/_ingest/pipeline/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ingest.put_pipeline',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Allows to simulate a pipeline with example documents.
* Executes an ingest pipeline against a set of provided documents.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html | Elasticsearch API documentation}
*/
async simulate (this: That, params?: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestSimulateResponse>
@ -238,6 +366,12 @@ export default class Ingest {
method = body != null ? 'POST' : 'GET'
path = '/_ingest/pipeline/_simulate'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ingest.simulate',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -72,5 +73,11 @@ export default async function KnnSearchApi<TDocument = unknown> (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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -67,11 +68,14 @@ export default class License {
const method = 'DELETE'
const path = '/_license'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'license.delete'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Retrieves licensing information for the cluster
* This API returns information about the type of license, when it was issued, and when it expires, for example. For more information about the different types of licenses, see https://www.elastic.co/subscriptions.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html | Elasticsearch API documentation}
*/
async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicenseGetResponse>
@ -94,7 +98,10 @@ export default class License {
const method = 'GET'
const path = '/_license'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'license.get'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -121,7 +128,10 @@ export default class License {
const method = 'GET'
const path = '/_license/basic_status'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'license.get_basic_status'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -148,7 +158,10 @@ export default class License {
const method = 'GET'
const path = '/_license/trial_status'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'license.get_trial_status'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -187,11 +200,14 @@ export default class License {
const method = 'PUT'
const path = '/_license'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'license.post'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Starts an indefinite basic license.
* The start basic API enables you to initiate an indefinite basic license, which gives access to all the basic features. If the basic license does not support all of the features that are available with your current license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true. To check the status of your basic license, use the following API: [Get basic status](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-basic-status.html).
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html | Elasticsearch API documentation}
*/
async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest | TB.LicensePostStartBasicRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostStartBasicResponse>
@ -214,11 +230,14 @@ export default class License {
const method = 'POST'
const path = '/_license/start_basic'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'license.post_start_basic'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* starts a limited time trial license.
* The start trial API enables you to start a 30-day trial, which gives access to all subscription features.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html | Elasticsearch API documentation}
*/
async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest | TB.LicensePostStartTrialRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostStartTrialResponse>
@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class Logstash {
}
/**
* Deletes Logstash Pipelines used by Central Management
* Deletes a pipeline used for Logstash Central Management.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-delete-pipeline.html | Elasticsearch API documentation}
*/
async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest | TB.LogstashDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LogstashDeletePipelineResponse>
@ -66,11 +67,17 @@ export default class Logstash {
const method = 'DELETE'
const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'logstash.delete_pipeline',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Retrieves Logstash Pipelines used by Central Management
* Retrieves pipelines used for Logstash Central Management.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-get-pipeline.html | Elasticsearch API documentation}
*/
async getPipeline (this: That, params?: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LogstashGetPipelineResponse>
@ -100,11 +107,17 @@ export default class Logstash {
method = 'GET'
path = '/_logstash/pipeline'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'logstash.get_pipeline',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Adds and updates Logstash Pipelines used for Central Management
* Creates or updates a pipeline used for Logstash Central Management.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-put-pipeline.html | Elasticsearch API documentation}
*/
async putPipeline (this: That, params: T.LogstashPutPipelineRequest | TB.LogstashPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LogstashPutPipelineResponse>
@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -80,5 +81,11 @@ export default async function MgetApi<TDocument = unknown> (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)
}

View File

@ -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)
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -72,5 +73,11 @@ export default async function MsearchApi<TDocument = unknown, TAggregations = Re
method = body != null ? 'POST' : 'GET'
path = '/_msearch'
}
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
const meta: TransportRequestMetadata = {
name: 'msearch',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Allows to execute several search template operations in one request.
* Runs multiple templated searches with a single request.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html | Elasticsearch API documentation}
*/
export default async function MsearchTemplateApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MsearchTemplateResponse<TDocument, TAggregations>>
@ -72,5 +73,11 @@ export default async function MsearchTemplateApi<TDocument = unknown, TAggregati
method = body != null ? 'POST' : 'GET'
path = '/_msearch/template'
}
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
const meta: TransportRequestMetadata = {
name: 'msearch_template',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -80,5 +81,11 @@ export default async function MtermvectorsApi (this: That, params?: T.Mtermvecto
method = body != null ? 'POST' : 'GET'
path = '/_mtermvectors'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'mtermvectors',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class Nodes {
}
/**
* Removes the archived repositories metering information present in the cluster.
* You can use this API to clear the archived repositories metering information in the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-repositories-metering-archive-api.html | Elasticsearch API documentation}
*/
async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest | TB.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesClearRepositoriesMeteringArchiveResponse>
@ -66,11 +67,18 @@ export default class Nodes {
const method = 'DELETE'
const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/_repositories_metering/${encodeURIComponent(params.max_archive_version.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'nodes.clear_repositories_metering_archive',
pathParts: {
node_id: params.node_id,
max_archive_version: params.max_archive_version
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns cluster repositories metering information.
* You can use the cluster repositories metering API to retrieve repositories metering information in a cluster. This API exposes monotonically non-decreasing counters and its expected that clients would durably store the information needed to compute aggregations over a period of time. Additionally, the information exposed by this API is volatile, meaning that it wont be present after node restarts.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-repositories-metering-api.html | Elasticsearch API documentation}
*/
async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest | TB.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesGetRepositoriesMeteringInfoResponse>
@ -92,11 +100,17 @@ export default class Nodes {
const method = 'GET'
const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/_repositories_metering`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'nodes.get_repositories_metering_info',
pathParts: {
node_id: params.node_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about hot threads on each node in the cluster.
* This API yields a breakdown of the hot threads on each selected node in the cluster. The output is plain text with a breakdown of each nodes top hot threads.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html | Elasticsearch API documentation}
*/
async hotThreads (this: That, params?: T.NodesHotThreadsRequest | TB.NodesHotThreadsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesHotThreadsResponse>
@ -126,11 +140,17 @@ export default class Nodes {
method = 'GET'
path = '/_nodes/hot_threads'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'nodes.hot_threads',
pathParts: {
node_id: params.node_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns information about nodes in the cluster.
* Returns cluster nodes information.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html | Elasticsearch API documentation}
*/
async info (this: That, params?: T.NodesInfoRequest | TB.NodesInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesInfoResponse>
@ -166,11 +186,18 @@ export default class Nodes {
method = 'GET'
path = '/_nodes'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'nodes.info',
pathParts: {
node_id: params.node_id,
metric: params.metric
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Reloads secure settings.
* Reloads the keystore on nodes in the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings | Elasticsearch API documentation}
*/
async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest | TB.NodesReloadSecureSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesReloadSecureSettingsResponse>
@ -212,11 +239,17 @@ export default class Nodes {
method = 'POST'
path = '/_nodes/reload_secure_settings'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'nodes.reload_secure_settings',
pathParts: {
node_id: params.node_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns statistical information about nodes in the cluster.
* Returns cluster nodes statistics.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html | Elasticsearch API documentation}
*/
async stats (this: That, params?: T.NodesStatsRequest | TB.NodesStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesStatsResponse>
@ -258,11 +291,19 @@ export default class Nodes {
method = 'GET'
path = '/_nodes/stats'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'nodes.stats',
pathParts: {
node_id: params.node_id,
metric: params.metric,
index_metric: params.index_metric
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns low-level information about REST actions usage on nodes.
* Returns information on the usage of features.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html | Elasticsearch API documentation}
*/
async usage (this: That, params?: T.NodesUsageRequest | TB.NodesUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesUsageResponse>
@ -298,6 +339,13 @@ export default class Nodes {
method = 'GET'
path = '/_nodes/usage'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'nodes.usage',
pathParts: {
node_id: params.node_id,
metric: params.metric
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Open a point in time that can be used in subsequent searches
* A search request by default executes against the most recent visible data of the target indices, which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the state of the data as it existed when initiated. In some cases, its preferred to perform multiple search requests using the same point in time. For example, if refreshes happen between `search_after` requests, then the results of those requests might not be consistent as changes happening between searches are only visible to the more recent point in time.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html | Elasticsearch API documentation}
*/
export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.OpenPointInTimeResponse>
@ -60,5 +61,11 @@ export default async function OpenPointInTimeApi (this: That, params: T.OpenPoin
const method = 'POST'
const path = `/${encodeURIComponent(params.index.toString())}/_pit`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'open_point_in_time',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -61,5 +62,8 @@ export default async function PingApi (this: That, params?: T.PingRequest | TB.P
const method = 'HEAD'
const path = '/'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ping'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

162
src/api/api/profiling.ts Normal file
View File

@ -0,0 +1,162 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/* eslint-disable import/export */
/* eslint-disable @typescript-eslint/no-misused-new */
/* eslint-disable @typescript-eslint/no-extraneous-class */
/* eslint-disable @typescript-eslint/no-unused-vars */
// This file was automatically generated by elastic/elastic-client-generator-js
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
// and elastic/elastic-client-generator-js to regenerate this file again.
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
TransportResult
} from '@elastic/transport'
import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
export default class Profiling {
transport: Transport
constructor (transport: Transport) {
this.transport = transport
}
/**
* Extracts a UI-optimized structure to render flamegraphs from Universal Profiling.
* @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation}
*/
async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'POST'
const path = '/_profiling/flamegraph'
const meta: TransportRequestMetadata = {
name: 'profiling.flamegraph'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Extracts raw stacktrace information from Universal Profiling.
* @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation}
*/
async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'POST'
const path = '/_profiling/stacktraces'
const meta: TransportRequestMetadata = {
name: 'profiling.stacktraces'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns basic information about the status of Universal Profiling.
* @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation}
*/
async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'GET'
const path = '/_profiling/status'
const meta: TransportRequestMetadata = {
name: 'profiling.status'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Extracts a list of topN functions from Universal Profiling.
* @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation}
*/
async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Creates or updates a script.
* Creates or updates a stored script or search template.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation}
*/
export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.PutScriptResponse>
@ -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)
}

295
src/api/api/query_rules.ts Normal file
View File

@ -0,0 +1,295 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/* eslint-disable import/export */
/* eslint-disable @typescript-eslint/no-misused-new */
/* eslint-disable @typescript-eslint/no-extraneous-class */
/* eslint-disable @typescript-eslint/no-unused-vars */
// This file was automatically generated by elastic/elastic-client-generator-js
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
// and elastic/elastic-client-generator-js to regenerate this file again.
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
TransportResult
} from '@elastic/transport'
import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
export default class QueryRules {
transport: Transport
constructor (transport: Transport) {
this.transport = transport
}
/**
* Deletes a query rule within a query ruleset.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-rule.html | Elasticsearch API documentation}
*/
async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesDeleteRuleResponse>
async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesDeleteRuleResponse, unknown>>
async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise<T.QueryRulesDeleteRuleResponse>
async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['ruleset_id', 'rule_id']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'DELETE'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}/_rule/${encodeURIComponent(params.rule_id.toString())}`
const meta: TransportRequestMetadata = {
name: 'query_rules.delete_rule',
pathParts: {
ruleset_id: params.ruleset_id,
rule_id: params.rule_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Deletes a query ruleset.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html | Elasticsearch API documentation}
*/
async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesDeleteRulesetResponse>
async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesDeleteRulesetResponse, unknown>>
async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptions): Promise<T.QueryRulesDeleteRulesetResponse>
async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['ruleset_id']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'DELETE'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
const meta: TransportRequestMetadata = {
name: 'query_rules.delete_ruleset',
pathParts: {
ruleset_id: params.ruleset_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns the details about a query rule within a query ruleset
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-rule.html | Elasticsearch API documentation}
*/
async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesGetRuleResponse>
async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesGetRuleResponse, unknown>>
async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise<T.QueryRulesGetRuleResponse>
async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['ruleset_id', 'rule_id']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'GET'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}/_rule/${encodeURIComponent(params.rule_id.toString())}`
const meta: TransportRequestMetadata = {
name: 'query_rules.get_rule',
pathParts: {
ruleset_id: params.ruleset_id,
rule_id: params.rule_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns the details about a query ruleset
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html | Elasticsearch API documentation}
*/
async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesGetRulesetResponse>
async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesGetRulesetResponse, unknown>>
async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptions): Promise<T.QueryRulesGetRulesetResponse>
async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['ruleset_id']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'GET'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
const meta: TransportRequestMetadata = {
name: 'query_rules.get_ruleset',
pathParts: {
ruleset_id: params.ruleset_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns summarized information about existing query rulesets.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html | Elasticsearch API documentation}
*/
async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesListRulesetsResponse>
async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesListRulesetsResponse, unknown>>
async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptions): Promise<T.QueryRulesListRulesetsResponse>
async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'GET'
const path = '/_query_rules'
const meta: TransportRequestMetadata = {
name: 'query_rules.list_rulesets'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Creates or updates a query rule within a query ruleset.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-rule.html | Elasticsearch API documentation}
*/
async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesPutRuleResponse>
async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesPutRuleResponse, unknown>>
async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptions): Promise<T.QueryRulesPutRuleResponse>
async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['ruleset_id', 'rule_id']
const acceptedBody: string[] = ['type', 'criteria', 'actions', 'priority']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}/_rule/${encodeURIComponent(params.rule_id.toString())}`
const meta: TransportRequestMetadata = {
name: 'query_rules.put_rule',
pathParts: {
ruleset_id: params.ruleset_id,
rule_id: params.rule_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Creates or updates a query ruleset.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html | Elasticsearch API documentation}
*/
async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesPutRulesetResponse>
async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesPutRulesetResponse, unknown>>
async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptions): Promise<T.QueryRulesPutRulesetResponse>
async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['ruleset_id']
const acceptedBody: string[] = ['rules']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
const meta: TransportRequestMetadata = {
name: 'query_rules.put_ruleset',
pathParts: {
ruleset_id: params.ruleset_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -1,162 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/* eslint-disable import/export */
/* eslint-disable @typescript-eslint/no-misused-new */
/* eslint-disable @typescript-eslint/no-extraneous-class */
/* eslint-disable @typescript-eslint/no-unused-vars */
// This file was automatically generated by elastic/elastic-client-generator-js
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
// and elastic/elastic-client-generator-js to regenerate this file again.
import {
Transport,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
TransportResult
} from '@elastic/transport'
import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
export default class QueryRuleset {
transport: Transport
constructor (transport: Transport) {
this.transport = transport
}
/**
* Deletes a query ruleset.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html | Elasticsearch API documentation}
*/
async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesetDeleteResponse>
async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesetDeleteResponse, unknown>>
async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptions): Promise<T.QueryRulesetDeleteResponse>
async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['ruleset_id']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'DELETE'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
}
/**
* Returns the details about a query ruleset.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html | Elasticsearch API documentation}
*/
async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesetGetResponse>
async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesetGetResponse, unknown>>
async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptions): Promise<T.QueryRulesetGetResponse>
async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['ruleset_id']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'GET'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
}
/**
* Lists query rulesets.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html | Elasticsearch API documentation}
*/
async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesetListResponse>
async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesetListResponse, unknown>>
async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptions): Promise<T.QueryRulesetListResponse>
async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'GET'
const path = '/_query_rules'
return await this.transport.request({ path, method, querystring, body }, options)
}
/**
* Creates or updates a query ruleset.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html | Elasticsearch API documentation}
*/
async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.QueryRulesetPutResponse>
async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.QueryRulesetPutResponse, unknown>>
async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptions): Promise<T.QueryRulesetPutResponse>
async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['ruleset_id']
const acceptedBody: string[] = ['rules']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Allows to evaluate the quality of ranked search results over a set of typical search queries
* Enables you to evaluate the quality of ranked search results over a set of typical search queries.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html | Elasticsearch API documentation}
*/
export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RankEvalResponse>
@ -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)
}

View File

@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Changes the number of requests per second for a particular Reindex operation.
* Copies documents from a source to a destination.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html | Elasticsearch API documentation}
*/
export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest | TB.ReindexRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ReindexRethrottleResponse>
@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Allows to use the Mustache language to pre-render a search definition.
* Renders a search template as a search request body.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/render-search-template-api.html | Elasticsearch API documentation}
*/
export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RenderSearchTemplateResponse>
@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -66,7 +67,13 @@ export default class Rollup {
const method = 'DELETE'
const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'rollup.delete_job',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -100,7 +107,13 @@ export default class Rollup {
method = 'GET'
path = '/_rollup/job'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'rollup.get_jobs',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -134,11 +147,17 @@ export default class Rollup {
method = 'GET'
path = '/_rollup/data'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'rollup.get_rollup_caps',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored).
* Returns the rollup capabilities of all jobs inside of a rollup index (for example, the index where rollup data is stored).
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-index-caps.html | Elasticsearch API documentation}
*/
async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupGetRollupIndexCapsResponse>
@ -160,7 +179,13 @@ export default class Rollup {
const method = 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_rollup/data`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'rollup.get_rollup_index_caps',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -198,11 +223,17 @@ export default class Rollup {
const method = 'PUT'
const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'rollup.put_job',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Enables searching rolled-up data using the standard query DSL.
* Enables searching rolled-up data using the standard Query DSL.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html | Elasticsearch API documentation}
*/
async rollupSearch<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupRollupSearchResponse<TDocument, TAggregations>>
@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Allows an arbitrary script to be executed and a result to be returned
* Runs a script and returns a result.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html | Elasticsearch API documentation}
*/
export default async function ScriptsPainlessExecuteApi<TResult = unknown> (this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ScriptsPainlessExecuteResponse<TResult>>
@ -73,5 +74,8 @@ export default async function ScriptsPainlessExecuteApi<TResult = unknown> (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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -72,5 +73,11 @@ export default async function ScrollApi<TDocument = unknown, TAggregations = Rec
const method = body != null ? 'POST' : 'GET'
const path = '/_search/scroll'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'scroll',
pathParts: {
scroll_id: params.scroll_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Returns results matching a query.
* Returns search hits that match the query defined in the request. You can provide search queries using the `q` query string parameter or the request body. If both are specified, only the query parameter is used.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html | Elasticsearch API documentation}
*/
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchResponse<TDocument, TAggregations>>
@ -86,5 +87,11 @@ export default async function SearchApi<TDocument = unknown, TAggregations = Rec
method = body != null ? 'POST' : 'GET'
path = '/_search'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -66,7 +67,13 @@ export default class SearchApplication {
const method = 'DELETE'
const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.delete',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -92,11 +99,17 @@ export default class SearchApplication {
const method = 'DELETE'
const path = `/_application/analytics/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.delete_behavioral_analytics',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns the details about a search application.
* Returns the details about a search application
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-search-application.html | Elasticsearch API documentation}
*/
async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationGetResponse>
@ -118,7 +131,13 @@ export default class SearchApplication {
const method = 'GET'
const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.get',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -152,7 +171,13 @@ export default class SearchApplication {
method = 'GET'
path = '/_application/analytics'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.get_behavioral_analytics',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -179,7 +204,10 @@ export default class SearchApplication {
const method = 'GET'
const path = '/_application/search_application'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.list'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -205,7 +233,14 @@ export default class SearchApplication {
const method = 'POST'
const path = `/_application/analytics/${encodeURIComponent(params.collection_name.toString())}/event/${encodeURIComponent(params.event_type.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.post_behavioral_analytics_event',
pathParts: {
collection_name: params.collection_name,
event_type: params.event_type
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -236,7 +271,13 @@ export default class SearchApplication {
const method = 'PUT'
const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.put',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -262,7 +303,13 @@ export default class SearchApplication {
const method = 'PUT'
const path = `/_application/analytics/${encodeURIComponent(params.name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.put_behavioral_analytics',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -288,11 +335,17 @@ export default class SearchApplication {
const method = 'POST'
const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}/_render_query`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.render_query',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Perform a search against a search application
* Perform a search against a search application.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-search.html | Elasticsearch API documentation}
*/
async search<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationSearchResponse<TDocument, TAggregations>>
@ -326,6 +379,12 @@ export default class SearchApplication {
const method = body != null ? 'POST' : 'GET'
const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}/_search`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_application.search',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -72,5 +73,15 @@ export default async function SearchMvtApi (this: That, params: T.SearchMvtReque
const method = body != null ? 'POST' : 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_mvt/${encodeURIComponent(params.field.toString())}/${encodeURIComponent(params.zoom.toString())}/${encodeURIComponent(params.x.toString())}/${encodeURIComponent(params.y.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_mvt',
pathParts: {
index: params.index,
field: params.field,
zoom: params.zoom,
x: params.x,
y: params.y
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -68,5 +69,11 @@ export default async function SearchShardsApi (this: That, params?: T.SearchShar
method = body != null ? 'POST' : 'GET'
path = '/_search_shards'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'search_shards',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Allows to use the Mustache language to pre-render a search definition.
* Runs a search with a search template.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html | Elasticsearch API documentation}
*/
export default async function SearchTemplateApi<TDocument = unknown> (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchTemplateResponse<TDocument>>
@ -80,5 +81,11 @@ export default async function SearchTemplateApi<TDocument = unknown> (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)
}

View File

@ -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)
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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)
}
}

85
src/api/api/simulate.ts Normal file
View File

@ -0,0 +1,85 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/* eslint-disable import/export */
/* eslint-disable @typescript-eslint/no-misused-new */
/* eslint-disable @typescript-eslint/no-extraneous-class */
/* eslint-disable @typescript-eslint/no-unused-vars */
// This file was automatically generated by elastic/elastic-client-generator-js
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
// and elastic/elastic-client-generator-js to regenerate this file again.
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
TransportResult
} from '@elastic/transport'
import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
export default class Simulate {
transport: Transport
constructor (transport: Transport) {
this.transport = transport
}
/**
* Simulates running ingest with example documents.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-ingest-api.html | Elasticsearch API documentation}
*/
async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const querystring: Record<string, any> = {}
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)
}
}

View File

@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class Snapshot {
}
/**
* Removes stale data from repository.
* Triggers the review of a snapshot repositorys contents and deletes any stale data not referenced by existing snapshots.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html | Elasticsearch API documentation}
*/
async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest | TB.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotCleanupRepositoryResponse>
@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -66,7 +67,13 @@ export default class Synonyms {
const method = 'DELETE'
const path = `/_synonyms/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'synonyms.delete_synonym',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -92,7 +99,14 @@ export default class Synonyms {
const method = 'DELETE'
const path = `/_synonyms/${encodeURIComponent(params.set_id.toString())}/${encodeURIComponent(params.rule_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'synonyms.delete_synonym_rule',
pathParts: {
set_id: params.set_id,
rule_id: params.rule_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -118,7 +132,13 @@ export default class Synonyms {
const method = 'GET'
const path = `/_synonyms/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'synonyms.get_synonym',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -144,7 +164,14 @@ export default class Synonyms {
const method = 'GET'
const path = `/_synonyms/${encodeURIComponent(params.set_id.toString())}/${encodeURIComponent(params.rule_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'synonyms.get_synonym_rule',
pathParts: {
set_id: params.set_id,
rule_id: params.rule_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -171,11 +198,14 @@ export default class Synonyms {
const method = 'GET'
const path = '/_synonyms'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'synonyms.get_synonyms_sets'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Creates or updates a synonyms set
* Creates or updates a synonym set.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonyms-set.html | Elasticsearch API documentation}
*/
async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SynonymsPutSynonymResponse>
@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -74,7 +75,13 @@ export default class Tasks {
method = 'POST'
path = '/_tasks/_cancel'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'tasks.cancel',
pathParts: {
task_id: params.task_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -100,11 +107,17 @@ export default class Tasks {
const method = 'GET'
const path = `/_tasks/${encodeURIComponent(params.task_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'tasks.get',
pathParts: {
task_id: params.task_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Returns a list of tasks.
* The task management API returns information about tasks currently executing on one or more nodes in the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html | Elasticsearch API documentation}
*/
async list (this: That, params?: T.TasksListRequest | TB.TasksListRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TasksListResponse>
@ -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)
}
}

View File

@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -79,5 +80,12 @@ export default async function TermvectorsApi<TDocument = unknown> (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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -43,6 +44,64 @@ export default class TextStructure {
this.transport = transport
}
/**
* Finds the structure of a text field in an index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/find-field-structure.html | Elasticsearch API documentation}
*/
async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'GET'
const path = '/_text_structure/find_field_structure'
const meta: TransportRequestMetadata = {
name: 'text_structure.find_field_structure'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/find-message-structure.html | Elasticsearch API documentation}
*/
async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = body != null ? 'POST' : 'GET'
const path = '/_text_structure/find_message_structure'
const meta: TransportRequestMetadata = {
name: 'text_structure.find_message_structure'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/find-structure.html | Elasticsearch API documentation}
@ -71,7 +130,10 @@ export default class TextStructure {
const method = 'POST'
const path = '/_text_structure/find_structure'
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
const meta: TransportRequestMetadata = {
name: 'text_structure.find_structure'
}
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
}
/**
@ -109,6 +171,9 @@ export default class TextStructure {
const method = body != null ? 'POST' : 'GET'
const path = '/_text_structure/test_grok_pattern'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'text_structure.test_grok_pattern'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class Transform {
}
/**
* Deletes an existing transform.
* Deletes a transform.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-transform.html | Elasticsearch API documentation}
*/
async deleteTransform (this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformDeleteTransformResponse>
@ -66,7 +67,42 @@ export default class Transform {
const method = 'DELETE'
const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.delete_transform',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Retrieves transform usage information for transform nodes.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform-node-stats.html | Elasticsearch API documentation}
*/
async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'GET'
const path = '/_transform/_node_stats'
const meta: TransportRequestMetadata = {
name: 'transform.get_node_stats'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -100,7 +136,13 @@ export default class Transform {
method = 'GET'
path = '/_transform'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.get_transform',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -126,11 +168,17 @@ export default class Transform {
const method = 'GET'
const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_stats`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.get_transform_stats',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Previews a transform.
* Previews a transform. It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/preview-transform.html | Elasticsearch API documentation}
*/
async previewTransform<TTransform = unknown> (this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformPreviewTransformResponse<TTransform>>
@ -172,11 +220,17 @@ export default class Transform {
method = body != null ? 'POST' : 'GET'
path = '/_transform/_preview'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.preview_transform',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Instantiates a transform.
* Creates a transform. A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a unique row per entity. You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values in the latest object. You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and `view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations. NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any `.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not give users any privileges on `.data-frame-internal*` indices.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-transform.html | Elasticsearch API documentation}
*/
async putTransform (this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformPutTransformResponse>
@ -210,11 +264,17 @@ export default class Transform {
const method = 'PUT'
const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.put_transform',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Resets an existing transform.
* Resets a transform. Before you can reset it, you must stop it; alternatively, use the `force` query parameter. If the destination index was created by the transform, it is deleted.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/reset-transform.html | Elasticsearch API documentation}
*/
async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformResetTransformResponse>
@ -236,11 +296,17 @@ export default class Transform {
const method = 'POST'
const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_reset`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.reset_transform',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Schedules now a transform.
* Schedules now a transform. If you _schedule_now a transform, it will process the new data instantly, without waiting for the configured frequency interval. After _schedule_now API is called, the transform will be processed again at now + frequency unless _schedule_now API is called again in the meantime.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/schedule-now-transform.html | Elasticsearch API documentation}
*/
async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformScheduleNowTransformResponse>
@ -262,11 +328,17 @@ export default class Transform {
const method = 'POST'
const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_schedule_now`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.schedule_now_transform',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Starts one or more transforms.
* Starts a transform. When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping definitions for the destination index from the source indices and the transform aggregations. If fields in the destination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations), the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings in a pivot transform. When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you created the transform, they occur when you start the transform—with the exception of privilege checks. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-transform.html | Elasticsearch API documentation}
*/
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformStartTransformResponse>
@ -288,7 +360,13 @@ export default class Transform {
const method = 'POST'
const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_start`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.start_transform',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -314,11 +392,17 @@ export default class Transform {
const method = 'POST'
const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_stop`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.stop_transform',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Updates certain properties of a transform.
* Updates certain properties of a transform. All updated properties except `description` do not take effect until after the transform starts the next checkpoint, thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata` privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the time of update and runs with those privileges.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-transform.html | Elasticsearch API documentation}
*/
async updateTransform (this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformUpdateTransformResponse>
@ -352,11 +436,17 @@ export default class Transform {
const method = 'POST'
const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_update`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.update_transform',
pathParts: {
transform_id: params.transform_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Upgrades all transforms.
* Upgrades all transforms. This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not affect the source and destination indices. The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/upgrade-transforms.html | Elasticsearch API documentation}
*/
async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformUpgradeTransformsResponse>
@ -379,6 +469,9 @@ export default class Transform {
const method = 'POST'
const path = '/_transform/_upgrade'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.upgrade_transforms'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -72,5 +73,12 @@ export default async function UpdateApi<TDocument = unknown, TPartialDocument =
const method = 'POST'
const path = `/${encodeURIComponent(params.index.toString())}/_update/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'update',
pathParts: {
id: params.id,
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
/**
* Updates documents that match the specified query. If no query is specified, performs an update on every document in the index without changing the source, for example to pick up a mapping change.
* Updates documents that match the specified query. If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html | Elasticsearch API documentation}
*/
export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest | TB.UpdateByQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.UpdateByQueryResponse>
@ -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)
}

View File

@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -73,7 +74,14 @@ export default class Watcher {
method = 'PUT'
path = `/_watcher/watch/${encodeURIComponent(params.watch_id.toString())}/_ack`
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'watcher.ack_watch',
pathParts: {
watch_id: params.watch_id,
action_id: params.action_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -99,7 +107,13 @@ export default class Watcher {
const method = 'PUT'
const path = `/_watcher/watch/${encodeURIComponent(params.watch_id.toString())}/_activate`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'watcher.activate_watch',
pathParts: {
watch_id: params.watch_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -125,7 +139,13 @@ export default class Watcher {
const method = 'PUT'
const path = `/_watcher/watch/${encodeURIComponent(params.watch_id.toString())}/_deactivate`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'watcher.deactivate_watch',
pathParts: {
watch_id: params.watch_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -151,11 +171,17 @@ export default class Watcher {
const method = 'DELETE'
const path = `/_watcher/watch/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'watcher.delete_watch',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Forces the execution of a stored watch.
* This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes. For testing and debugging purposes, you also have fine-grained control on how the watch runs. You can execute the watch without executing all of its actions or alternatively by simulating them. You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after execution.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-execute-watch.html | Elasticsearch API documentation}
*/
async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest | TB.WatcherExecuteWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherExecuteWatchResponse>
@ -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)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -44,7 +45,7 @@ export default class Xpack {
}
/**
* Retrieves information about the installed X-Pack features.
* Provides general information about the installed X-Pack features.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/info-api.html | Elasticsearch API documentation}
*/
async info (this: That, params?: T.XpackInfoRequest | TB.XpackInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.XpackInfoResponse>
@ -67,11 +68,14 @@ export default class Xpack {
const method = 'GET'
const path = '/_xpack'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'xpack.info'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Retrieves usage information about the installed X-Pack features.
* This API provides information about which features are currently enabled and available under the current license and some usage statistics.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/usage-api.html | Elasticsearch API documentation}
*/
async usage (this: That, params?: T.XpackUsageRequest | TB.XpackUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.XpackUsageResponse>
@ -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)
}
}

View File

@ -29,6 +29,7 @@
import AsyncSearchApi from './api/async_search'
import AutoscalingApi from './api/autoscaling'
import bulkApi from './api/bulk'
import capabilitiesApi from './api/capabilities'
import CatApi from './api/cat'
import CcrApi from './api/ccr'
import clearScrollApi from './api/clear_scroll'
@ -76,8 +77,9 @@ import mtermvectorsApi from './api/mtermvectors'
import NodesApi from './api/nodes'
import openPointInTimeApi from './api/open_point_in_time'
import pingApi from './api/ping'
import ProfilingApi from './api/profiling'
import putScriptApi from './api/put_script'
import QueryRulesetApi from './api/query_ruleset'
import QueryRulesApi from './api/query_rules'
import rankEvalApi from './api/rank_eval'
import reindexApi from './api/reindex'
import reindexRethrottleApi from './api/reindex_rethrottle'
@ -93,6 +95,7 @@ import searchTemplateApi from './api/search_template'
import SearchableSnapshotsApi from './api/searchable_snapshots'
import SecurityApi from './api/security'
import ShutdownApi from './api/shutdown'
import SimulateApi from './api/simulate'
import SlmApi from './api/slm'
import SnapshotApi from './api/snapshot'
import SqlApi from './api/sql'
@ -114,6 +117,7 @@ export default interface API {
asyncSearch: AsyncSearchApi
autoscaling: AutoscalingApi
bulk: typeof bulkApi
capabilities: typeof capabilitiesApi
cat: CatApi
ccr: CcrApi
clearScroll: typeof clearScrollApi
@ -161,8 +165,9 @@ export default interface API {
nodes: NodesApi
openPointInTime: typeof openPointInTimeApi
ping: typeof pingApi
profiling: ProfilingApi
putScript: typeof putScriptApi
queryRuleset: QueryRulesetApi
queryRules: QueryRulesApi
rankEval: typeof rankEvalApi
reindex: typeof reindexApi
reindexRethrottle: typeof reindexRethrottleApi
@ -178,6 +183,7 @@ export default interface API {
searchableSnapshots: SearchableSnapshotsApi
security: SecurityApi
shutdown: ShutdownApi
simulate: SimulateApi
slm: SlmApi
snapshot: SnapshotApi
sql: SqlApi
@ -217,12 +223,14 @@ const kMigration = Symbol('Migration')
const kMl = Symbol('Ml')
const kMonitoring = Symbol('Monitoring')
const kNodes = Symbol('Nodes')
const kQueryRuleset = Symbol('QueryRuleset')
const kProfiling = Symbol('Profiling')
const kQueryRules = Symbol('QueryRules')
const kRollup = Symbol('Rollup')
const kSearchApplication = Symbol('SearchApplication')
const kSearchableSnapshots = Symbol('SearchableSnapshots')
const kSecurity = Symbol('Security')
const kShutdown = Symbol('Shutdown')
const kSimulate = Symbol('Simulate')
const kSlm = Symbol('Slm')
const kSnapshot = Symbol('Snapshot')
const kSql = Symbol('Sql')
@ -257,12 +265,14 @@ export default class API {
[kMl]: symbol | null
[kMonitoring]: symbol | null
[kNodes]: symbol | null
[kQueryRuleset]: symbol | null
[kProfiling]: symbol | null
[kQueryRules]: symbol | null
[kRollup]: symbol | null
[kSearchApplication]: symbol | null
[kSearchableSnapshots]: symbol | null
[kSecurity]: symbol | null
[kShutdown]: symbol | null
[kSimulate]: symbol | null
[kSlm]: symbol | null
[kSnapshot]: symbol | null
[kSql]: symbol | null
@ -296,12 +306,14 @@ export default class API {
this[kMl] = null
this[kMonitoring] = null
this[kNodes] = null
this[kQueryRuleset] = null
this[kProfiling] = null
this[kQueryRules] = null
this[kRollup] = null
this[kSearchApplication] = null
this[kSearchableSnapshots] = null
this[kSecurity] = null
this[kShutdown] = null
this[kSimulate] = null
this[kSlm] = null
this[kSnapshot] = null
this[kSql] = null
@ -316,6 +328,7 @@ export default class API {
}
API.prototype.bulk = bulkApi
API.prototype.capabilities = capabilitiesApi
API.prototype.clearScroll = clearScrollApi
API.prototype.closePointInTime = closePointInTimeApi
API.prototype.count = countApi
@ -427,8 +440,11 @@ Object.defineProperties(API.prototype, {
nodes: {
get () { return this[kNodes] === null ? (this[kNodes] = new NodesApi(this.transport)) : this[kNodes] }
},
queryRuleset: {
get () { return this[kQueryRuleset] === null ? (this[kQueryRuleset] = new QueryRulesetApi(this.transport)) : this[kQueryRuleset] }
profiling: {
get () { return this[kProfiling] === null ? (this[kProfiling] = new ProfilingApi(this.transport)) : this[kProfiling] }
},
queryRules: {
get () { return this[kQueryRules] === null ? (this[kQueryRules] = new QueryRulesApi(this.transport)) : this[kQueryRules] }
},
rollup: {
get () { return this[kRollup] === null ? (this[kRollup] = new RollupApi(this.transport)) : this[kRollup] }
@ -445,6 +461,9 @@ Object.defineProperties(API.prototype, {
shutdown: {
get () { return this[kShutdown] === null ? (this[kShutdown] = new ShutdownApi(this.transport)) : this[kShutdown] }
},
simulate: {
get () { return this[kSimulate] === null ? (this[kSimulate] = new SimulateApi(this.transport)) : this[kSimulate] }
},
slm: {
get () { return this[kSlm] === null ? (this[kSlm] = new SlmApi(this.transport)) : this[kSlm] }
},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff