Compare commits

...

26 Commits

Author SHA1 Message Date
2471b0f2fb Prep 8.14.1 (#2331) 2024-08-12 13:06:39 -05:00
f18944f268 Auto-generated code for 8.14 (#2327) 2024-08-12 10:36:42 -05:00
5d9fd3f418 Auto-generated code for 8.14 (#2321) 2024-08-06 11:29:15 -05:00
dc706d09f2 Auto-generated code for 8.14 (#2314) 2024-07-22 11:18:00 -05:00
0af25c95e1 Auto-generated code for 8.14 (#2310) 2024-07-09 16:55:38 -05:00
0b504428f1 Auto-generated code for 8.14 (#2307) 2024-07-08 13:32:23 -05:00
6dc5131622 Auto-generated code for 8.14 (#2282) 2024-06-07 10:52:21 -05:00
5b78ce58a0 [Backport 8.14] Update changelog for 8.14.0 (#2280)
(cherry picked from commit 2b0eebc8fa)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-06-06 14:25:20 -05:00
41c8687d56 [Backport 8.14] Bump transport to 8.6.0 (#2278)
(cherry picked from commit f97ba5b02a)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-06-06 13:45:37 -05:00
918bca8152 Auto-generated code for 8.14 (#2276) 2024-06-06 12:13:04 -05:00
ead583ac05 [Backport 8.14] Fix typo in documentation (example query) (#2273)
(cherry picked from commit 542585a5dc)

Co-authored-by: Joey Freund <joeyfreund@users.noreply.github.com>
2024-06-06 12:07:18 -05:00
28df544a70 Auto-generated code for 8.14 (#2264) 2024-06-03 13:32:21 -05:00
e031782e70 Auto-generated code for 8.14 (#2260) 2024-05-23 10:35:04 -05:00
eab828be4f Auto-generated code for 8.14 (#2257) 2024-05-20 11:44:26 -05:00
24a471cf7a Auto-generated code for 8.14 (#2253) 2024-05-09 14:43:41 -05:00
aeda5cc9c7 [Backport 8.14] Add Node.js 22 to unit test matrix (#2252)
(cherry picked from commit fe2d8c1915)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-05-06 15:23:28 -05:00
457b5523a7 [Backport 8.14] Add ES|QL helper note to changelog (#2250)
(cherry picked from commit b9ea8f8906)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-05-06 15:01:25 -05:00
6eae81d292 [Backport 8.14] ES|QL: Object API helper (#2248)
* ESQL toRecord helper

* ESQL helper tests

* Add ESQL object API helper to client meta header

* Add docstring for toRecords

* Include column metadata in toRecords helper

* Add docs for ESQL toRecords helper

* Verify columns in helper return object

(cherry picked from commit 896216860f)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-05-06 14:30:51 -05:00
462016a89f Auto-generated code for 8.14 (#2240) 2024-05-06 09:54:20 -05:00
b544bd56ad [Backport 8.14] Update asStream code example (#2244)
https://github.com/elastic/elasticsearch-js/issues/2241 notes that there
is no body attribute on a response. This is mostly just a typo in the
example, as `result` itself is a readable stream, unless `meta: true` is
passed, in which case `result.body` will be a readable stream.

Also dropped the callback-style stream processing example as it's a bit
outdated.

(cherry picked from commit 45e3c0657a)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-04-30 13:59:54 -05:00
07e8d4eec7 [Backport 8.14] Move make.sh to .github (#2237)
(cherry picked from commit b65e468b95)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-04-24 08:47:42 -05:00
3e74c3efc4 [Backport 8.14] Add Date to DateMath type (#2232)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
(cherry picked from commit 768ba3d8ae)

Co-authored-by: Rami <72725910+ramikg@users.noreply.github.com>
2024-04-18 14:32:36 -05:00
8d92539292 [Backport 8.14] docs: fix typo in basic-config.asciidoc (#2228)
LENTGH -> LENGTH

(cherry picked from commit 6f2aaa5c7c)

Co-authored-by: Alexa Nguyen <github@alexanguyen.com>
2024-04-17 13:00:01 -05:00
9eaf6bf218 [Backport 8.14] Backport changelogs from other minor releases (#2219)
(cherry picked from commit b857d8ee71)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-04-09 15:15:47 -05:00
196bcf5091 [Backport 8.14] onSuccess function for bulk helper (#2204)
* Bulk helper onSuccess callback

For https://github.com/elastic/elasticsearch-js/issues/2090

Includes refactor of the tryBulk result processing code, to make
iterating over bulk response data easier to understand.

* Add onSuccess tests for each datasource type

* Cleanup, additional comments

* Add documentation for onSuccess callback

* Update changelog

* Drop link to 8.14 release notes.

Page not yet published, breaking docs build.

(cherry picked from commit 4aa00e03e1)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-04-02 19:56:23 +00:00
6900bfe990 [Backport 8.14] Upgrade transport to 8.5.0 (#2203)
(cherry picked from commit e2974b0747)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-04-02 14:33:28 -05:00
101 changed files with 8482 additions and 1445 deletions

View File

@ -15,6 +15,7 @@ steps:
nodejs:
- "18"
- "20"
- "22"
command: ./.buildkite/run-tests.sh
artifact_paths: "./junit-output/junit-*.xml"
- wait: ~
@ -26,6 +27,6 @@ steps:
plugins:
- junit-annotate#v2.4.1:
artifacts: "junit-output/junit-*.xml"
job-uuid-file-pattern: 'junit-(.*).xml'
job-uuid-file-pattern: "junit-(.*).xml"
fail-build-on-error: true
failure-format: file

View File

@ -3,7 +3,7 @@
#
# Build entry script for elasticsearch-js
#
# Must be called: ./.buildkite/make.sh <target> <params>
# Must be called: ./.github/make.sh <target> <params>
#
# Version: 1.1.0
#

View File

@ -9,7 +9,7 @@ jobs:
name: Detect files changed
runs-on: ubuntu-latest
outputs:
src-only: '${{ steps.changes.outputs.src-only }}'
src-only: "${{ steps.changes.outputs.src-only }}"
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter/@v2.11.1
@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
@ -66,7 +66,7 @@ jobs:
strategy:
matrix:
node-version: [20.x]
node-version: [22.x]
steps:
- uses: actions/checkout@v3

View File

@ -260,11 +260,11 @@ _Default:_ `false`
_Default:_ `null`
|`maxResponseSize`
|`number` - When configured, it verifies that the uncompressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_STRING_LENTGH +
|`number` - When configured, it verifies that the uncompressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_STRING_LENGTH +
_Default:_ `null`
|`maxCompressedResponseSize`
|`number` - When configured, it verifies that the compressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_LENTGH +
|`number` - When configured, it verifies that the compressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_LENGTH +
_Default:_ `null`
|===

View File

@ -1,6 +1,59 @@
[[changelog-client]]
== Release notes
[discrete]
=== 8.14.1
[discrete]
==== Features
[discrete]
===== Improved support for Elasticsearch `8.14`
Updated types based on fixes and changes to the Elasticsearch specification.
[discrete]
=== 8.14.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v8.14.0`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.14/release-notes-8.14.0.html[here].
[discrete]
===== ES|QL object API helper
A helper method has been added that parses the response of an ES|QL query and converts it into an array of objects.
A TypeScript type parameter can also be provided to improve developer experience when working with the result. https://github.com/elastic/elasticsearch-js/pull/2238[#2238]
[discrete]
===== `onSuccess` callback added to bulk helper
The bulk helper now supports an `onSuccess` callback that will be called for each successful operation. https://github.com/elastic/elasticsearch-js/pull/2199[#2199]
[discrete]
===== Request retries are more polite
https://github.com/elastic/elastic-transport-js/releases/tag/v8.6.0[`@elastic/transport` v8.6.0] was released, which refactored when and how failed requests are retried. Timed-out requests are no longer retried by default, and retries now use exponential backoff rather than running immediately.
[discrete]
=== 8.13.1
[discrete]
==== Fixes
[discrete]
===== Pin @elastic/transport to `~8.4.1`
Switching from `^8.4.1` to `~8.4.1` ensures 8.13 client users are not required to update to Node.js v18+, which is a new requirement set by `@elastic/transport` v8.5.0. See https://github.com/elastic/elastic-transport-js/issues/91[elastic/elastic-transport-js#91] for details.
v8.13.0 was also released depending on v8.4.0 of `@elastic/transport` instead of v8.4.1, which was unintentional.
[discrete]
=== 8.13.0
@ -21,6 +74,17 @@ https://www.elastic.co/guide/en/elasticsearch/reference/8.13/release-notes-8.13.
When instantiating a client, any connection-related defaults (e.g. `requestTimeout`) set on that client instance would not be inherited by nodes if they were entered as strings rather than a `ConnectionOptions` object.
[discrete]
=== 8.12.3
[discrete]
==== Fixes
[discrete]
===== Bump @elastic/transport to `~8.4.1`
Switching from `^8.4.1` to `~8.4.1` ensures 8.12 client users are not required to update to Node.js v18+, which is a new requirement set by `@elastic/transport` v8.5.0. See https://github.com/elastic/elastic-transport-js/issues/91[elastic/elastic-transport-js#91] for details.
[discrete]
=== 8.12.2
@ -47,7 +111,7 @@ The failing state could be reached when a server's response times are slower tha
=== 8.12.0
[discrete]
==== Features
=== Features
[discrete]
===== Support for Elasticsearch `v8.12.0`
@ -55,6 +119,17 @@ The failing state could be reached when a server's response times are slower tha
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/release-notes-8.12.0.html[here].
[discrete]
=== 8.11.1
[discrete]
==== Fixes
[discrete]
===== Bump @elastic/transport to `~8.4.0`
Switching from `^8.4.0` to `~8.4.0` ensures 8.11 client users are not required to update to Node.js v18+, which is a new requirement set by `@elastic/transport` v8.5.0. See https://github.com/elastic/elastic-transport-js/issues/91[elastic/elastic-transport-js#91] for details.
[discrete]
=== 8.11.0
@ -74,6 +149,17 @@ https://www.elastic.co/guide/en/elasticsearch/reference/8.11/release-notes-8.11.
See <<redaction>> for more information.
[discrete]
=== 8.10.1
[discrete]
==== Fixes
[discrete]
===== Bump @elastic/transport to `~8.3.4`
Switching from `^8.3.4` to `~8.3.4` ensures 8.10 client users are not required to update to Node.js v18+, which is a new requirement set by `@elastic/transport` v8.5.0. See https://github.com/elastic/elastic-transport-js/issues/91[elastic/elastic-transport-js#91] for details.
[discrete]
=== 8.10.0
@ -86,6 +172,17 @@ See <<redaction>> for more information.
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.10/release-notes-8.10.0.html[here].
[discrete]
=== 8.9.2
[discrete]
==== Fixes
[discrete]
===== Bump @elastic/transport to `~8.3.4`
Switching from `^8.3.4` to `~8.3.4` ensures 8.9 client users are not required to update to Node.js v18+, which is a new requirement set by `@elastic/transport` v8.5.0. See https://github.com/elastic/elastic-transport-js/issues/91[elastic/elastic-transport-js#91] for details.
[discrete]
=== 8.9.1
@ -122,6 +219,17 @@ In the https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/curre
The `user-agent` header the client used to connect to Elasticsearch was using a non-standard format that has been improved.
[discrete]
=== 8.8.2
[discrete]
==== Fixes
[discrete]
===== Bump @elastic/transport to `~8.3.2`
Switching from `^8.3.2` to `~8.3.2` ensures 8.8 client users are not required to update to Node.js v18+, which is a new requirement set by `@elastic/transport` v8.5.0. See https://github.com/elastic/elastic-transport-js/issues/91[elastic/elastic-transport-js#91] for details.
[discrete]
=== 8.8.1
@ -167,6 +275,17 @@ https://www.elastic.co/guide/en/elasticsearch/reference/8.8/release-notes-8.8.0.
Prior releases contained a bug where type declarations for legacy types that include a `body` key were not actually importing the type that includes the `body` key.
[discrete]
=== 8.7.3
[discrete]
==== Fixes
[discrete]
===== Bump @elastic/transport to `~8.3.1`
Switching from `^8.3.1` to `~8.3.1` ensures 8.7 client users are not required to update to Node.js v18+, which is a new requirement set by `@elastic/transport` v8.5.0. See https://github.com/elastic/elastic-transport-js/issues/91[elastic/elastic-transport-js#91] for details.
[discrete]
=== 8.7.0
@ -176,6 +295,17 @@ Prior releases contained a bug where type declarations for legacy types that inc
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.7/release-notes-8.7.0.html[here].
[discrete]
=== 8.6.1
[discrete]
==== Fixes
[discrete]
===== Bump @elastic/transport to `~8.3.1`
Switching from `^8.3.1` to `~8.3.1` ensures 8.6 client users are not required to update to Node.js v18+, which is a new requirement set by `@elastic/transport` v8.5.0. See https://github.com/elastic/elastic-transport-js/issues/91[elastic/elastic-transport-js#91] for details.
[discrete]
=== 8.6.0

View File

@ -57,22 +57,12 @@ async function run () {
asStream: true
})
// stream async iteration, available in Node.js ≥ 10
let payload = ''
body.setEncoding('utf8')
result.setEncoding('utf8')
for await (const chunk of result) {
payload += chunk
}
console.log(JSON.parse(payload))
// classic stream callback style
let payload = ''
result.setEncoding('utf8')
result.on('data', chunk => { payload += chunk })
result.on('error', console.log)
result.on('end', () => {
console.log(JSON.parse(payload))
})
}
run().catch(console.log)

View File

@ -55,7 +55,7 @@ async function run () {
source: {
index: 'game-of-thrones',
query: {
match: { character: 'stark' }
match: { house: 'stark' }
}
},
dest: {

View File

@ -98,6 +98,17 @@ const b = client.helpers.bulk({
})
----
|`onSuccess`
a|A function that is called for each successful operation in the bulk request, which includes the result from Elasticsearch along with the original document that was sent, or `null` for delete operations.
[source,js]
----
const b = client.helpers.bulk({
onSuccess ({ result, document }) {
console.log(`SUCCESS: Document ${result.index._id} indexed to ${result.index._index}`)
}
})
----
|`flushBytes`
a|The size of the bulk body in bytes to reach before to send it. Default of 5MB. +
_Default:_ `5000000`
@ -602,3 +613,97 @@ for await (const doc of scrollSearch) {
console.log(doc)
}
----
[discrete]
[[esql-helper]]
=== ES|QL helper
ES|QL queries can return their results in {ref}/esql-rest.html#esql-rest-format[several formats].
The default JSON format returned by ES|QL queries contains arrays of values
for each row, with column names and types returned separately:
[discrete]
==== Usage
[discrete]
===== `toRecords`
~Added~ ~in~ ~`v8.14.0`~
The default JSON format returned by ES|QL queries contains arrays of values
for each row, with column names and types returned separately:
[source,json]
----
{
"columns": [
{ "name": "@timestamp", "type": "date" },
{ "name": "client_ip", "type": "ip" },
{ "name": "event_duration", "type": "long" },
{ "name": "message", "type": "keyword" }
],
"values": [
[
"2023-10-23T12:15:03.360Z",
"172.21.2.162",
3450233,
"Connected to 10.1.0.3"
],
[
"2023-10-23T12:27:28.948Z",
"172.21.2.113",
2764889,
"Connected to 10.1.0.2"
]
]
}
----
In many cases, it's preferable to operate on an array of objects, one object per row,
rather than an array of arrays. The ES|QL `toRecords` helper converts row data into objects.
[source,js]
----
await client.helpers
.esql({ query: 'FROM sample_data | LIMIT 2' })
.toRecords()
// =>
// {
// "columns": [
// { "name": "@timestamp", "type": "date" },
// { "name": "client_ip", "type": "ip" },
// { "name": "event_duration", "type": "long" },
// { "name": "message", "type": "keyword" }
// ],
// "records": [
// {
// "@timestamp": "2023-10-23T12:15:03.360Z",
// "client_ip": "172.21.2.162",
// "event_duration": 3450233,
// "message": "Connected to 10.1.0.3"
// },
// {
// "@timestamp": "2023-10-23T12:27:28.948Z",
// "client_ip": "172.21.2.113",
// "event_duration": 2764889,
// "message": "Connected to 10.1.0.2"
// },
// ]
// }
----
In TypeScript, you can declare the type that `toRecords` returns:
[source,ts]
----
type EventLog = {
'@timestamp': string,
client_ip: string,
event_duration: number,
message: string,
}
const result = await client.helpers
.esql({ query: 'FROM sample_data | LIMIT 2' })
.toRecords<EventLog>()
----

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "@elastic/elasticsearch",
"version": "8.14.0",
"versionCanary": "8.14.0-canary.0",
"version": "8.14.1",
"versionCanary": "8.14.1-canary.0",
"description": "The official Elasticsearch client for Node.js",
"main": "index.js",
"types": "index.d.ts",
@ -83,7 +83,7 @@
"zx": "^7.2.2"
},
"dependencies": {
"@elastic/transport": "^8.4.1",
"@elastic/transport": "^8.6.0",
"tslib": "^2.4.0"
},
"tap": {

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -45,7 +46,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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/async-search.html | Elasticsearch API documentation}
*/
async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchDeleteResponse>
async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchDeleteResponse, unknown>>
@ -66,12 +67,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchGetResponse<TDocument, TAggregations>, unknown>>
@ -92,12 +99,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/async-search.html | Elasticsearch API documentation}
*/
async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchStatusResponse>
async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchStatusResponse, unknown>>
@ -118,12 +131,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchSubmitResponse<TDocument, TAggregations>, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Autoscaling {
/**
* Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-delete-autoscaling-policy.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/autoscaling-delete-autoscaling-policy.html | Elasticsearch API documentation}
*/
async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest | TB.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AutoscalingDeleteAutoscalingPolicyResponse>
async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest | TB.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AutoscalingDeleteAutoscalingPolicyResponse, unknown>>
@ -66,12 +67,18 @@ 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)
}
/**
* Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation}
*/
async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest | TB.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AutoscalingGetAutoscalingCapacityResponse>
async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest | TB.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AutoscalingGetAutoscalingCapacityResponse, unknown>>
@ -93,12 +100,15 @@ 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)
}
/**
* Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation}
*/
async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest | TB.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AutoscalingGetAutoscalingPolicyResponse>
async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest | TB.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AutoscalingGetAutoscalingPolicyResponse, unknown>>
@ -119,12 +129,18 @@ 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)
}
/**
* Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-put-autoscaling-policy.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/autoscaling-put-autoscaling-policy.html | Elasticsearch API documentation}
*/
async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest | TB.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AutoscalingPutAutoscalingPolicyResponse>
async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest | TB.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AutoscalingPutAutoscalingPolicyResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows to perform multiple index/update/delete operations in a single request.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>
export default async function BulkApi<TDocument = unknown, TPartialDocument = unknown> (this: That, params: T.BulkRequest<TDocument, TPartialDocument> | TB.BulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.BulkResponse, unknown>>
@ -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

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -45,7 +46,7 @@ export default class Cat {
/**
* Shows information about currently configured aliases to indices including filter and routing infos.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-alias.html | Elasticsearch API documentation}
*/
async aliases (this: That, params?: T.CatAliasesRequest | TB.CatAliasesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatAliasesResponse>
async aliases (this: That, params?: T.CatAliasesRequest | TB.CatAliasesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatAliasesResponse, unknown>>
@ -74,12 +75,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-allocation.html | Elasticsearch API documentation}
*/
async allocation (this: That, params?: T.CatAllocationRequest | TB.CatAllocationRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatAllocationResponse>
async allocation (this: That, params?: T.CatAllocationRequest | TB.CatAllocationRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatAllocationResponse, unknown>>
@ -108,12 +115,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-component-templates.html | Elasticsearch API documentation}
*/
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatComponentTemplatesResponse>
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatComponentTemplatesResponse, unknown>>
@ -142,12 +155,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-count.html | Elasticsearch API documentation}
*/
async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatCountResponse>
async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatCountResponse, unknown>>
@ -176,12 +195,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-fielddata.html | Elasticsearch API documentation}
*/
async fielddata (this: That, params?: T.CatFielddataRequest | TB.CatFielddataRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatFielddataResponse>
async fielddata (this: That, params?: T.CatFielddataRequest | TB.CatFielddataRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatFielddataResponse, unknown>>
@ -210,12 +235,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-health.html | Elasticsearch API documentation}
*/
async health (this: That, params?: T.CatHealthRequest | TB.CatHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatHealthResponse>
async health (this: That, params?: T.CatHealthRequest | TB.CatHealthRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatHealthResponse, unknown>>
@ -237,12 +268,15 @@ 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)
}
/**
* Returns help for the Cat APIs.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat.html | Elasticsearch API documentation}
*/
async help (this: That, params?: T.CatHelpRequest | TB.CatHelpRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatHelpResponse>
async help (this: That, params?: T.CatHelpRequest | TB.CatHelpRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatHelpResponse, unknown>>
@ -264,12 +298,15 @@ 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, ...
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-indices.html | Elasticsearch API documentation}
*/
async indices (this: That, params?: T.CatIndicesRequest | TB.CatIndicesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatIndicesResponse>
async indices (this: That, params?: T.CatIndicesRequest | TB.CatIndicesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatIndicesResponse, unknown>>
@ -298,12 +335,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-master.html | Elasticsearch API documentation}
*/
async master (this: That, params?: T.CatMasterRequest | TB.CatMasterRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMasterResponse>
async master (this: That, params?: T.CatMasterRequest | TB.CatMasterRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMasterResponse, unknown>>
@ -325,12 +368,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-dfanalytics.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-dfanalytics.html | Elasticsearch API documentation}
*/
async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest | TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMlDataFrameAnalyticsResponse>
async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest | TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMlDataFrameAnalyticsResponse, unknown>>
@ -359,12 +405,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-datafeeds.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-datafeeds.html | Elasticsearch API documentation}
*/
async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest | TB.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMlDatafeedsResponse>
async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest | TB.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMlDatafeedsResponse, unknown>>
@ -393,12 +445,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-anomaly-detectors.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-anomaly-detectors.html | Elasticsearch API documentation}
*/
async mlJobs (this: That, params?: T.CatMlJobsRequest | TB.CatMlJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMlJobsResponse>
async mlJobs (this: That, params?: T.CatMlJobsRequest | TB.CatMlJobsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMlJobsResponse, unknown>>
@ -427,12 +485,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-trained-model.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-trained-model.html | Elasticsearch API documentation}
*/
async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest | TB.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatMlTrainedModelsResponse>
async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest | TB.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMlTrainedModelsResponse, unknown>>
@ -461,12 +525,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-nodeattrs.html | Elasticsearch API documentation}
*/
async nodeattrs (this: That, params?: T.CatNodeattrsRequest | TB.CatNodeattrsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatNodeattrsResponse>
async nodeattrs (this: That, params?: T.CatNodeattrsRequest | TB.CatNodeattrsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatNodeattrsResponse, unknown>>
@ -488,12 +558,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-nodes.html | Elasticsearch API documentation}
*/
async nodes (this: That, params?: T.CatNodesRequest | TB.CatNodesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatNodesResponse>
async nodes (this: That, params?: T.CatNodesRequest | TB.CatNodesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatNodesResponse, unknown>>
@ -515,12 +588,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-pending-tasks.html | Elasticsearch API documentation}
*/
async pendingTasks (this: That, params?: T.CatPendingTasksRequest | TB.CatPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatPendingTasksResponse>
async pendingTasks (this: That, params?: T.CatPendingTasksRequest | TB.CatPendingTasksRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatPendingTasksResponse, unknown>>
@ -542,12 +618,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-plugins.html | Elasticsearch API documentation}
*/
async plugins (this: That, params?: T.CatPluginsRequest | TB.CatPluginsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatPluginsResponse>
async plugins (this: That, params?: T.CatPluginsRequest | TB.CatPluginsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatPluginsResponse, unknown>>
@ -569,12 +648,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-recovery.html | Elasticsearch API documentation}
*/
async recovery (this: That, params?: T.CatRecoveryRequest | TB.CatRecoveryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatRecoveryResponse>
async recovery (this: That, params?: T.CatRecoveryRequest | TB.CatRecoveryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatRecoveryResponse, unknown>>
@ -603,12 +685,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-repositories.html | Elasticsearch API documentation}
*/
async repositories (this: That, params?: T.CatRepositoriesRequest | TB.CatRepositoriesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatRepositoriesResponse>
async repositories (this: That, params?: T.CatRepositoriesRequest | TB.CatRepositoriesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatRepositoriesResponse, unknown>>
@ -630,12 +718,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-segments.html | Elasticsearch API documentation}
*/
async segments (this: That, params?: T.CatSegmentsRequest | TB.CatSegmentsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatSegmentsResponse>
async segments (this: That, params?: T.CatSegmentsRequest | TB.CatSegmentsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatSegmentsResponse, unknown>>
@ -664,12 +755,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-shards.html | Elasticsearch API documentation}
*/
async shards (this: That, params?: T.CatShardsRequest | TB.CatShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatShardsResponse>
async shards (this: That, params?: T.CatShardsRequest | TB.CatShardsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatShardsResponse, unknown>>
@ -698,12 +795,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-snapshots.html | Elasticsearch API documentation}
*/
async snapshots (this: That, params?: T.CatSnapshotsRequest | TB.CatSnapshotsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatSnapshotsResponse>
async snapshots (this: That, params?: T.CatSnapshotsRequest | TB.CatSnapshotsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatSnapshotsResponse, unknown>>
@ -732,12 +835,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/tasks.html | Elasticsearch API documentation}
*/
async tasks (this: That, params?: T.CatTasksRequest | TB.CatTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatTasksResponse>
async tasks (this: That, params?: T.CatTasksRequest | TB.CatTasksRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatTasksResponse, unknown>>
@ -759,12 +868,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-templates.html | Elasticsearch API documentation}
*/
async templates (this: That, params?: T.CatTemplatesRequest | TB.CatTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatTemplatesResponse>
async templates (this: That, params?: T.CatTemplatesRequest | TB.CatTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatTemplatesResponse, unknown>>
@ -793,12 +905,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-thread-pool.html | Elasticsearch API documentation}
*/
async threadPool (this: That, params?: T.CatThreadPoolRequest | TB.CatThreadPoolRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatThreadPoolResponse>
async threadPool (this: That, params?: T.CatThreadPoolRequest | TB.CatThreadPoolRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatThreadPoolResponse, unknown>>
@ -827,12 +945,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-transforms.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-transforms.html | Elasticsearch API documentation}
*/
async transforms (this: That, params?: T.CatTransformsRequest | TB.CatTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatTransformsResponse>
async transforms (this: That, params?: T.CatTransformsRequest | TB.CatTransformsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatTransformsResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Ccr {
/**
* Deletes auto-follow patterns.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-delete-auto-follow-pattern.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-delete-auto-follow-pattern.html | Elasticsearch API documentation}
*/
async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest | TB.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrDeleteAutoFollowPatternResponse>
async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest | TB.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrDeleteAutoFollowPatternResponse, unknown>>
@ -66,12 +67,18 @@ 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)
}
/**
* Creates a new follower index configured to follow the referenced leader index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-put-follow.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-put-follow.html | Elasticsearch API documentation}
*/
async follow (this: That, params: T.CcrFollowRequest | TB.CcrFollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrFollowResponse>
async follow (this: That, params: T.CcrFollowRequest | TB.CcrFollowRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrFollowResponse, unknown>>
@ -104,12 +111,18 @@ 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)
}
/**
* Retrieves information about all follower indices, including parameters and status for each follower index
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-get-follow-info.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-get-follow-info.html | Elasticsearch API documentation}
*/
async followInfo (this: That, params: T.CcrFollowInfoRequest | TB.CcrFollowInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrFollowInfoResponse>
async followInfo (this: That, params: T.CcrFollowInfoRequest | TB.CcrFollowInfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrFollowInfoResponse, unknown>>
@ -130,12 +143,18 @@ 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)
}
/**
* Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-get-follow-stats.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-get-follow-stats.html | Elasticsearch API documentation}
*/
async followStats (this: That, params: T.CcrFollowStatsRequest | TB.CcrFollowStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrFollowStatsResponse>
async followStats (this: That, params: T.CcrFollowStatsRequest | TB.CcrFollowStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrFollowStatsResponse, unknown>>
@ -156,12 +175,18 @@ 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)
}
/**
* Removes the follower retention leases from the leader.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-post-forget-follower.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-post-forget-follower.html | Elasticsearch API documentation}
*/
async forgetFollower (this: That, params: T.CcrForgetFollowerRequest | TB.CcrForgetFollowerRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrForgetFollowerResponse>
async forgetFollower (this: That, params: T.CcrForgetFollowerRequest | TB.CcrForgetFollowerRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrForgetFollowerResponse, unknown>>
@ -194,12 +219,18 @@ 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)
}
/**
* Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-get-auto-follow-pattern.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-get-auto-follow-pattern.html | Elasticsearch API documentation}
*/
async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest | TB.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrGetAutoFollowPatternResponse>
async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest | TB.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrGetAutoFollowPatternResponse, unknown>>
@ -228,12 +259,18 @@ 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)
}
/**
* Pauses an auto-follow pattern
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-pause-auto-follow-pattern.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-pause-auto-follow-pattern.html | Elasticsearch API documentation}
*/
async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest | TB.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrPauseAutoFollowPatternResponse>
async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest | TB.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrPauseAutoFollowPatternResponse, unknown>>
@ -254,12 +291,18 @@ 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)
}
/**
* Pauses a follower index. The follower index will not fetch any additional operations from the leader index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-post-pause-follow.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-post-pause-follow.html | Elasticsearch API documentation}
*/
async pauseFollow (this: That, params: T.CcrPauseFollowRequest | TB.CcrPauseFollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrPauseFollowResponse>
async pauseFollow (this: That, params: T.CcrPauseFollowRequest | TB.CcrPauseFollowRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrPauseFollowResponse, unknown>>
@ -280,12 +323,18 @@ 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)
}
/**
* Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-put-auto-follow-pattern.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-put-auto-follow-pattern.html | Elasticsearch API documentation}
*/
async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest | TB.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrPutAutoFollowPatternResponse>
async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest | TB.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrPutAutoFollowPatternResponse, unknown>>
@ -318,12 +367,18 @@ 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)
}
/**
* Resumes an auto-follow pattern that has been paused
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-resume-auto-follow-pattern.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-resume-auto-follow-pattern.html | Elasticsearch API documentation}
*/
async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest | TB.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrResumeAutoFollowPatternResponse>
async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest | TB.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrResumeAutoFollowPatternResponse, unknown>>
@ -344,12 +399,18 @@ 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)
}
/**
* Resumes a follower index that has been paused
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-post-resume-follow.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-post-resume-follow.html | Elasticsearch API documentation}
*/
async resumeFollow (this: That, params: T.CcrResumeFollowRequest | TB.CcrResumeFollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrResumeFollowResponse>
async resumeFollow (this: That, params: T.CcrResumeFollowRequest | TB.CcrResumeFollowRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrResumeFollowResponse, unknown>>
@ -382,12 +443,18 @@ 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)
}
/**
* Gets all stats related to cross-cluster replication.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-get-stats.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-get-stats.html | Elasticsearch API documentation}
*/
async stats (this: That, params?: T.CcrStatsRequest | TB.CcrStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrStatsResponse>
async stats (this: That, params?: T.CcrStatsRequest | TB.CcrStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrStatsResponse, unknown>>
@ -409,12 +476,15 @@ 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)
}
/**
* Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-post-unfollow.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-post-unfollow.html | Elasticsearch API documentation}
*/
async unfollow (this: That, params: T.CcrUnfollowRequest | TB.CcrUnfollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CcrUnfollowResponse>
async unfollow (this: That, params: T.CcrUnfollowRequest | TB.CcrUnfollowRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrUnfollowResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Explicitly clears the search context for a scroll.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/clear-scroll-api.html | Elasticsearch API documentation}
*/
export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClearScrollResponse>
export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClearScrollResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Close a point in time
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>
export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest | TB.ClosePointInTimeRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClosePointInTimeResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Cluster {
/**
* Provides explanations for shard allocations in the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-allocation-explain.html | Elasticsearch API documentation}
*/
async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest | TB.ClusterAllocationExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterAllocationExplainResponse>
async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest | TB.ClusterAllocationExplainRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterAllocationExplainResponse, unknown>>
@ -79,12 +80,15 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-component-template.html | Elasticsearch API documentation}
*/
async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest | TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterDeleteComponentTemplateResponse>
async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest | TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterDeleteComponentTemplateResponse, unknown>>
@ -105,12 +109,18 @@ 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)
}
/**
* Clears cluster voting config exclusions.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/voting-config-exclusions.html | Elasticsearch API documentation}
*/
async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest | TB.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterDeleteVotingConfigExclusionsResponse>
async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest | TB.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterDeleteVotingConfigExclusionsResponse, unknown>>
@ -132,12 +142,15 @@ 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)
}
/**
* Returns information about whether a particular component template exist
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-component-template.html | Elasticsearch API documentation}
*/
async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest | TB.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterExistsComponentTemplateResponse>
async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest | TB.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterExistsComponentTemplateResponse, unknown>>
@ -158,12 +171,18 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-component-template.html | Elasticsearch API documentation}
*/
async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest | TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterGetComponentTemplateResponse>
async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest | TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterGetComponentTemplateResponse, unknown>>
@ -192,12 +211,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-get-settings.html | Elasticsearch API documentation}
*/
async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterGetSettingsResponse>
async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterGetSettingsResponse, unknown>>
@ -219,12 +244,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-health.html | Elasticsearch API documentation}
*/
async health (this: That, params?: T.ClusterHealthRequest | TB.ClusterHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterHealthResponse>
async health (this: That, params?: T.ClusterHealthRequest | TB.ClusterHealthRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterHealthResponse, unknown>>
@ -253,12 +281,18 @@ 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)
}
/**
* Returns different information about the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-info.html | Elasticsearch API documentation}
*/
async info (this: That, params: T.ClusterInfoRequest | TB.ClusterInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterInfoResponse>
async info (this: That, params: T.ClusterInfoRequest | TB.ClusterInfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterInfoResponse, unknown>>
@ -279,12 +313,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-pending.html | Elasticsearch API documentation}
*/
async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterPendingTasksResponse>
async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterPendingTasksResponse, unknown>>
@ -306,12 +346,15 @@ 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)
}
/**
* Updates the cluster voting config exclusions by node ids or node names.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/voting-config-exclusions.html | Elasticsearch API documentation}
*/
async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest | TB.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterPostVotingConfigExclusionsResponse>
async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest | TB.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterPostVotingConfigExclusionsResponse, unknown>>
@ -333,19 +376,22 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-component-template.html | Elasticsearch API documentation}
*/
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterPutComponentTemplateResponse>
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterPutComponentTemplateResponse, unknown>>
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<T.ClusterPutComponentTemplateResponse>
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['allow_auto_create', 'template', 'version', '_meta']
const acceptedBody: string[] = ['template', 'version', '_meta', 'deprecated']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
@ -371,12 +417,18 @@ 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)
}
/**
* Updates the cluster settings.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-update-settings.html | Elasticsearch API documentation}
*/
async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterPutSettingsResponse>
async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterPutSettingsResponse, unknown>>
@ -410,12 +462,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-remote-info.html | Elasticsearch API documentation}
*/
async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest | TB.ClusterRemoteInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterRemoteInfoResponse>
async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest | TB.ClusterRemoteInfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterRemoteInfoResponse, unknown>>
@ -437,12 +492,15 @@ 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)
}
/**
* Allows to manually change the allocation of individual shards in the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-reroute.html | Elasticsearch API documentation}
*/
async reroute (this: That, params?: T.ClusterRerouteRequest | TB.ClusterRerouteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterRerouteResponse>
async reroute (this: That, params?: T.ClusterRerouteRequest | TB.ClusterRerouteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterRerouteResponse, unknown>>
@ -476,12 +534,15 @@ 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)
}
/**
* Returns a comprehensive information about the state of the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-state.html | Elasticsearch API documentation}
*/
async state (this: That, params?: T.ClusterStateRequest | TB.ClusterStateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterStateResponse>
async state (this: That, params?: T.ClusterStateRequest | TB.ClusterStateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterStateResponse, unknown>>
@ -513,12 +574,19 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-stats.html | Elasticsearch API documentation}
*/
async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ClusterStatsResponse>
async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterStatsResponse, unknown>>
@ -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)
}
}

1245
src/api/api/connector.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns number of documents matching a query.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-count.html | Elasticsearch API documentation}
*/
export default async function CountApi (this: That, params?: T.CountRequest | TB.CountRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CountResponse>
export default async function CountApi (this: That, params?: T.CountRequest | TB.CountRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CountResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>
export default async function CreateApi<TDocument = unknown> (this: That, params: T.CreateRequest<TDocument> | TB.CreateRequest<TDocument>, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CreateResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class DanglingIndices {
/**
* Deletes the specified dangling index
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-gateway-dangling-indices.html | Elasticsearch API documentation}
*/
async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest | TB.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.DanglingIndicesDeleteDanglingIndexResponse>
async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest | TB.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DanglingIndicesDeleteDanglingIndexResponse, unknown>>
@ -66,12 +67,18 @@ 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)
}
/**
* Imports the specified dangling index
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-gateway-dangling-indices.html | Elasticsearch API documentation}
*/
async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest | TB.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.DanglingIndicesImportDanglingIndexResponse>
async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest | TB.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DanglingIndicesImportDanglingIndexResponse, unknown>>
@ -92,12 +99,18 @@ 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)
}
/**
* Returns all dangling indices.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-gateway-dangling-indices.html | Elasticsearch API documentation}
*/
async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest | TB.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.DanglingIndicesListDanglingIndicesResponse>
async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest | TB.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DanglingIndicesListDanglingIndicesResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Removes a document from the index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-delete.html | Elasticsearch API documentation}
*/
export default async function DeleteApi (this: That, params: T.DeleteRequest | TB.DeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.DeleteResponse>
export default async function DeleteApi (this: That, params: T.DeleteRequest | TB.DeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DeleteResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Deletes documents matching the provided query.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>
export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest | TB.DeleteByQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DeleteByQueryResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Changes the number of requests per second for a particular Delete By Query operation.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-delete-by-query.html | Elasticsearch API documentation}
*/
export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest | TB.DeleteByQueryRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.DeleteByQueryRethrottleResponse>
export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest | TB.DeleteByQueryRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DeleteByQueryRethrottleResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Deletes a script.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-scripting.html | Elasticsearch API documentation}
*/
export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.DeleteScriptResponse>
export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DeleteScriptResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Enrich {
/**
* Deletes an existing enrich policy and its enrich index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-enrich-policy-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-enrich-policy-api.html | Elasticsearch API documentation}
*/
async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest | TB.EnrichDeletePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EnrichDeletePolicyResponse>
async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest | TB.EnrichDeletePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichDeletePolicyResponse, unknown>>
@ -66,12 +67,18 @@ 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)
}
/**
* Creates the enrich index for an existing enrich policy.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/execute-enrich-policy-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/execute-enrich-policy-api.html | Elasticsearch API documentation}
*/
async executePolicy (this: That, params: T.EnrichExecutePolicyRequest | TB.EnrichExecutePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EnrichExecutePolicyResponse>
async executePolicy (this: That, params: T.EnrichExecutePolicyRequest | TB.EnrichExecutePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichExecutePolicyResponse, unknown>>
@ -92,12 +99,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-enrich-policy-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-enrich-policy-api.html | Elasticsearch API documentation}
*/
async getPolicy (this: That, params?: T.EnrichGetPolicyRequest | TB.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EnrichGetPolicyResponse>
async getPolicy (this: That, params?: T.EnrichGetPolicyRequest | TB.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichGetPolicyResponse, unknown>>
@ -126,12 +139,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-enrich-policy-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/put-enrich-policy-api.html | Elasticsearch API documentation}
*/
async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EnrichPutPolicyResponse>
async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichPutPolicyResponse, unknown>>
@ -164,12 +183,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/enrich-stats-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/enrich-stats-api.html | Elasticsearch API documentation}
*/
async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EnrichStatsResponse>
async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichStatsResponse, unknown>>
@ -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,
@ -45,7 +46,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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/eql-search-api.html | Elasticsearch API documentation}
*/
async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlDeleteResponse>
async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlDeleteResponse, unknown>>
@ -66,12 +67,18 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
async get<TEvent = unknown> (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlGetResponse<TEvent>, unknown>>
@ -92,12 +99,18 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-async-eql-status-api.html | Elasticsearch API documentation}
*/
async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlGetStatusResponse>
async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlGetStatusResponse, unknown>>
@ -118,12 +131,18 @@ 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)
}
/**
* Returns results matching a query expressed in Event Query Language (EQL)
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/eql-search-api.html | Elasticsearch API documentation}
*/
async search<TEvent = unknown> (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlSearchResponse<TEvent>>
async search<TEvent = unknown> (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlSearchResponse<TEvent>, unknown>>
@ -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,
@ -43,9 +44,70 @@ export default class Esql {
this.transport = transport
}
/**
* Executes an ESQL request asynchronously
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/esql-async-query-api.html | Elasticsearch API documentation}
*/
async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<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/8.14/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 ESQL request
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-rest.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/esql-rest.html | Elasticsearch API documentation}
*/
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlQueryResponse>
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlQueryResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns information about whether a document exists in an index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-get.html | Elasticsearch API documentation}
*/
export default async function ExistsApi (this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExistsResponse>
export default async function ExistsApi (this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExistsResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns information about whether a document source exists in an index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-get.html | Elasticsearch API documentation}
*/
export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExistsSourceResponse>
export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExistsSourceResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns information about why a specific matches (or doesn't match) a query.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
export default async function ExplainApi<TDocument = unknown> (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExplainResponse<TDocument>, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Features {
/**
* Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-features-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-features-api.html | Elasticsearch API documentation}
*/
async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest | TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FeaturesGetFeaturesResponse>
async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest | TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FeaturesGetFeaturesResponse, unknown>>
@ -67,12 +68,15 @@ 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)
}
/**
* Resets the internal state of features, usually by deleting system indices
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest | TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FeaturesResetFeaturesResponse>
async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest | TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FeaturesResetFeaturesResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns the information about the capabilities of fields among multiple indices.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-field-caps.html | Elasticsearch API documentation}
*/
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
@ -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,12 +97,18 @@ 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)
}
/**
* Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-global-checkpoints.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-global-checkpoints.html | Elasticsearch API documentation}
*/
async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest | TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetGlobalCheckpointsResponse>
async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest | TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetGlobalCheckpointsResponse, unknown>>
@ -116,7 +129,13 @@ export default class Fleet {
const method = 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_fleet/global_checkpoints`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.global_checkpoints',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -153,7 +172,13 @@ export default class Fleet {
method = body != null ? 'POST' : 'GET'
path = '/_fleet/_fleet_msearch'
}
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.msearch',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
}
/**
@ -178,7 +203,10 @@ export default class Fleet {
const method = 'POST'
const path = '/_fleet/secret'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.post_secret'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
@ -215,6 +243,12 @@ export default class Fleet {
const method = body != null ? 'POST' : 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_fleet/_fleet_search`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'fleet.search',
pathParts: {
index: params.index
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns a document.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-get.html | Elasticsearch API documentation}
*/
export default async function GetApi<TDocument = unknown> (this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GetResponse<TDocument>>
export default async function GetApi<TDocument = unknown> (this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetResponse<TDocument>, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns a script.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-scripting.html | Elasticsearch API documentation}
*/
export default async function GetScriptApi (this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GetScriptResponse>
export default async function GetScriptApi (this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetScriptResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns all script contexts.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/8.14/painless-contexts.html | Elasticsearch API documentation}
*/
export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest | TB.GetScriptContextRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GetScriptContextResponse>
export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest | TB.GetScriptContextRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetScriptContextResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns available script types, languages and contexts
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-scripting.html | Elasticsearch API documentation}
*/
export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GetScriptLanguagesResponse>
export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetScriptLanguagesResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns the source of a document.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-get.html | Elasticsearch API documentation}
*/
export default async function GetSourceApi<TDocument = unknown> (this: That, params: T.GetSourceRequest | TB.GetSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GetSourceResponse<TDocument>>
export default async function GetSourceApi<TDocument = unknown> (this: That, params: T.GetSourceRequest | TB.GetSourceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetSourceResponse<TDocument>, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Graph {
/**
* Explore extracted and summarized information about the documents and terms in an index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/graph-explore-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/graph-explore-api.html | Elasticsearch API documentation}
*/
async explore (this: That, params: T.GraphExploreRequest | TB.GraphExploreRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GraphExploreResponse>
async explore (this: That, params: T.GraphExploreRequest | TB.GraphExploreRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GraphExploreResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns the health of the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/health-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/health-api.html | Elasticsearch API documentation}
*/
export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.HealthReportResponse>
export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.HealthReportResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Ilm {
/**
* Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-delete-lifecycle.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-delete-lifecycle.html | Elasticsearch API documentation}
*/
async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest | TB.IlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmDeleteLifecycleResponse>
async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest | TB.IlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmDeleteLifecycleResponse, unknown>>
@ -66,12 +67,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-explain-lifecycle.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-explain-lifecycle.html | Elasticsearch API documentation}
*/
async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest | TB.IlmExplainLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmExplainLifecycleResponse>
async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest | TB.IlmExplainLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmExplainLifecycleResponse, unknown>>
@ -92,12 +99,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-get-lifecycle.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-get-lifecycle.html | Elasticsearch API documentation}
*/
async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest | TB.IlmGetLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmGetLifecycleResponse>
async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest | TB.IlmGetLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmGetLifecycleResponse, unknown>>
@ -126,12 +139,18 @@ 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)
}
/**
* Retrieves the current index lifecycle management (ILM) status.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-get-status.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-get-status.html | Elasticsearch API documentation}
*/
async getStatus (this: That, params?: T.IlmGetStatusRequest | TB.IlmGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmGetStatusResponse>
async getStatus (this: That, params?: T.IlmGetStatusRequest | TB.IlmGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmGetStatusResponse, unknown>>
@ -153,12 +172,15 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-migrate-to-data-tiers.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-migrate-to-data-tiers.html | Elasticsearch API documentation}
*/
async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest | TB.IlmMigrateToDataTiersRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmMigrateToDataTiersResponse>
async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest | TB.IlmMigrateToDataTiersRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmMigrateToDataTiersResponse, unknown>>
@ -192,12 +214,15 @@ 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)
}
/**
* Manually moves an index into the specified step and executes that step.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-move-to-step.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-move-to-step.html | Elasticsearch API documentation}
*/
async moveToStep (this: That, params: T.IlmMoveToStepRequest | TB.IlmMoveToStepRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmMoveToStepResponse>
async moveToStep (this: That, params: T.IlmMoveToStepRequest | TB.IlmMoveToStepRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmMoveToStepResponse, unknown>>
@ -230,12 +255,18 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-put-lifecycle.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-put-lifecycle.html | Elasticsearch API documentation}
*/
async putLifecycle (this: That, params: T.IlmPutLifecycleRequest | TB.IlmPutLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmPutLifecycleResponse>
async putLifecycle (this: That, params: T.IlmPutLifecycleRequest | TB.IlmPutLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmPutLifecycleResponse, unknown>>
@ -268,12 +299,18 @@ 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)
}
/**
* Removes the assigned lifecycle policy and stops managing the specified index
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-remove-policy.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-remove-policy.html | Elasticsearch API documentation}
*/
async removePolicy (this: That, params: T.IlmRemovePolicyRequest | TB.IlmRemovePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmRemovePolicyResponse>
async removePolicy (this: That, params: T.IlmRemovePolicyRequest | TB.IlmRemovePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmRemovePolicyResponse, unknown>>
@ -294,12 +331,18 @@ 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)
}
/**
* Retries executing the policy for an index that is in the ERROR step.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-retry-policy.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-retry-policy.html | Elasticsearch API documentation}
*/
async retry (this: That, params: T.IlmRetryRequest | TB.IlmRetryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmRetryResponse>
async retry (this: That, params: T.IlmRetryRequest | TB.IlmRetryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmRetryResponse, unknown>>
@ -320,12 +363,18 @@ 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)
}
/**
* Start the index lifecycle management (ILM) plugin.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-start.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-start.html | Elasticsearch API documentation}
*/
async start (this: That, params?: T.IlmStartRequest | TB.IlmStartRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmStartResponse>
async start (this: That, params?: T.IlmStartRequest | TB.IlmStartRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmStartResponse, unknown>>
@ -347,12 +396,15 @@ 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)
}
/**
* Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-stop.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-stop.html | Elasticsearch API documentation}
*/
async stop (this: That, params?: T.IlmStopRequest | TB.IlmStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IlmStopResponse>
async stop (this: That, params?: T.IlmStopRequest | TB.IlmStopRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IlmStopResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Creates or updates a document in an index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>
export default async function IndexApi<TDocument = unknown> (this: That, params: T.IndexRequest<TDocument> | TB.IndexRequest<TDocument>, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndexResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Inference {
/**
* Delete model in the Inference API
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-inference-api.html | Elasticsearch API documentation}
*/
async deleteModel (this: That, params: T.InferenceDeleteModelRequest | TB.InferenceDeleteModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceDeleteModelResponse>
async deleteModel (this: That, params: T.InferenceDeleteModelRequest | TB.InferenceDeleteModelRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceDeleteModelResponse, unknown>>
@ -73,12 +74,19 @@ export default class Inference {
method = 'DELETE'
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'inference.delete_model',
pathParts: {
task_type: params.task_type,
inference_id: params.inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Get a model in the Inference API
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-inference-api.html | Elasticsearch API documentation}
*/
async getModel (this: That, params: T.InferenceGetModelRequest | TB.InferenceGetModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceGetModelResponse>
async getModel (this: That, params: T.InferenceGetModelRequest | TB.InferenceGetModelRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceGetModelResponse, unknown>>
@ -102,23 +110,33 @@ export default class Inference {
if (params.task_type != null && params.inference_id != null) {
method = 'GET'
path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}`
} else {
} else if (params.inference_id != null) {
method = 'GET'
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
} else {
method = 'GET'
path = '/_inference'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'inference.get_model',
pathParts: {
task_type: params.task_type,
inference_id: params.inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Perform inference on a model
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/post-inference-api.html | Elasticsearch API documentation}
*/
async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceInferenceResponse>
async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceInferenceResponse, unknown>>
async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptions): Promise<T.InferenceInferenceResponse>
async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['task_type', 'inference_id']
const acceptedBody: string[] = ['input', 'task_settings']
const acceptedBody: string[] = ['query', 'input', 'task_settings']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
@ -151,12 +169,19 @@ 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 a model for use in the Inference API
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/put-inference-api.html | Elasticsearch API documentation}
*/
async putModel (this: That, params: T.InferencePutModelRequest | TB.InferencePutModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutModelResponse>
async putModel (this: That, params: T.InferencePutModelRequest | TB.InferencePutModelRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutModelResponse, unknown>>
@ -189,6 +214,13 @@ export default class Inference {
method = 'PUT'
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'inference.put_model',
pathParts: {
task_type: params.task_type,
inference_id: params.inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns basic information about the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/index.html | Elasticsearch API documentation}
*/
export default async function InfoApi (this: That, params?: T.InfoRequest | TB.InfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InfoResponse>
export default async function InfoApi (this: That, params?: T.InfoRequest | TB.InfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InfoResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Ingest {
/**
* Deletes a pipeline.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-pipeline-api.html | Elasticsearch API documentation}
*/
async deletePipeline (this: That, params: T.IngestDeletePipelineRequest | TB.IngestDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestDeletePipelineResponse>
async deletePipeline (this: That, params: T.IngestDeletePipelineRequest | TB.IngestDeletePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestDeletePipelineResponse, unknown>>
@ -66,12 +67,18 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-processor.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/geoip-processor.html | Elasticsearch API documentation}
*/
async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest | TB.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestGeoIpStatsResponse>
async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest | TB.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestGeoIpStatsResponse, unknown>>
@ -93,12 +100,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-pipeline-api.html | Elasticsearch API documentation}
*/
async getPipeline (this: That, params?: T.IngestGetPipelineRequest | TB.IngestGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestGetPipelineResponse>
async getPipeline (this: That, params?: T.IngestGetPipelineRequest | TB.IngestGetPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestGetPipelineResponse, unknown>>
@ -127,12 +137,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/grok-processor.html | Elasticsearch API documentation}
*/
async processorGrok (this: That, params?: T.IngestProcessorGrokRequest | TB.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestProcessorGrokResponse>
async processorGrok (this: That, params?: T.IngestProcessorGrokRequest | TB.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestProcessorGrokResponse, unknown>>
@ -154,12 +170,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ingest.html | Elasticsearch API documentation}
*/
async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestPutPipelineResponse>
async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestPutPipelineResponse, unknown>>
@ -192,12 +211,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/simulate-pipeline-api.html | Elasticsearch API documentation}
*/
async simulate (this: That, params?: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestSimulateResponse>
async simulate (this: That, params?: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestSimulateResponse, unknown>>
@ -238,6 +263,12 @@ export default class Ingest {
method = body != null ? 'POST' : 'GET'
path = '/_ingest/pipeline/_simulate'
}
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'ingest.simulate',
pathParts: {
id: params.id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Performs a kNN search.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-search.html | Elasticsearch API documentation}
*/
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.KnnSearchResponse<TDocument>>
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.KnnSearchResponse<TDocument>, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class License {
/**
* Deletes licensing information for the cluster
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-license.html | Elasticsearch API documentation}
*/
async delete (this: That, params?: T.LicenseDeleteRequest | TB.LicenseDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicenseDeleteResponse>
async delete (this: That, params?: T.LicenseDeleteRequest | TB.LicenseDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicenseDeleteResponse, unknown>>
@ -67,12 +68,15 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-license.html | Elasticsearch API documentation}
*/
async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicenseGetResponse>
async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicenseGetResponse, unknown>>
@ -94,12 +98,15 @@ 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)
}
/**
* Retrieves information about the status of the basic license.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-basic-status.html | Elasticsearch API documentation}
*/
async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest | TB.LicenseGetBasicStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicenseGetBasicStatusResponse>
async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest | TB.LicenseGetBasicStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicenseGetBasicStatusResponse, unknown>>
@ -121,12 +128,15 @@ 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)
}
/**
* Retrieves information about the status of the trial license.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-trial-status.html | Elasticsearch API documentation}
*/
async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest | TB.LicenseGetTrialStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicenseGetTrialStatusResponse>
async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest | TB.LicenseGetTrialStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicenseGetTrialStatusResponse, unknown>>
@ -148,12 +158,15 @@ 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)
}
/**
* Updates the license for the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/update-license.html | Elasticsearch API documentation}
*/
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostResponse>
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostResponse, unknown>>
@ -187,12 +200,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/start-basic.html | Elasticsearch API documentation}
*/
async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest | TB.LicensePostStartBasicRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostStartBasicResponse>
async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest | TB.LicensePostStartBasicRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostStartBasicResponse, unknown>>
@ -214,12 +230,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/start-trial.html | Elasticsearch API documentation}
*/
async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest | TB.LicensePostStartTrialRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostStartTrialResponse>
async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest | TB.LicensePostStartTrialRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostStartTrialResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Logstash {
/**
* Deletes Logstash Pipelines used by Central Management
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-delete-pipeline.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/logstash-api-delete-pipeline.html | Elasticsearch API documentation}
*/
async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest | TB.LogstashDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LogstashDeletePipelineResponse>
async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest | TB.LogstashDeletePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LogstashDeletePipelineResponse, unknown>>
@ -66,12 +67,18 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-get-pipeline.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/logstash-api-get-pipeline.html | Elasticsearch API documentation}
*/
async getPipeline (this: That, params?: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LogstashGetPipelineResponse>
async getPipeline (this: That, params?: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LogstashGetPipelineResponse, unknown>>
@ -100,12 +107,18 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-put-pipeline.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/logstash-api-put-pipeline.html | Elasticsearch API documentation}
*/
async putPipeline (this: That, params: T.LogstashPutPipelineRequest | TB.LogstashPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LogstashPutPipelineResponse>
async putPipeline (this: That, params: T.LogstashPutPipelineRequest | TB.LogstashPutPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LogstashPutPipelineResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows to get multiple documents in one request.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-multi-get.html | Elasticsearch API documentation}
*/
export default async function MgetApi<TDocument = unknown> (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MgetResponse<TDocument>>
export default async function MgetApi<TDocument = unknown> (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MgetResponse<TDocument>, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Migration {
/**
* Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/migration-api-deprecation.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/migration-api-deprecation.html | Elasticsearch API documentation}
*/
async deprecations (this: That, params?: T.MigrationDeprecationsRequest | TB.MigrationDeprecationsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MigrationDeprecationsResponse>
async deprecations (this: That, params?: T.MigrationDeprecationsRequest | TB.MigrationDeprecationsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MigrationDeprecationsResponse, unknown>>
@ -74,12 +75,18 @@ 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)
}
/**
* Find out whether system features need to be upgraded or not
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/migration-api-feature-upgrade.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/migration-api-feature-upgrade.html | Elasticsearch API documentation}
*/
async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MigrationGetFeatureUpgradeStatusResponse>
async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MigrationGetFeatureUpgradeStatusResponse, unknown>>
@ -101,12 +108,15 @@ 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)
}
/**
* Begin upgrades for system features
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/migration-api-feature-upgrade.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/migration-api-feature-upgrade.html | Elasticsearch API documentation}
*/
async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MigrationPostFeatureUpgradeResponse>
async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MigrationPostFeatureUpgradeResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Monitoring {
/**
* Used by the monitoring features to send monitoring data.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/monitor-elasticsearch-cluster.html | Elasticsearch API documentation}
*/
async bulk<TDocument = unknown, TPartialDocument = unknown> (this: That, params: T.MonitoringBulkRequest<TDocument, TPartialDocument> | TB.MonitoringBulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptionsWithOutMeta): Promise<T.MonitoringBulkResponse>
async bulk<TDocument = unknown, TPartialDocument = unknown> (this: That, params: T.MonitoringBulkRequest<TDocument, TPartialDocument> | TB.MonitoringBulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MonitoringBulkResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows to execute several search operations in one request.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-multi-search.html | Elasticsearch API documentation}
*/
export default async function MsearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.MsearchRequest | TB.MsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MsearchResponse<TDocument, TAggregations>>
export default async function MsearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.MsearchRequest | TB.MsearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MsearchResponse<TDocument, TAggregations>, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows to execute several search template operations in one request.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
export default async function MsearchTemplateApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MsearchTemplateResponse<TDocument, TAggregations>, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns multiple termvectors in one request.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-multi-termvectors.html | Elasticsearch API documentation}
*/
export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest | TB.MtermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MtermvectorsResponse>
export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest | TB.MtermvectorsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MtermvectorsResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Nodes {
/**
* Removes the archived repositories metering information present in the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-repositories-metering-archive-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/clear-repositories-metering-archive-api.html | Elasticsearch API documentation}
*/
async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest | TB.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesClearRepositoriesMeteringArchiveResponse>
async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest | TB.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.NodesClearRepositoriesMeteringArchiveResponse, unknown>>
@ -66,12 +67,19 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-repositories-metering-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-repositories-metering-api.html | Elasticsearch API documentation}
*/
async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest | TB.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesGetRepositoriesMeteringInfoResponse>
async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest | TB.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.NodesGetRepositoriesMeteringInfoResponse, unknown>>
@ -92,12 +100,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-nodes-hot-threads.html | Elasticsearch API documentation}
*/
async hotThreads (this: That, params?: T.NodesHotThreadsRequest | TB.NodesHotThreadsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesHotThreadsResponse>
async hotThreads (this: That, params?: T.NodesHotThreadsRequest | TB.NodesHotThreadsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.NodesHotThreadsResponse, unknown>>
@ -126,12 +140,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-nodes-info.html | Elasticsearch API documentation}
*/
async info (this: That, params?: T.NodesInfoRequest | TB.NodesInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesInfoResponse>
async info (this: That, params?: T.NodesInfoRequest | TB.NodesInfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.NodesInfoResponse, unknown>>
@ -166,12 +186,19 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/secure-settings.html#reloadable-secure-settings | Elasticsearch API documentation}
*/
async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest | TB.NodesReloadSecureSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesReloadSecureSettingsResponse>
async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest | TB.NodesReloadSecureSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.NodesReloadSecureSettingsResponse, unknown>>
@ -212,12 +239,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-nodes-stats.html | Elasticsearch API documentation}
*/
async stats (this: That, params?: T.NodesStatsRequest | TB.NodesStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesStatsResponse>
async stats (this: That, params?: T.NodesStatsRequest | TB.NodesStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.NodesStatsResponse, unknown>>
@ -258,12 +291,20 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-nodes-usage.html | Elasticsearch API documentation}
*/
async usage (this: That, params?: T.NodesUsageRequest | TB.NodesUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.NodesUsageResponse>
async usage (this: That, params?: T.NodesUsageRequest | TB.NodesUsageRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.NodesUsageResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Open a point in time that can be used in subsequent searches
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>
export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.OpenPointInTimeResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns whether the cluster is running.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/index.html | Elasticsearch API documentation}
*/
export default async function PingApi (this: That, params?: T.PingRequest | TB.PingRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.PingResponse>
export default async function PingApi (this: That, params?: T.PingRequest | TB.PingRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.PingResponse, unknown>>
@ -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/8.14/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/8.14/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/8.14/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/8.14/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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Creates or updates a script.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-scripting.html | Elasticsearch API documentation}
*/
export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.PutScriptResponse>
export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.PutScriptResponse, unknown>>
@ -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)
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -45,7 +46,7 @@ export default class QueryRuleset {
/**
* Deletes a query ruleset.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
@ -66,12 +67,18 @@ export default class QueryRuleset {
const method = 'DELETE'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'query_ruleset.delete',
pathParts: {
ruleset_id: params.ruleset_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* 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}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
@ -92,12 +99,18 @@ export default class QueryRuleset {
const method = 'GET'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'query_ruleset.get',
pathParts: {
ruleset_id: params.ruleset_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Lists query rulesets.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
@ -119,12 +132,15 @@ export default class QueryRuleset {
const method = 'GET'
const path = '/_query_rules'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'query_ruleset.list'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Creates or updates a query ruleset.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
@ -157,6 +173,12 @@ export default class QueryRuleset {
const method = 'PUT'
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'query_ruleset.put',
pathParts: {
ruleset_id: params.ruleset_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows 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}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-rank-eval.html | Elasticsearch API documentation}
*/
export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RankEvalResponse>
export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RankEvalResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-reindex.html | Elasticsearch API documentation}
*/
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ReindexResponse>
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ReindexResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Changes the number of requests per second for a particular Reindex operation.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-reindex.html | Elasticsearch API documentation}
*/
export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest | TB.ReindexRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ReindexRethrottleResponse>
export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest | TB.ReindexRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ReindexRethrottleResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows to use the Mustache language to pre-render a search definition.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/render-search-template-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>
export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RenderSearchTemplateResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Rollup {
/**
* Deletes an existing rollup job.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-delete-job.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-delete-job.html | Elasticsearch API documentation}
*/
async deleteJob (this: That, params: T.RollupDeleteJobRequest | TB.RollupDeleteJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupDeleteJobResponse>
async deleteJob (this: That, params: T.RollupDeleteJobRequest | TB.RollupDeleteJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupDeleteJobResponse, unknown>>
@ -66,12 +67,18 @@ 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)
}
/**
* Retrieves the configuration, stats, and status of rollup jobs.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-job.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-get-job.html | Elasticsearch API documentation}
*/
async getJobs (this: That, params?: T.RollupGetJobsRequest | TB.RollupGetJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupGetJobsResponse>
async getJobs (this: That, params?: T.RollupGetJobsRequest | TB.RollupGetJobsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupGetJobsResponse, unknown>>
@ -100,12 +107,18 @@ 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)
}
/**
* Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-caps.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-get-rollup-caps.html | Elasticsearch API documentation}
*/
async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest | TB.RollupGetRollupCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupGetRollupCapsResponse>
async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest | TB.RollupGetRollupCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupGetRollupCapsResponse, unknown>>
@ -134,12 +147,18 @@ 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).
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-index-caps.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-get-rollup-index-caps.html | Elasticsearch API documentation}
*/
async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupGetRollupIndexCapsResponse>
async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupGetRollupIndexCapsResponse, unknown>>
@ -160,12 +179,18 @@ 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)
}
/**
* Creates a rollup job.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-put-job.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-put-job.html | Elasticsearch API documentation}
*/
async putJob (this: That, params: T.RollupPutJobRequest | TB.RollupPutJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupPutJobResponse>
async putJob (this: That, params: T.RollupPutJobRequest | TB.RollupPutJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupPutJobResponse, unknown>>
@ -198,12 +223,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
async rollupSearch<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupRollupSearchResponse<TDocument, TAggregations>, unknown>>
@ -236,12 +267,18 @@ 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)
}
/**
* Starts an existing, stopped rollup job.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-start-job.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-start-job.html | Elasticsearch API documentation}
*/
async startJob (this: That, params: T.RollupStartJobRequest | TB.RollupStartJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupStartJobResponse>
async startJob (this: That, params: T.RollupStartJobRequest | TB.RollupStartJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupStartJobResponse, unknown>>
@ -262,12 +299,18 @@ 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)
}
/**
* Stops an existing, started rollup job.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-stop-job.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-stop-job.html | Elasticsearch API documentation}
*/
async stopJob (this: That, params: T.RollupStopJobRequest | TB.RollupStopJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupStopJobResponse>
async stopJob (this: That, params: T.RollupStopJobRequest | TB.RollupStopJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupStopJobResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows an arbitrary script to be executed and a result to be returned
* @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/8.14/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>>
export default async function ScriptsPainlessExecuteApi<TResult = unknown> (this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ScriptsPainlessExecuteResponse<TResult>, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows to retrieve a large numbers of results from a single search request.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-request-body.html#request-body-search-scroll | Elasticsearch API documentation}
*/
export default async function ScrollApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ScrollResponse<TDocument, TAggregations>>
export default async function ScrollApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ScrollResponse<TDocument, TAggregations>, unknown>>
@ -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,
@ -39,14 +40,14 @@ interface That { transport: Transport }
/**
* Returns results matching a query.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchResponse<TDocument, TAggregations>, unknown>>
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<T.SearchResponse<TDocument, TAggregations>>
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'rank', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'rank', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'retriever', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
@ -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,
@ -45,7 +46,7 @@ export default class SearchApplication {
/**
* Deletes a search application.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-search-application.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-search-application.html | Elasticsearch API documentation}
*/
async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationDeleteResponse>
async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationDeleteResponse, unknown>>
@ -66,12 +67,18 @@ 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)
}
/**
* Delete a behavioral analytics collection.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-analytics-collection.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-analytics-collection.html | Elasticsearch API documentation}
*/
async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationDeleteBehavioralAnalyticsResponse>
async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationDeleteBehavioralAnalyticsResponse, unknown>>
@ -92,12 +99,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-search-application.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-search-application.html | Elasticsearch API documentation}
*/
async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationGetResponse>
async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationGetResponse, unknown>>
@ -118,12 +131,18 @@ 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)
}
/**
* Returns the existing behavioral analytics collections.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-analytics-collection.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/list-analytics-collection.html | Elasticsearch API documentation}
*/
async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationGetBehavioralAnalyticsResponse>
async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationGetBehavioralAnalyticsResponse, unknown>>
@ -152,12 +171,18 @@ 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)
}
/**
* Returns the existing search applications.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-search-applications.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/list-search-applications.html | Elasticsearch API documentation}
*/
async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationListResponse>
async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationListResponse, unknown>>
@ -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,12 +233,19 @@ 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)
}
/**
* Creates or updates a search application.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-search-application.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/put-search-application.html | Elasticsearch API documentation}
*/
async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationPutResponse>
async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationPutResponse, unknown>>
@ -236,12 +271,18 @@ 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)
}
/**
* Creates a behavioral analytics collection.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-analytics-collection.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/put-analytics-collection.html | Elasticsearch API documentation}
*/
async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationPutBehavioralAnalyticsResponse>
async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationPutBehavioralAnalyticsResponse, unknown>>
@ -262,12 +303,18 @@ 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)
}
/**
* Renders a query for given search application search parameters
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-render-query.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-application-render-query.html | Elasticsearch API documentation}
*/
async renderQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async renderQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
@ -288,12 +335,18 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-search.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
async search<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationSearchResponse<TDocument, TAggregations>, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-vector-tile-api.html | Elasticsearch API documentation}
*/
export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchMvtResponse>
export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchMvtResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns information about the indices and shards that a search request would be executed against.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-shards.html | Elasticsearch API documentation}
*/
export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchShardsResponse>
export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchShardsResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Allows to use the Mustache language to pre-render a search definition.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>>
export default async function SearchTemplateApi<TDocument = unknown> (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchTemplateResponse<TDocument>, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class SearchableSnapshots {
/**
* Retrieve node-level cache statistics about searchable snapshots.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/searchable-snapshots-apis.html | Elasticsearch API documentation}
*/
async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest | TB.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchableSnapshotsCacheStatsResponse>
async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest | TB.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchableSnapshotsCacheStatsResponse, unknown>>
@ -74,12 +75,18 @@ 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)
}
/**
* Clear the cache of searchable snapshots.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/searchable-snapshots-apis.html | Elasticsearch API documentation}
*/
async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest | TB.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchableSnapshotsClearCacheResponse>
async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest | TB.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchableSnapshotsClearCacheResponse, unknown>>
@ -108,12 +115,18 @@ 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)
}
/**
* Mount a snapshot as a searchable index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/searchable-snapshots-api-mount-snapshot.html | Elasticsearch API documentation}
*/
async mount (this: That, params: T.SearchableSnapshotsMountRequest | TB.SearchableSnapshotsMountRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchableSnapshotsMountResponse>
async mount (this: That, params: T.SearchableSnapshotsMountRequest | TB.SearchableSnapshotsMountRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchableSnapshotsMountResponse, unknown>>
@ -146,12 +159,19 @@ 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)
}
/**
* Retrieve shard-level statistics about searchable snapshots.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/searchable-snapshots-apis.html | Elasticsearch API documentation}
*/
async stats (this: That, params?: T.SearchableSnapshotsStatsRequest | TB.SearchableSnapshotsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchableSnapshotsStatsResponse>
async stats (this: That, params?: T.SearchableSnapshotsStatsRequest | TB.SearchableSnapshotsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchableSnapshotsStatsResponse, unknown>>
@ -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/8.14/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,
@ -45,7 +46,7 @@ export default class Slm {
/**
* Deletes an existing snapshot lifecycle policy.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-delete-policy.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/slm-api-delete-policy.html | Elasticsearch API documentation}
*/
async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest | TB.SlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SlmDeleteLifecycleResponse>
async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest | TB.SlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SlmDeleteLifecycleResponse, unknown>>
@ -66,12 +67,18 @@ 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)
}
/**
* Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-execute-lifecycle.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/slm-api-execute-lifecycle.html | Elasticsearch API documentation}
*/
async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest | TB.SlmExecuteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SlmExecuteLifecycleResponse>
async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest | TB.SlmExecuteLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SlmExecuteLifecycleResponse, unknown>>
@ -92,12 +99,18 @@ 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)
}
/**
* Deletes any snapshots that are expired according to the policy's retention rules.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-execute-retention.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/slm-api-execute-retention.html | Elasticsearch API documentation}
*/
async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest | TB.SlmExecuteRetentionRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SlmExecuteRetentionResponse>
async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest | TB.SlmExecuteRetentionRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SlmExecuteRetentionResponse, unknown>>
@ -119,12 +132,15 @@ 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)
}
/**
* Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-policy.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/slm-api-get-policy.html | Elasticsearch API documentation}
*/
async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest | TB.SlmGetLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SlmGetLifecycleResponse>
async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest | TB.SlmGetLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SlmGetLifecycleResponse, unknown>>
@ -153,12 +169,18 @@ 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)
}
/**
* Returns global and policy-level statistics about actions taken by snapshot lifecycle management.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/slm-api-get-stats.html | Elasticsearch API documentation}
*/
async getStats (this: That, params?: T.SlmGetStatsRequest | TB.SlmGetStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SlmGetStatsResponse>
async getStats (this: That, params?: T.SlmGetStatsRequest | TB.SlmGetStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SlmGetStatsResponse, unknown>>
@ -180,12 +202,15 @@ 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)
}
/**
* Retrieves the status of snapshot lifecycle management (SLM).
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-status.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/slm-api-get-status.html | Elasticsearch API documentation}
*/
async getStatus (this: That, params?: T.SlmGetStatusRequest | TB.SlmGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SlmGetStatusResponse>
async getStatus (this: That, params?: T.SlmGetStatusRequest | TB.SlmGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SlmGetStatusResponse, unknown>>
@ -207,12 +232,15 @@ 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)
}
/**
* Creates or updates a snapshot lifecycle policy.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-put-policy.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/slm-api-put-policy.html | Elasticsearch API documentation}
*/
async putLifecycle (this: That, params: T.SlmPutLifecycleRequest | TB.SlmPutLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SlmPutLifecycleResponse>
async putLifecycle (this: That, params: T.SlmPutLifecycleRequest | TB.SlmPutLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SlmPutLifecycleResponse, unknown>>
@ -245,12 +273,18 @@ 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)
}
/**
* Turns on snapshot lifecycle management (SLM).
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-start.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/slm-api-start.html | Elasticsearch API documentation}
*/
async start (this: That, params?: T.SlmStartRequest | TB.SlmStartRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SlmStartResponse>
async start (this: That, params?: T.SlmStartRequest | TB.SlmStartRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SlmStartResponse, unknown>>
@ -272,12 +306,15 @@ 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)
}
/**
* Turns off snapshot lifecycle management (SLM).
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-stop.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/slm-api-stop.html | Elasticsearch API documentation}
*/
async stop (this: That, params?: T.SlmStopRequest | TB.SlmStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SlmStopResponse>
async stop (this: That, params?: T.SlmStopRequest | TB.SlmStopRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SlmStopResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Snapshot {
/**
* Removes stale data from repository.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/clean-up-snapshot-repo-api.html | Elasticsearch API documentation}
*/
async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest | TB.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotCleanupRepositoryResponse>
async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest | TB.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotCleanupRepositoryResponse, unknown>>
@ -66,12 +67,18 @@ 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)
}
/**
* Clones indices from one snapshot into another snapshot in the same repository.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async clone (this: That, params: T.SnapshotCloneRequest | TB.SnapshotCloneRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotCloneResponse>
async clone (this: That, params: T.SnapshotCloneRequest | TB.SnapshotCloneRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotCloneResponse, unknown>>
@ -104,12 +111,20 @@ 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)
}
/**
* Creates a snapshot in a repository.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async create (this: That, params: T.SnapshotCreateRequest | TB.SnapshotCreateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotCreateResponse>
async create (this: That, params: T.SnapshotCreateRequest | TB.SnapshotCreateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotCreateResponse, unknown>>
@ -142,12 +157,19 @@ 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)
}
/**
* Creates a repository.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest | TB.SnapshotCreateRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotCreateRepositoryResponse>
async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest | TB.SnapshotCreateRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotCreateRepositoryResponse, unknown>>
@ -173,12 +195,18 @@ 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)
}
/**
* Deletes one or more snapshots.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async delete (this: That, params: T.SnapshotDeleteRequest | TB.SnapshotDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotDeleteResponse>
async delete (this: That, params: T.SnapshotDeleteRequest | TB.SnapshotDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotDeleteResponse, unknown>>
@ -199,12 +227,19 @@ 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)
}
/**
* Deletes a repository.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest | TB.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotDeleteRepositoryResponse>
async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest | TB.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotDeleteRepositoryResponse, unknown>>
@ -225,12 +260,18 @@ 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)
}
/**
* Returns information about a snapshot.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async get (this: That, params: T.SnapshotGetRequest | TB.SnapshotGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotGetResponse>
async get (this: That, params: T.SnapshotGetRequest | TB.SnapshotGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotGetResponse, unknown>>
@ -251,12 +292,19 @@ 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)
}
/**
* Returns information about a repository.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest | TB.SnapshotGetRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotGetRepositoryResponse>
async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest | TB.SnapshotGetRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotGetRepositoryResponse, unknown>>
@ -285,12 +333,18 @@ 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)
}
/**
* Analyzes a repository for correctness and performance
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async repositoryAnalyze (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async repositoryAnalyze (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
@ -311,12 +365,18 @@ 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)
}
/**
* Restores a snapshot.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotRestoreResponse>
async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotRestoreResponse, unknown>>
@ -349,12 +409,19 @@ 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)
}
/**
* Returns information about the status of a snapshot.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async status (this: That, params?: T.SnapshotStatusRequest | TB.SnapshotStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotStatusResponse>
async status (this: That, params?: T.SnapshotStatusRequest | TB.SnapshotStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotStatusResponse, unknown>>
@ -386,12 +453,19 @@ 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)
}
/**
* Verifies a repository.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
*/
async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest | TB.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SnapshotVerifyRepositoryResponse>
async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest | TB.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SnapshotVerifyRepositoryResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Sql {
/**
* Clears the SQL cursor
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-sql-cursor-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/clear-sql-cursor-api.html | Elasticsearch API documentation}
*/
async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SqlClearCursorResponse>
async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SqlClearCursorResponse, unknown>>
@ -78,12 +79,15 @@ 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)
}
/**
* Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-async-sql-search-api.html | Elasticsearch API documentation}
*/
async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SqlDeleteAsyncResponse>
async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SqlDeleteAsyncResponse, unknown>>
@ -104,12 +108,18 @@ 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)
}
/**
* Returns the current status and available results for an async SQL search or stored synchronous SQL search
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-async-sql-search-api.html | Elasticsearch API documentation}
*/
async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SqlGetAsyncResponse>
async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SqlGetAsyncResponse, unknown>>
@ -130,12 +140,18 @@ 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)
}
/**
* Returns the current status of an async SQL search or a stored synchronous SQL search
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-async-sql-search-status-api.html | Elasticsearch API documentation}
*/
async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SqlGetAsyncStatusResponse>
async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SqlGetAsyncStatusResponse, unknown>>
@ -156,12 +172,18 @@ 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)
}
/**
* Executes a SQL request
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/sql-search-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/sql-search-api.html | Elasticsearch API documentation}
*/
async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SqlQueryResponse>
async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SqlQueryResponse, unknown>>
@ -195,12 +217,15 @@ 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)
}
/**
* Translates SQL into Elasticsearch queries
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/sql-translate-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/sql-translate-api.html | Elasticsearch API documentation}
*/
async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SqlTranslateResponse>
async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SqlTranslateResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Ssl {
/**
* Retrieves information about the X.509 certificates used to encrypt communications in the cluster.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-ssl.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/security-api-ssl.html | Elasticsearch API documentation}
*/
async certificates (this: That, params?: T.SslCertificatesRequest | TB.SslCertificatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SslCertificatesResponse>
async certificates (this: That, params?: T.SslCertificatesRequest | TB.SslCertificatesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SslCertificatesResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Synonyms {
/**
* Deletes a synonym set
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonyms-set.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-synonyms-set.html | Elasticsearch API documentation}
*/
async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SynonymsDeleteSynonymResponse>
async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SynonymsDeleteSynonymResponse, unknown>>
@ -66,12 +67,18 @@ 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)
}
/**
* Deletes a synonym rule in a synonym set
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonym-rule.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-synonym-rule.html | Elasticsearch API documentation}
*/
async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SynonymsDeleteSynonymRuleResponse>
async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SynonymsDeleteSynonymRuleResponse, unknown>>
@ -92,12 +99,19 @@ 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)
}
/**
* Retrieves a synonym set
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonyms-set.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-synonyms-set.html | Elasticsearch API documentation}
*/
async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SynonymsGetSynonymResponse>
async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SynonymsGetSynonymResponse, unknown>>
@ -118,12 +132,18 @@ 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)
}
/**
* Retrieves a synonym rule from a synonym set
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonym-rule.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-synonym-rule.html | Elasticsearch API documentation}
*/
async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SynonymsGetSynonymRuleResponse>
async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SynonymsGetSynonymRuleResponse, unknown>>
@ -144,12 +164,19 @@ 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)
}
/**
* Retrieves a summary of all defined synonym sets
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/list-synonyms-sets.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/list-synonyms-sets.html | Elasticsearch API documentation}
*/
async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SynonymsGetSynonymsSetsResponse>
async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SynonymsGetSynonymsSetsResponse, unknown>>
@ -171,12 +198,15 @@ 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
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonyms-set.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/put-synonyms-set.html | Elasticsearch API documentation}
*/
async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SynonymsPutSynonymResponse>
async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SynonymsPutSynonymResponse, unknown>>
@ -209,12 +239,18 @@ 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)
}
/**
* Creates or updates a synonym rule in a synonym set
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonym-rule.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/put-synonym-rule.html | Elasticsearch API documentation}
*/
async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SynonymsPutSynonymRuleResponse>
async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SynonymsPutSynonymRuleResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Tasks {
/**
* Cancels a task, if it can be cancelled through an API.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/tasks.html | Elasticsearch API documentation}
*/
async cancel (this: That, params?: T.TasksCancelRequest | TB.TasksCancelRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TasksCancelResponse>
async cancel (this: That, params?: T.TasksCancelRequest | TB.TasksCancelRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TasksCancelResponse, unknown>>
@ -74,12 +75,18 @@ 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)
}
/**
* Returns information about a task.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/tasks.html | Elasticsearch API documentation}
*/
async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TasksGetResponse>
async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TasksGetResponse, unknown>>
@ -100,12 +107,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/tasks.html | Elasticsearch API documentation}
*/
async list (this: That, params?: T.TasksListRequest | TB.TasksListRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TasksListResponse>
async list (this: That, params?: T.TasksListRequest | TB.TasksListRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TasksListResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-terms-enum.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-terms-enum.html | Elasticsearch API documentation}
*/
export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TermsEnumResponse>
export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TermsEnumResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Returns information and statistics about terms in the fields of a particular document.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-termvectors.html | Elasticsearch API documentation}
*/
export default async function TermvectorsApi<TDocument = unknown> (this: That, params: T.TermvectorsRequest<TDocument> | TB.TermvectorsRequest<TDocument>, options?: TransportRequestOptionsWithOutMeta): Promise<T.TermvectorsResponse>
export default async function TermvectorsApi<TDocument = unknown> (this: That, params: T.TermvectorsRequest<TDocument> | TB.TermvectorsRequest<TDocument>, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TermvectorsResponse, unknown>>
@ -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,9 +44,67 @@ export default class TextStructure {
this.transport = transport
}
/**
* Finds the structure of a text field in an index.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/find-field-structure.html | Elasticsearch API documentation}
*/
async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<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/8.14/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}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/find-structure.html | Elasticsearch API documentation}
*/
async findStructure<TJsonDocument = unknown> (this: That, params: T.TextStructureFindStructureRequest<TJsonDocument> | TB.TextStructureFindStructureRequest<TJsonDocument>, options?: TransportRequestOptionsWithOutMeta): Promise<T.TextStructureFindStructureResponse>
async findStructure<TJsonDocument = unknown> (this: That, params: T.TextStructureFindStructureRequest<TJsonDocument> | TB.TextStructureFindStructureRequest<TJsonDocument>, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TextStructureFindStructureResponse, unknown>>
@ -71,12 +130,15 @@ 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)
}
/**
* Tests a Grok pattern on some text.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/test-grok-pattern.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/test-grok-pattern.html | Elasticsearch API documentation}
*/
async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest | TB.TextStructureTestGrokPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TextStructureTestGrokPatternResponse>
async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest | TB.TextStructureTestGrokPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TextStructureTestGrokPatternResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Transform {
/**
* Deletes an existing transform.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-transform.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-transform.html | Elasticsearch API documentation}
*/
async deleteTransform (this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformDeleteTransformResponse>
async deleteTransform (this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformDeleteTransformResponse, unknown>>
@ -66,12 +67,18 @@ 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 configuration information for transforms.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-transform.html | Elasticsearch API documentation}
*/
async getTransform (this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformGetTransformResponse>
async getTransform (this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformGetTransformResponse, unknown>>
@ -100,12 +107,18 @@ 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)
}
/**
* Retrieves usage information for transforms.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform-stats.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-transform-stats.html | Elasticsearch API documentation}
*/
async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformGetTransformStatsResponse>
async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformGetTransformStatsResponse, unknown>>
@ -126,12 +139,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/preview-transform.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/preview-transform.html | Elasticsearch API documentation}
*/
async previewTransform<TTransform = unknown> (this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformPreviewTransformResponse<TTransform>>
async previewTransform<TTransform = unknown> (this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformPreviewTransformResponse<TTransform>, unknown>>
@ -172,12 +191,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-transform.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/put-transform.html | Elasticsearch API documentation}
*/
async putTransform (this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformPutTransformResponse>
async putTransform (this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformPutTransformResponse, unknown>>
@ -210,12 +235,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/reset-transform.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/reset-transform.html | Elasticsearch API documentation}
*/
async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformResetTransformResponse>
async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformResetTransformResponse, unknown>>
@ -236,12 +267,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/schedule-now-transform.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/schedule-now-transform.html | Elasticsearch API documentation}
*/
async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformScheduleNowTransformResponse>
async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformScheduleNowTransformResponse, unknown>>
@ -262,12 +299,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/start-transform.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/start-transform.html | Elasticsearch API documentation}
*/
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformStartTransformResponse>
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformStartTransformResponse, unknown>>
@ -288,12 +331,18 @@ 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)
}
/**
* Stops one or more transforms.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-transform.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/stop-transform.html | Elasticsearch API documentation}
*/
async stopTransform (this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformStopTransformResponse>
async stopTransform (this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformStopTransformResponse, unknown>>
@ -314,12 +363,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/update-transform.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/update-transform.html | Elasticsearch API documentation}
*/
async updateTransform (this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformUpdateTransformResponse>
async updateTransform (this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformUpdateTransformResponse, unknown>>
@ -352,12 +407,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/upgrade-transforms.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/upgrade-transforms.html | Elasticsearch API documentation}
*/
async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformUpgradeTransformsResponse>
async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformUpgradeTransformsResponse, unknown>>
@ -379,6 +440,9 @@ export default class Transform {
const method = 'POST'
const path = '/_transform/_upgrade'
return await this.transport.request({ path, method, querystring, body }, options)
const meta: TransportRequestMetadata = {
name: 'transform.upgrade_transforms'
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
}

View File

@ -28,6 +28,7 @@
import {
Transport,
TransportRequestMetadata,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Updates a document with a script or partial document.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-update.html | Elasticsearch API documentation}
*/
export default async function UpdateApi<TDocument = unknown, TPartialDocument = unknown, TDocumentR = unknown> (this: That, params: T.UpdateRequest<TDocument, TPartialDocument> | TB.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptionsWithOutMeta): Promise<T.UpdateResponse<TDocumentR>>
export default async function UpdateApi<TDocument = unknown, TPartialDocument = unknown, TDocumentR = unknown> (this: That, params: T.UpdateRequest<TDocument, TPartialDocument> | TB.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.UpdateResponse<TDocumentR>, unknown>>
@ -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,8 +39,8 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html | Elasticsearch API documentation}
* Performs an update on every document in the index without changing the source, for example to pick up a mapping change.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/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>
export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest | TB.UpdateByQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.UpdateByQueryResponse, unknown>>
@ -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,
@ -39,7 +40,7 @@ interface That { transport: Transport }
/**
* Changes the number of requests per second for a particular Update By Query operation.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-update-by-query.html | Elasticsearch API documentation}
*/
export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest | TB.UpdateByQueryRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.UpdateByQueryRethrottleResponse>
export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest | TB.UpdateByQueryRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.UpdateByQueryRethrottleResponse, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Watcher {
/**
* Acknowledges a watch, manually throttling the execution of the watch's actions.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-ack-watch.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-ack-watch.html | Elasticsearch API documentation}
*/
async ackWatch (this: That, params: T.WatcherAckWatchRequest | TB.WatcherAckWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherAckWatchResponse>
async ackWatch (this: That, params: T.WatcherAckWatchRequest | TB.WatcherAckWatchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherAckWatchResponse, unknown>>
@ -73,12 +74,19 @@ 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)
}
/**
* Activates a currently inactive watch.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-activate-watch.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-activate-watch.html | Elasticsearch API documentation}
*/
async activateWatch (this: That, params: T.WatcherActivateWatchRequest | TB.WatcherActivateWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherActivateWatchResponse>
async activateWatch (this: That, params: T.WatcherActivateWatchRequest | TB.WatcherActivateWatchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherActivateWatchResponse, unknown>>
@ -99,12 +107,18 @@ 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)
}
/**
* Deactivates a currently active watch.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-deactivate-watch.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-deactivate-watch.html | Elasticsearch API documentation}
*/
async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest | TB.WatcherDeactivateWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherDeactivateWatchResponse>
async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest | TB.WatcherDeactivateWatchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherDeactivateWatchResponse, unknown>>
@ -125,12 +139,18 @@ 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)
}
/**
* Removes a watch from Watcher.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-delete-watch.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-delete-watch.html | Elasticsearch API documentation}
*/
async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest | TB.WatcherDeleteWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherDeleteWatchResponse>
async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest | TB.WatcherDeleteWatchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherDeleteWatchResponse, unknown>>
@ -151,12 +171,18 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-execute-watch.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-execute-watch.html | Elasticsearch API documentation}
*/
async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest | TB.WatcherExecuteWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherExecuteWatchResponse>
async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest | TB.WatcherExecuteWatchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherExecuteWatchResponse, unknown>>
@ -197,12 +223,18 @@ 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)
}
/**
* Retrieve settings for the watcher system index
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-get-settings.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-get-settings.html | Elasticsearch API documentation}
*/
async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
@ -223,12 +255,15 @@ 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)
}
/**
* Retrieves a watch by its ID.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-get-watch.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-get-watch.html | Elasticsearch API documentation}
*/
async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherGetWatchResponse>
async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherGetWatchResponse, unknown>>
@ -249,12 +284,18 @@ 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)
}
/**
* Creates a new watch, or updates an existing one.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-put-watch.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-put-watch.html | Elasticsearch API documentation}
*/
async putWatch (this: That, params: T.WatcherPutWatchRequest | TB.WatcherPutWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherPutWatchResponse>
async putWatch (this: That, params: T.WatcherPutWatchRequest | TB.WatcherPutWatchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherPutWatchResponse, unknown>>
@ -287,12 +328,18 @@ 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)
}
/**
* Retrieves stored watches.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-query-watches.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-query-watches.html | Elasticsearch API documentation}
*/
async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest | TB.WatcherQueryWatchesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherQueryWatchesResponse>
async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest | TB.WatcherQueryWatchesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherQueryWatchesResponse, unknown>>
@ -326,12 +373,15 @@ 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)
}
/**
* Starts Watcher if it is not already running.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-start.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-start.html | Elasticsearch API documentation}
*/
async start (this: That, params?: T.WatcherStartRequest | TB.WatcherStartRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherStartResponse>
async start (this: That, params?: T.WatcherStartRequest | TB.WatcherStartRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherStartResponse, unknown>>
@ -353,12 +403,15 @@ 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)
}
/**
* Retrieves the current Watcher metrics.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-stats.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-stats.html | Elasticsearch API documentation}
*/
async stats (this: That, params?: T.WatcherStatsRequest | TB.WatcherStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherStatsResponse>
async stats (this: That, params?: T.WatcherStatsRequest | TB.WatcherStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherStatsResponse, unknown>>
@ -387,12 +440,18 @@ 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)
}
/**
* Stops Watcher if it is running.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-stop.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-stop.html | Elasticsearch API documentation}
*/
async stop (this: That, params?: T.WatcherStopRequest | TB.WatcherStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherStopResponse>
async stop (this: That, params?: T.WatcherStopRequest | TB.WatcherStopRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherStopResponse, unknown>>
@ -414,12 +473,15 @@ 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)
}
/**
* Update settings for the watcher system index
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api-update-settings.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/watcher-api-update-settings.html | Elasticsearch API documentation}
*/
async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
@ -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,
@ -45,7 +46,7 @@ export default class Xpack {
/**
* Retrieves information about the installed X-Pack features.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/info-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/info-api.html | Elasticsearch API documentation}
*/
async info (this: That, params?: T.XpackInfoRequest | TB.XpackInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.XpackInfoResponse>
async info (this: That, params?: T.XpackInfoRequest | TB.XpackInfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.XpackInfoResponse, unknown>>
@ -67,12 +68,15 @@ 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/usage-api.html | Elasticsearch API documentation}
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/usage-api.html | Elasticsearch API documentation}
*/
async usage (this: That, params?: T.XpackUsageRequest | TB.XpackUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.XpackUsageResponse>
async usage (this: That, params?: T.XpackUsageRequest | TB.XpackUsageRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.XpackUsageResponse, unknown>>
@ -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

@ -34,6 +34,7 @@ import CcrApi from './api/ccr'
import clearScrollApi from './api/clear_scroll'
import closePointInTimeApi from './api/close_point_in_time'
import ClusterApi from './api/cluster'
import ConnectorApi from './api/connector'
import countApi from './api/count'
import createApi from './api/create'
import DanglingIndicesApi from './api/dangling_indices'
@ -76,6 +77,7 @@ import mtermvectorsApi from './api/mtermvectors'
import NodesApi from './api/nodes'
import openPointInTimeApi from './api/open_point_in_time'
import pingApi from './api/ping'
import ProfilingApi from './api/profiling'
import putScriptApi from './api/put_script'
import QueryRulesetApi from './api/query_ruleset'
import rankEvalApi from './api/rank_eval'
@ -93,6 +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'
@ -119,6 +122,7 @@ export default interface API {
clearScroll: typeof clearScrollApi
closePointInTime: typeof closePointInTimeApi
cluster: ClusterApi
connector: ConnectorApi
count: typeof countApi
create: typeof createApi
danglingIndices: DanglingIndicesApi
@ -161,6 +165,7 @@ export default interface API {
nodes: NodesApi
openPointInTime: typeof openPointInTimeApi
ping: typeof pingApi
profiling: ProfilingApi
putScript: typeof putScriptApi
queryRuleset: QueryRulesetApi
rankEval: typeof rankEvalApi
@ -178,6 +183,7 @@ export default interface API {
searchableSnapshots: SearchableSnapshotsApi
security: SecurityApi
shutdown: ShutdownApi
simulate: SimulateApi
slm: SlmApi
snapshot: SnapshotApi
sql: SqlApi
@ -200,6 +206,7 @@ const kAutoscaling = Symbol('Autoscaling')
const kCat = Symbol('Cat')
const kCcr = Symbol('Ccr')
const kCluster = Symbol('Cluster')
const kConnector = Symbol('Connector')
const kDanglingIndices = Symbol('DanglingIndices')
const kEnrich = Symbol('Enrich')
const kEql = Symbol('Eql')
@ -217,12 +224,14 @@ const kMigration = Symbol('Migration')
const kMl = Symbol('Ml')
const kMonitoring = Symbol('Monitoring')
const kNodes = Symbol('Nodes')
const kProfiling = Symbol('Profiling')
const kQueryRuleset = Symbol('QueryRuleset')
const kRollup = Symbol('Rollup')
const kSearchApplication = Symbol('SearchApplication')
const kSearchableSnapshots = Symbol('SearchableSnapshots')
const kSecurity = Symbol('Security')
const kShutdown = Symbol('Shutdown')
const kSimulate = Symbol('Simulate')
const kSlm = Symbol('Slm')
const kSnapshot = Symbol('Snapshot')
const kSql = Symbol('Sql')
@ -240,6 +249,7 @@ export default class API {
[kCat]: symbol | null
[kCcr]: symbol | null
[kCluster]: symbol | null
[kConnector]: symbol | null
[kDanglingIndices]: symbol | null
[kEnrich]: symbol | null
[kEql]: symbol | null
@ -257,12 +267,14 @@ export default class API {
[kMl]: symbol | null
[kMonitoring]: symbol | null
[kNodes]: symbol | null
[kProfiling]: symbol | null
[kQueryRuleset]: symbol | null
[kRollup]: symbol | null
[kSearchApplication]: symbol | null
[kSearchableSnapshots]: symbol | null
[kSecurity]: symbol | null
[kShutdown]: symbol | null
[kSimulate]: symbol | null
[kSlm]: symbol | null
[kSnapshot]: symbol | null
[kSql]: symbol | null
@ -279,6 +291,7 @@ export default class API {
this[kCat] = null
this[kCcr] = null
this[kCluster] = null
this[kConnector] = null
this[kDanglingIndices] = null
this[kEnrich] = null
this[kEql] = null
@ -296,12 +309,14 @@ export default class API {
this[kMl] = null
this[kMonitoring] = null
this[kNodes] = null
this[kProfiling] = null
this[kQueryRuleset] = null
this[kRollup] = null
this[kSearchApplication] = null
this[kSearchableSnapshots] = null
this[kSecurity] = null
this[kShutdown] = null
this[kSimulate] = null
this[kSlm] = null
this[kSnapshot] = null
this[kSql] = null
@ -376,6 +391,9 @@ Object.defineProperties(API.prototype, {
cluster: {
get () { return this[kCluster] === null ? (this[kCluster] = new ClusterApi(this.transport)) : this[kCluster] }
},
connector: {
get () { return this[kConnector] === null ? (this[kConnector] = new ConnectorApi(this.transport)) : this[kConnector] }
},
danglingIndices: {
get () { return this[kDanglingIndices] === null ? (this[kDanglingIndices] = new DanglingIndicesApi(this.transport)) : this[kDanglingIndices] }
},
@ -427,6 +445,9 @@ Object.defineProperties(API.prototype, {
nodes: {
get () { return this[kNodes] === null ? (this[kNodes] = new NodesApi(this.transport)) : this[kNodes] }
},
profiling: {
get () { return this[kProfiling] === null ? (this[kProfiling] = new ProfilingApi(this.transport)) : this[kProfiling] }
},
queryRuleset: {
get () { return this[kQueryRuleset] === null ? (this[kQueryRuleset] = new QueryRulesetApi(this.transport)) : this[kQueryRuleset] }
},
@ -445,6 +466,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

View File

@ -103,6 +103,24 @@ export interface OnDropDocument<TDocument = unknown> {
retried: boolean
}
type BulkResponseItem = Partial<Record<T.BulkOperationType, T.BulkResponseItem>>
export interface OnSuccessDocument<TDocument = unknown> {
result: BulkResponseItem
document?: TDocument
}
interface ZippedResult<TDocument = unknown> {
result: BulkResponseItem
raw: {
action: string
document?: string
}
// this is a function so that deserialization is only done when needed
// to avoid a performance hit
document?: () => TDocument
}
export interface BulkHelperOptions<TDocument = unknown> extends T.BulkRequest {
datasource: TDocument[] | Buffer | Readable | AsyncIterator<TDocument>
onDocument: (doc: TDocument) => Action
@ -112,6 +130,7 @@ export interface BulkHelperOptions<TDocument = unknown> extends T.BulkRequest {
retries?: number
wait?: number
onDrop?: (doc: OnDropDocument<TDocument>) => void
onSuccess?: (doc: OnSuccessDocument) => void
refreshOnCompletion?: boolean | string
}
@ -120,6 +139,29 @@ export interface BulkHelper<T> extends Promise<BulkStats> {
readonly stats: BulkStats
}
export interface EsqlColumn {
name: string
type: string
}
export type EsqlValue = any[]
export type EsqlRow = EsqlValue[]
export interface EsqlResponse {
columns: EsqlColumn[]
values: EsqlRow[]
}
export interface EsqlHelper {
toRecords: <TDocument>() => Promise<EsqlToRecords<TDocument>>
}
export interface EsqlToRecords<TDocument> {
columns: EsqlColumn[]
records: TDocument[]
}
const { ResponseError, ConfigurationError } = errors
const sleep = promisify(setTimeout)
const pImmediate = promisify(setImmediate)
@ -551,6 +593,9 @@ export default class Helpers {
retries = this[kMaxRetries],
wait = 5000,
onDrop = noop,
// onSuccess does not default to noop, to avoid the performance hit
// of deserializing every document in the bulk request
onSuccess,
refreshOnCompletion = false,
...bulkOptions
} = options
@ -817,57 +862,93 @@ export default class Helpers {
callback()
}
/**
* Zips bulk response items (the action's result) with the original document body.
* The raw string version of action and document lines are also included.
*/
function zipBulkResults (responseItems: BulkResponseItem[], bulkBody: string[]): ZippedResult[] {
const zipped = []
let indexSlice = 0
for (let i = 0, len = responseItems.length; i < len; i++) {
const result = responseItems[i]
const operation = Object.keys(result)[0]
let zipResult
if (operation === 'delete') {
zipResult = {
result,
raw: { action: bulkBody[indexSlice] }
}
indexSlice += 1
} else {
const document = bulkBody[indexSlice + 1]
zipResult = {
result,
raw: { action: bulkBody[indexSlice], document },
// this is a function so that deserialization is only done when needed
// to avoid a performance hit
document: () => serializer.deserialize(document)
}
indexSlice += 2
}
zipped.push(zipResult as ZippedResult)
}
return zipped
}
function tryBulk (bulkBody: string[], callback: (err: Error | null, bulkBody: string[]) => void): void {
if (shouldAbort) return callback(null, [])
client.bulk(Object.assign({}, bulkOptions, { body: bulkBody }), reqOptions as TransportRequestOptionsWithMeta)
.then(response => {
const result = response.body
const results = zipBulkResults(result.items, bulkBody)
if (!result.errors) {
stats.successful += result.items.length
for (const item of result.items) {
if (item.update?.result === 'noop') {
for (const item of results) {
const { result, document = noop } = item
if (result.update?.result === 'noop') {
stats.noop++
}
if (onSuccess != null) onSuccess({ result, document: document() })
}
return callback(null, [])
}
const retry = []
const { items } = result
let indexSlice = 0
for (let i = 0, len = items.length; i < len; i++) {
const action = items[i]
const operation = Object.keys(action)[0]
for (const item of results) {
const { result, raw, document = noop } = item
const operation = Object.keys(result)[0]
// @ts-expect-error
const responseItem = action[operation as keyof T.BulkResponseItemContainer]
const responseItem = result[operation as keyof T.BulkResponseItemContainer]
assert(responseItem !== undefined, 'The responseItem is undefined, please file a bug report')
if (responseItem.status >= 400) {
// 429 is the only staus code where we might want to retry
// 429 is the only status code where we might want to retry
// a document, because it was not an error in the document itself,
// but the ES node were handling too many operations.
// but the ES node was handling too many operations.
if (responseItem.status === 429) {
retry.push(bulkBody[indexSlice])
retry.push(raw.action)
/* istanbul ignore next */
if (operation !== 'delete') {
retry.push(bulkBody[indexSlice + 1])
retry.push(raw.document ?? '')
}
} else {
onDrop({
status: responseItem.status,
error: responseItem.error ?? null,
operation: serializer.deserialize(bulkBody[indexSlice]),
operation: serializer.deserialize(raw.action),
// @ts-expect-error
document: operation !== 'delete'
? serializer.deserialize(bulkBody[indexSlice + 1])
: null,
document: document(),
retried: isRetrying
})
stats.failed += 1
}
} else {
stats.successful += 1
if (onSuccess != null) onSuccess({ result, document: document() })
}
operation === 'delete' ? indexSlice += 1 : indexSlice += 2
}
callback(null, retry)
})
@ -877,6 +958,49 @@ export default class Helpers {
}
}
}
/**
* Creates an ES|QL helper instance, to help transform the data returned by an ES|QL query into easy-to-use formats.
* @param {object} params - Request parameters sent to esql.query()
* @returns {object} EsqlHelper instance
*/
esql (params: T.EsqlQueryRequest, reqOptions: TransportRequestOptions = {}): EsqlHelper {
if (this[kMetaHeader] !== null) {
reqOptions.headers = reqOptions.headers ?? {}
reqOptions.headers['x-elastic-client-meta'] = `${this[kMetaHeader] as string},h=qo`
}
const client = this[kClient]
function toRecords<TDocument> (response: EsqlResponse): TDocument[] {
const { columns, values } = response
return values.map(row => {
const doc: Partial<TDocument> = {}
row.forEach((cell, index) => {
const { name } = columns[index]
// @ts-expect-error
doc[name] = cell
})
return doc as TDocument
})
}
const helper: EsqlHelper = {
/**
* Pivots ES|QL query results into an array of row objects, rather than the default format where each row is an array of values.
*/
async toRecords<TDocument>(): Promise<EsqlToRecords<TDocument>> {
params.format = 'json'
// @ts-expect-error it's typed as ArrayBuffer but we know it will be JSON
const response: EsqlResponse = await client.esql.query(params, reqOptions)
const records: TDocument[] = toRecords(response)
const { columns } = response
return { records, columns }
}
}
return helper
}
}
// Using a getter will improve the overall performances of the code,

View File

@ -514,7 +514,7 @@ test('bulk index', t => {
t.test('Server error', async t => {
const MockConnection = connection.buildMockConnection({
onRequest (params) {
onRequest (_params) {
return {
statusCode: 500,
body: { somothing: 'went wrong' }
@ -530,12 +530,12 @@ test('bulk index', t => {
datasource: dataset.slice(),
flushBytes: 1,
concurrency: 1,
onDocument (doc) {
onDocument (_doc) {
return {
index: { _index: 'test' }
}
},
onDrop (doc) {
onDrop (_doc) {
t.fail('This should never be called')
}
})
@ -550,7 +550,7 @@ test('bulk index', t => {
t.test('Server error (high flush size, to trigger the finish error)', async t => {
const MockConnection = connection.buildMockConnection({
onRequest (params) {
onRequest (_params) {
return {
statusCode: 500,
body: { somothing: 'went wrong' }
@ -566,12 +566,12 @@ test('bulk index', t => {
datasource: dataset.slice(),
flushBytes: 5000000,
concurrency: 1,
onDocument (doc) {
onDocument (_doc) {
return {
index: { _index: 'test' }
}
},
onDrop (doc) {
onDrop (_doc) {
t.fail('This should never be called')
}
})
@ -625,12 +625,12 @@ test('bulk index', t => {
flushBytes: 1,
concurrency: 1,
wait: 10,
onDocument (doc) {
onDocument (_doc) {
return {
index: { _index: 'test' }
}
},
onDrop (doc) {
onDrop (_doc) {
b.abort()
}
})
@ -651,7 +651,7 @@ test('bulk index', t => {
t.test('Invalid operation', t => {
t.plan(2)
const MockConnection = connection.buildMockConnection({
onRequest (params) {
onRequest (_params) {
return { body: { errors: false, items: [{}] } }
}
})
@ -666,7 +666,7 @@ test('bulk index', t => {
flushBytes: 1,
concurrency: 1,
// @ts-expect-error
onDocument (doc) {
onDocument (_doc) {
return {
foo: { _index: 'test' }
}
@ -678,6 +678,43 @@ test('bulk index', t => {
})
})
t.test('should call onSuccess callback for each indexed document', async t => {
const MockConnection = connection.buildMockConnection({
onRequest (params) {
// @ts-expect-error
let [action] = params.body.split('\n')
action = JSON.parse(action)
return { body: { errors: false, items: [action] } }
}
})
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnection
})
let count = 0
await client.helpers.bulk<Document>({
datasource: dataset.slice(),
flushBytes: 1,
concurrency: 1,
onDocument (_doc) {
return {
index: { _index: 'test' }
}
},
onSuccess ({ result, document }) {
t.same(result, { index: { _index: 'test' }})
t.same(document, dataset[count++])
},
onDrop (_doc) {
t.fail('This should never be called')
}
})
t.equal(count, 3)
t.end()
})
t.end()
})
@ -731,6 +768,44 @@ test('bulk index', t => {
})
})
t.test('onSuccess is called for each indexed document', async t => {
const MockConnection = connection.buildMockConnection({
onRequest (params) {
// @ts-expect-error
let [action] = params.body.split('\n')
action = JSON.parse(action)
return { body: { errors: false, items: [action] } }
}
})
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnection
})
const stream = createReadStream(join(__dirname, '..', '..', 'fixtures', 'small-dataset.ndjson'), 'utf8')
let count = 0
await client.helpers.bulk<Document>({
datasource: stream.pipe(split()),
flushBytes: 1,
concurrency: 1,
onDocument (_doc) {
return {
index: { _index: 'test' }
}
},
onSuccess ({ result, document }) {
t.same(result, { index: { _index: 'test' }})
t.same(document, dataset[count++])
},
onDrop (_doc) {
t.fail('This should never be called')
}
})
t.equal(count, 3)
t.end()
})
t.end()
})
@ -785,6 +860,50 @@ test('bulk index', t => {
aborted: false
})
})
t.test('onSuccess is called for each indexed document', async t => {
const MockConnection = connection.buildMockConnection({
onRequest (params) {
// @ts-expect-error
let [action] = params.body.split('\n')
action = JSON.parse(action)
return { body: { errors: false, items: [action] } }
}
})
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnection
})
async function * generator () {
const data = dataset.slice()
for (const doc of data) {
yield doc
}
}
let count = 0
await client.helpers.bulk<Document>({
datasource: generator(),
flushBytes: 1,
concurrency: 1,
onDocument (_doc) {
return {
index: { _index: 'test' }
}
},
onSuccess ({ result, document }) {
t.same(result, { index: { _index: 'test' }})
t.same(document, dataset[count++])
},
onDrop (_doc) {
t.fail('This should never be called')
}
})
t.equal(count, 3)
t.end()
})
t.end()
})
@ -943,6 +1062,8 @@ test('bulk create', t => {
})
})
t.end()
})
@ -1279,6 +1400,63 @@ test('bulk delete', t => {
server.stop()
})
t.test('should call onSuccess callback with delete action object', async t => {
const MockConnection = connection.buildMockConnection({
onRequest (params) {
// @ts-expect-error
let [action, payload] = params.body.split('\n')
action = JSON.parse(action)
return { body: { errors: false, items: [action] } }
}
})
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnection
})
let docCount = 0
let successCount = 0
await client.helpers.bulk<Document>({
datasource: dataset.slice(),
flushBytes: 1,
concurrency: 1,
onDocument (_doc) {
if (docCount++ === 1) {
return {
delete: {
_index: 'test',
_id: String(docCount)
}
}
} else {
return {
index: { _index: 'test' }
}
}
},
onSuccess ({ result, document }) {
const item = dataset[successCount]
if (successCount++ === 1) {
t.same(result, {
delete: {
_index: 'test',
_id: String(successCount)
}
})
} else {
t.same(result, { index: { _index: 'test' }})
t.same(document, item)
}
},
onDrop (_doc) {
t.fail('This should never be called')
}
})
t.end()
})
t.end()
})
@ -1594,9 +1772,6 @@ test('Flush interval', t => {
})
})
t.end()
})
test(`flush timeout does not lock process when flushInterval is less than server timeout`, async t => {
const flushInterval = 500
@ -1743,3 +1918,7 @@ test(`flush timeout does not lock process when flushInterval is equal to server
server.stop()
})
t.end()
})

Some files were not shown because too many files have changed in this diff Show More