Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 496161acdf | |||
| 542c377459 | |||
| 2ea3979e95 | |||
| 5603482c43 | |||
| ba2955947e | |||
| 768295bdb0 | |||
| b159d474b0 | |||
| bda15ca3ca |
@ -1,4 +1,4 @@
|
||||
ARG NODE_JS_VERSION=10
|
||||
ARG NODE_JS_VERSION=16
|
||||
FROM node:${NODE_JS_VERSION}
|
||||
|
||||
# Create app directory
|
||||
|
||||
125
.ci/make.mjs
Normal file
125
.ci/make.mjs
Normal file
@ -0,0 +1,125 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* global $ argv */
|
||||
|
||||
'use strict'
|
||||
|
||||
import 'zx/globals'
|
||||
|
||||
import { readFile, writeFile } from 'fs/promises'
|
||||
import assert from 'assert'
|
||||
import { join } from 'desm'
|
||||
import semver from 'semver'
|
||||
|
||||
assert(typeof argv.task === 'string', 'Missing task parameter')
|
||||
|
||||
switch (argv.task) {
|
||||
case 'release':
|
||||
release(argv._).catch(onError)
|
||||
break
|
||||
case 'bump':
|
||||
bump(argv._).catch(onError)
|
||||
break
|
||||
case 'codegen':
|
||||
codegen(argv._).catch(onError)
|
||||
break
|
||||
default:
|
||||
console.log(`Unknown task: ${argv.task}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
async function release (args) {
|
||||
assert(args.length === 2, 'Release task expects two parameters')
|
||||
let [version, outputFolder] = args
|
||||
|
||||
if (process.env.WORKFLOW === 'snapshot' && !version.endsWith('SNAPSHOT')) {
|
||||
version = `${version}-SNAPSHOT`
|
||||
}
|
||||
|
||||
await bump([version])
|
||||
|
||||
const packageJson = JSON.parse(await readFile(
|
||||
join(import.meta.url, '..', 'package.json'),
|
||||
'utf8'
|
||||
))
|
||||
|
||||
await $`npm run build`
|
||||
await $`npm pack`
|
||||
await $`zip elasticsearch-js-${version}.zip elastic-elasticsearch-${packageJson.version}.tgz`
|
||||
await $`rm elastic-elasticsearch-${packageJson.version}.tgz`
|
||||
await $`mv ${join(import.meta.url, '..', `elasticsearch-js-${version}.zip`)} ${join(import.meta.url, '..', outputFolder, `elasticsearch-js-${version}.zip`)}`
|
||||
}
|
||||
|
||||
async function bump (args) {
|
||||
assert(args.length === 1, 'Bump task expects one parameter')
|
||||
const [version] = args
|
||||
const packageJson = JSON.parse(await readFile(
|
||||
join(import.meta.url, '..', 'package.json'),
|
||||
'utf8'
|
||||
))
|
||||
|
||||
const cleanVersion = semver.clean(version.includes('SNAPSHOT') ? version.split('-')[0] : version)
|
||||
assert(semver.valid(cleanVersion))
|
||||
packageJson.version = cleanVersion
|
||||
packageJson.versionCanary = `${cleanVersion}-canary.0`
|
||||
|
||||
await writeFile(
|
||||
join(import.meta.url, '..', 'package.json'),
|
||||
JSON.stringify(packageJson, null, 2),
|
||||
'utf8'
|
||||
)
|
||||
|
||||
const testMatrix = await readFile(join(import.meta.url, 'test-matrix.yml'), 'utf8')
|
||||
await writeFile(
|
||||
join(import.meta.url, 'test-matrix.yml'),
|
||||
testMatrix.replace(/STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"/, `STACK_VERSION:\n - "${cleanVersion}-SNAPSHOT"`), // eslint-disable-line
|
||||
'utf8'
|
||||
)
|
||||
}
|
||||
|
||||
// this command can only be executed locally for now
|
||||
async function codegen (args) {
|
||||
assert(args.length === 1, 'Bump task expects one parameter')
|
||||
const clientGeneratorPath = join(import.meta.url, '..', '..', 'elastic-client-generator-js')
|
||||
const [version] = args
|
||||
|
||||
const isGeneratorCloned = await $`[[ -d ${clientGeneratorPath} ]]`.exitCode === 0
|
||||
assert(isGeneratorCloned, 'You must clone the elastic-client-generator-js first')
|
||||
|
||||
await $`npm install --prefix ${clientGeneratorPath}`
|
||||
// this command will take a while!
|
||||
if (version === 'main') {
|
||||
await $`npm run elasticsearch --prefix ${clientGeneratorPath} -- --version main`
|
||||
} else {
|
||||
await $`npm run elasticsearch --prefix ${clientGeneratorPath} -- --version ${version.split('.').slice(0, 2).join('.')}`
|
||||
}
|
||||
await $`npm run lint --prefix ${clientGeneratorPath}`
|
||||
|
||||
await $`rm -rf ${join(import.meta.url, '..', 'src', 'api')}`
|
||||
await $`mkdir ${join(import.meta.url, '..', 'src', 'api')}`
|
||||
await $`cp -R ${join(import.meta.url, '..', '..', 'elastic-client-generator-js', 'output')}/* ${join(import.meta.url, '..', 'src', 'api')}`
|
||||
await $`mv ${join(import.meta.url, '..', 'src', 'api', 'reference.asciidoc')} ${join(import.meta.url, '..', 'docs', 'reference.asciidoc')}`
|
||||
await $`npm run build`
|
||||
}
|
||||
|
||||
function onError (err) {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
}
|
||||
180
.ci/make.sh
Executable file
180
.ci/make.sh
Executable file
@ -0,0 +1,180 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# ------------------------------------------------------- #
|
||||
#
|
||||
# Skeleton for common build entry script for all elastic
|
||||
# clients. Needs to be adapted to individual client usage.
|
||||
#
|
||||
# Must be called: ./.ci/make.sh <target> <params>
|
||||
#
|
||||
# Version: 1.1.0
|
||||
#
|
||||
# Targets:
|
||||
# ---------------------------
|
||||
# assemble <VERSION> : build client artefacts with version
|
||||
# bump <VERSION> : bump client internals to version
|
||||
# codegen <VERSION> : generate endpoints
|
||||
# docsgen <VERSION> : generate documentation
|
||||
# examplegen : generate the doc examples
|
||||
# clean : clean workspace
|
||||
#
|
||||
# ------------------------------------------------------- #
|
||||
|
||||
# ------------------------------------------------------- #
|
||||
# Bootstrap
|
||||
# ------------------------------------------------------- #
|
||||
|
||||
script_path=$(dirname "$(realpath -s "$0")")
|
||||
repo=$(realpath "$script_path/../")
|
||||
generator=$(realpath "$script_path/../../elastic-client-generator-js")
|
||||
|
||||
# shellcheck disable=SC1090
|
||||
CMD=$1
|
||||
TASK=$1
|
||||
TASK_ARGS=()
|
||||
VERSION=$2
|
||||
STACK_VERSION=$VERSION
|
||||
NODE_JS_VERSION=16
|
||||
WORKFLOW=${WORKFLOW-staging}
|
||||
set -euo pipefail
|
||||
|
||||
product="elastic/elasticsearch-js"
|
||||
output_folder=".ci/output"
|
||||
OUTPUT_DIR="$repo/${output_folder}"
|
||||
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
|
||||
echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
|
||||
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
|
||||
echo -e "\033[34;1mINFO:\033[0m OUTPUT_DIR ${OUTPUT_DIR}\033[0m"
|
||||
|
||||
# ------------------------------------------------------- #
|
||||
# Parse Command
|
||||
# ------------------------------------------------------- #
|
||||
|
||||
case $CMD in
|
||||
clean)
|
||||
echo -e "\033[36;1mTARGET: clean workspace $output_folder\033[0m"
|
||||
rm -rf "$output_folder"
|
||||
echo -e "\033[32;1mdone.\033[0m"
|
||||
exit 0
|
||||
;;
|
||||
assemble)
|
||||
if [ -v $VERSION ]; then
|
||||
echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
echo -e "\033[36;1mTARGET: assemble artefact $VERSION\033[0m"
|
||||
TASK=release
|
||||
TASK_ARGS=("$VERSION" "$output_folder")
|
||||
;;
|
||||
codegen)
|
||||
if [ -v $VERSION ]; then
|
||||
echo -e "\033[31;1mTARGET: codegen -> missing version parameter\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
|
||||
TASK=codegen
|
||||
# VERSION is BRANCH here for now
|
||||
TASK_ARGS=("$VERSION")
|
||||
;;
|
||||
docsgen)
|
||||
if [ -v $VERSION ]; then
|
||||
echo -e "\033[31;1mTARGET: docsgen -> missing version parameter\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
echo -e "\033[36;1mTARGET: generate docs for $VERSION\033[0m"
|
||||
TASK=codegen
|
||||
# VERSION is BRANCH here for now
|
||||
TASK_ARGS=("$VERSION" "$codegen_folder")
|
||||
;;
|
||||
examplesgen)
|
||||
echo -e "\033[36;1mTARGET: generate examples\033[0m"
|
||||
TASK=codegen
|
||||
# VERSION is BRANCH here for now
|
||||
TASK_ARGS=("$VERSION" "$codegen_folder")
|
||||
;;
|
||||
bump)
|
||||
if [ -v $VERSION ]; then
|
||||
echo -e "\033[31;1mTARGET: bump -> missing version parameter\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
echo -e "\033[36;1mTARGET: bump to version $VERSION\033[0m"
|
||||
TASK=bump
|
||||
# VERSION is BRANCH here for now
|
||||
TASK_ARGS=("$VERSION")
|
||||
;;
|
||||
*)
|
||||
echo -e "\nUsage:\n\t $CMD is not supported right now\n"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
||||
# ------------------------------------------------------- #
|
||||
# Build Container
|
||||
# ------------------------------------------------------- #
|
||||
|
||||
echo -e "\033[34;1mINFO: building $product container\033[0m"
|
||||
|
||||
docker build \
|
||||
--file .ci/Dockerfile \
|
||||
--tag ${product} \
|
||||
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
|
||||
--build-arg USER_ID="$(id -u)" \
|
||||
--build-arg GROUP_ID="$(id -g)" \
|
||||
.
|
||||
|
||||
# ------------------------------------------------------- #
|
||||
# Run the Container
|
||||
# ------------------------------------------------------- #
|
||||
|
||||
echo -e "\033[34;1mINFO: running $product container\033[0m"
|
||||
|
||||
docker run \
|
||||
--volume $repo:/usr/src/app \
|
||||
--volume $generator:/usr/src/elastic-client-generator-js \
|
||||
--volume /usr/src/app/node_modules \
|
||||
--env "WORKFLOW=${WORKFLOW}" \
|
||||
--name make-elasticsearch-js \
|
||||
--rm \
|
||||
$product \
|
||||
node .ci/make.mjs --task $TASK ${TASK_ARGS[*]}
|
||||
|
||||
# ------------------------------------------------------- #
|
||||
# Post Command tasks & checks
|
||||
# ------------------------------------------------------- #
|
||||
|
||||
if [[ "$CMD" == "assemble" ]]; then
|
||||
if compgen -G ".ci/output/*" > /dev/null; then
|
||||
echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m"
|
||||
else
|
||||
echo -e "\033[31;1mTARGET: assemble failed, empty workspace!\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$CMD" == "bump" ]]; then
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo -e "\033[32;1mTARGET: successfully bumped client v$VERSION\033[0m"
|
||||
else
|
||||
echo -e "\033[31;1mTARGET: failed bumped client v$VERSION\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$CMD" == "codegen" ]]; then
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo -e "\033[32;1mTARGET: successfully generated client v$VERSION\033[0m"
|
||||
else
|
||||
echo -e "\033[31;1mTARGET: failed generating client v$VERSION\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$CMD" == "docsgen" ]]; then
|
||||
echo "TODO"
|
||||
fi
|
||||
|
||||
if [[ "$CMD" == "examplesgen" ]]; then
|
||||
echo "TODO"
|
||||
fi
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
STACK_VERSION:
|
||||
- 8.2.0-SNAPSHOT
|
||||
- "8.2.0-SNAPSHOT"
|
||||
|
||||
NODE_JS_VERSION:
|
||||
- 18
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
# Elasticsearch Node.js client
|
||||
|
||||
[](http://standardjs.com/) [](https://clients-ci.elastic.co/view/Javascript/job/elastic+elasticsearch-js+main/) [](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [](https://codecov.io/gh/elastic/elasticsearch-js) [](https://www.npmjs.com/package/@elastic/elasticsearch)
|
||||
[](http://standardjs.com/) [](https://clients-ci.elastic.co/view/JavaScript/job/elastic+elasticsearch-js+main/) [](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [](https://codecov.io/gh/elastic/elasticsearch-js) [](https://www.npmjs.com/package/@elastic/elasticsearch)
|
||||
|
||||
The official Node.js client for Elasticsearch.
|
||||
|
||||
|
||||
@ -1,6 +1,84 @@
|
||||
[[changelog-client]]
|
||||
== Release notes
|
||||
|
||||
[discrete]
|
||||
=== 8.2.1
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.2.1`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/release-notes-8.2.1.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Fix ndjson APIs https://github.com/elastic/elasticsearch-js/pull/1688[#1688]
|
||||
|
||||
The previous release contained a bug that broken ndjson APIs.
|
||||
We have released `v8.2.0-patch.1` to address this.
|
||||
This fix is the same as the one we have released and we storngly recommend upgrading to this version.
|
||||
|
||||
[discrete]
|
||||
===== Fix node shutdown apis https://github.com/elastic/elasticsearch-js/pull/1697[#1697]
|
||||
|
||||
The shutdown APIs wheren't complete, this fix completes them.
|
||||
|
||||
[discrete]
|
||||
==== Types: move query keys to body https://github.com/elastic/elasticsearch-js/pull/1693[#1693]
|
||||
|
||||
The types definitions where wrongly representing the types of fields present in both query and body.
|
||||
|
||||
[discrete]
|
||||
=== 8.2.0
|
||||
|
||||
[discrete]
|
||||
==== Breaking changes
|
||||
|
||||
[discrete]
|
||||
===== Drop Node.js v12 https://github.com/elastic/elasticsearch-js/pull/1670[#1670]
|
||||
|
||||
According to our https://github.com/elastic/elasticsearch-js#nodejs-support[Node.js support matrix].
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.2`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/release-notes-8.2.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== More lenient parameter checks https://github.com/elastic/elasticsearch-js/pull/1662[#1662]
|
||||
|
||||
When creating a new client, an `undefined` `caFingerprint` no longer trigger an error for a http connection.
|
||||
|
||||
[discrete]
|
||||
===== Update TypeScript docs and export estypes https://github.com/elastic/elasticsearch-js/pull/1675[#1675]
|
||||
|
||||
You can import the full TypeScript requests & responses definitions as it follows:
|
||||
[source,ts]
|
||||
----
|
||||
import { estypes } from '@elastic/elasticsearch'
|
||||
----
|
||||
|
||||
If you need the legacy definitions with the body, you can do the following:
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
import { estypesWithBody } from '@elastic/elasticsearch'
|
||||
----
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Updated hpagent to the latest version https://github.com/elastic/elastic-transport-js/pull/49[transport/#49]
|
||||
|
||||
You can fing the related changes https://github.com/delvedor/hpagent/releases/tag/v1.0.0[here].
|
||||
|
||||
[discrete]
|
||||
=== 8.1.0
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
=== bulk
|
||||
Allows to perform multiple index/update/delete operations in a single request.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/docs-bulk.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.bulk(...)
|
||||
@ -39,7 +39,7 @@ client.bulk(...)
|
||||
=== clear_scroll
|
||||
Explicitly clears the search context for a scroll.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/clear-scroll-api.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.clearScroll(...)
|
||||
@ -49,7 +49,7 @@ client.clearScroll(...)
|
||||
=== close_point_in_time
|
||||
Close a point in time
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/point-in-time-api.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.closePointInTime(...)
|
||||
@ -281,7 +281,7 @@ client.mtermvectors(...)
|
||||
=== open_point_in_time
|
||||
Open a point in time that can be used in subsequent searches
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/point-in-time-api.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.openPointInTime(...)
|
||||
@ -466,7 +466,7 @@ client.updateByQueryRethrottle(...)
|
||||
==== delete
|
||||
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.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/async-search.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.asyncSearch.delete(...)
|
||||
@ -476,7 +476,7 @@ client.asyncSearch.delete(...)
|
||||
==== get
|
||||
Retrieves the results of a previously submitted async search request given its ID.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/async-search.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.asyncSearch.get(...)
|
||||
@ -486,7 +486,7 @@ client.asyncSearch.get(...)
|
||||
==== status
|
||||
Retrieves the status of a previously submitted async search request given its ID.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/async-search.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.asyncSearch.status(...)
|
||||
@ -496,7 +496,7 @@ client.asyncSearch.status(...)
|
||||
==== submit
|
||||
Executes a search request asynchronously.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/async-search.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.asyncSearch.submit(...)
|
||||
@ -508,7 +508,7 @@ client.asyncSearch.submit(...)
|
||||
==== aliases
|
||||
Shows information about currently configured aliases to indices including filter and routing infos.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-alias.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.aliases(...)
|
||||
@ -518,7 +518,7 @@ client.cat.aliases(...)
|
||||
==== allocation
|
||||
Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-allocation.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.allocation(...)
|
||||
@ -536,7 +536,7 @@ client.cat.componentTemplates(...)
|
||||
==== count
|
||||
Provides quick access to the document count of the entire cluster, or individual indices.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-count.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.count(...)
|
||||
@ -546,7 +546,7 @@ client.cat.count(...)
|
||||
==== fielddata
|
||||
Shows how much heap memory is currently being used by fielddata on every data node in the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-fielddata.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.fielddata(...)
|
||||
@ -556,7 +556,7 @@ client.cat.fielddata(...)
|
||||
==== health
|
||||
Returns a concise representation of the cluster health.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-health.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.health(...)
|
||||
@ -566,7 +566,7 @@ client.cat.health(...)
|
||||
==== help
|
||||
Returns help for the Cat APIs.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.help(...)
|
||||
@ -576,7 +576,7 @@ client.cat.help(...)
|
||||
==== indices
|
||||
Returns information about indices: number of primaries and replicas, document counts, disk size, ...
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-indices.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.indices(...)
|
||||
@ -586,7 +586,7 @@ client.cat.indices(...)
|
||||
==== master
|
||||
Returns information about the master node.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-master.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.master(...)
|
||||
@ -596,7 +596,7 @@ client.cat.master(...)
|
||||
==== ml_data_frame_analytics
|
||||
Gets configuration and usage information about data frame analytics jobs.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-dfanalytics.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-dfanalytics.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.mlDataFrameAnalytics(...)
|
||||
@ -606,7 +606,7 @@ client.cat.mlDataFrameAnalytics(...)
|
||||
==== ml_datafeeds
|
||||
Gets configuration and usage information about datafeeds.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-datafeeds.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-datafeeds.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.mlDatafeeds(...)
|
||||
@ -616,7 +616,7 @@ client.cat.mlDatafeeds(...)
|
||||
==== ml_jobs
|
||||
Gets configuration and usage information about anomaly detection jobs.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-anomaly-detectors.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-anomaly-detectors.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.mlJobs(...)
|
||||
@ -626,7 +626,7 @@ client.cat.mlJobs(...)
|
||||
==== ml_trained_models
|
||||
Gets configuration and usage information about inference trained models.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-trained-model.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-trained-model.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.mlTrainedModels(...)
|
||||
@ -636,7 +636,7 @@ client.cat.mlTrainedModels(...)
|
||||
==== nodeattrs
|
||||
Returns information about custom node attributes.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-nodeattrs.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.nodeattrs(...)
|
||||
@ -646,7 +646,7 @@ client.cat.nodeattrs(...)
|
||||
==== nodes
|
||||
Returns basic statistics about performance of cluster nodes.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-nodes.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.nodes(...)
|
||||
@ -656,7 +656,7 @@ client.cat.nodes(...)
|
||||
==== pending_tasks
|
||||
Returns a concise representation of the cluster pending tasks.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-pending-tasks.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.pendingTasks(...)
|
||||
@ -666,7 +666,7 @@ client.cat.pendingTasks(...)
|
||||
==== plugins
|
||||
Returns information about installed plugins across nodes node.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-plugins.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.plugins(...)
|
||||
@ -676,7 +676,7 @@ client.cat.plugins(...)
|
||||
==== recovery
|
||||
Returns information about index shard recoveries, both on-going completed.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-recovery.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.recovery(...)
|
||||
@ -686,7 +686,7 @@ client.cat.recovery(...)
|
||||
==== repositories
|
||||
Returns information about snapshot repositories registered in the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-repositories.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.repositories(...)
|
||||
@ -696,7 +696,7 @@ client.cat.repositories(...)
|
||||
==== segments
|
||||
Provides low-level information about the segments in the shards of an index.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-segments.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.segments(...)
|
||||
@ -706,7 +706,7 @@ client.cat.segments(...)
|
||||
==== shards
|
||||
Provides a detailed view of shard allocation on nodes.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-shards.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.shards(...)
|
||||
@ -716,7 +716,7 @@ client.cat.shards(...)
|
||||
==== snapshots
|
||||
Returns all snapshots in a specific repository.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-snapshots.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.snapshots(...)
|
||||
@ -726,7 +726,7 @@ client.cat.snapshots(...)
|
||||
==== tasks
|
||||
Returns information about the tasks currently executing on one or more nodes in the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/tasks.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.tasks(...)
|
||||
@ -736,7 +736,7 @@ client.cat.tasks(...)
|
||||
==== templates
|
||||
Returns information about existing templates.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-templates.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.templates(...)
|
||||
@ -747,7 +747,7 @@ client.cat.templates(...)
|
||||
Returns cluster-wide thread pool statistics per node.
|
||||
By default the active, queue and rejected statistics are returned for all thread pools.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-thread-pool.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.threadPool(...)
|
||||
@ -757,7 +757,7 @@ client.cat.threadPool(...)
|
||||
==== transforms
|
||||
Gets configuration and usage information about transforms.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-transforms.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cat-transforms.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cat.transforms(...)
|
||||
@ -769,7 +769,7 @@ client.cat.transforms(...)
|
||||
==== delete_auto_follow_pattern
|
||||
Deletes auto-follow patterns.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-delete-auto-follow-pattern.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-delete-auto-follow-pattern.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.deleteAutoFollowPattern(...)
|
||||
@ -779,7 +779,7 @@ client.ccr.deleteAutoFollowPattern(...)
|
||||
==== follow
|
||||
Creates a new follower index configured to follow the referenced leader index.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-put-follow.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-put-follow.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.follow(...)
|
||||
@ -789,7 +789,7 @@ client.ccr.follow(...)
|
||||
==== follow_info
|
||||
Retrieves information about all follower indices, including parameters and status for each follower index
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-get-follow-info.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-get-follow-info.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.followInfo(...)
|
||||
@ -799,7 +799,7 @@ client.ccr.followInfo(...)
|
||||
==== follow_stats
|
||||
Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-get-follow-stats.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-get-follow-stats.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.followStats(...)
|
||||
@ -809,7 +809,7 @@ client.ccr.followStats(...)
|
||||
==== forget_follower
|
||||
Removes the follower retention leases from the leader.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-post-forget-follower.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-post-forget-follower.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.forgetFollower(...)
|
||||
@ -819,7 +819,7 @@ client.ccr.forgetFollower(...)
|
||||
==== get_auto_follow_pattern
|
||||
Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-get-auto-follow-pattern.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-get-auto-follow-pattern.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.getAutoFollowPattern(...)
|
||||
@ -829,7 +829,7 @@ client.ccr.getAutoFollowPattern(...)
|
||||
==== pause_auto_follow_pattern
|
||||
Pauses an auto-follow pattern
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-pause-auto-follow-pattern.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-pause-auto-follow-pattern.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.pauseAutoFollowPattern(...)
|
||||
@ -839,7 +839,7 @@ client.ccr.pauseAutoFollowPattern(...)
|
||||
==== pause_follow
|
||||
Pauses a follower index. The follower index will not fetch any additional operations from the leader index.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-post-pause-follow.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-post-pause-follow.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.pauseFollow(...)
|
||||
@ -849,7 +849,7 @@ client.ccr.pauseFollow(...)
|
||||
==== put_auto_follow_pattern
|
||||
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.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-put-auto-follow-pattern.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-put-auto-follow-pattern.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.putAutoFollowPattern(...)
|
||||
@ -859,7 +859,7 @@ client.ccr.putAutoFollowPattern(...)
|
||||
==== resume_auto_follow_pattern
|
||||
Resumes an auto-follow pattern that has been paused
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-resume-auto-follow-pattern.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-resume-auto-follow-pattern.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.resumeAutoFollowPattern(...)
|
||||
@ -869,7 +869,7 @@ client.ccr.resumeAutoFollowPattern(...)
|
||||
==== resume_follow
|
||||
Resumes a follower index that has been paused
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-post-resume-follow.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-post-resume-follow.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.resumeFollow(...)
|
||||
@ -879,7 +879,7 @@ client.ccr.resumeFollow(...)
|
||||
==== stats
|
||||
Gets all stats related to cross-cluster replication.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-get-stats.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-get-stats.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.stats(...)
|
||||
@ -889,7 +889,7 @@ client.ccr.stats(...)
|
||||
==== unfollow
|
||||
Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-post-unfollow.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ccr-post-unfollow.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ccr.unfollow(...)
|
||||
@ -901,7 +901,7 @@ client.ccr.unfollow(...)
|
||||
==== allocation_explain
|
||||
Provides explanations for shard allocations in the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-allocation-explain.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.allocationExplain(...)
|
||||
@ -911,7 +911,7 @@ client.cluster.allocationExplain(...)
|
||||
==== delete_component_template
|
||||
Deletes a component template
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/indices-component-template.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.deleteComponentTemplate(...)
|
||||
@ -921,7 +921,7 @@ client.cluster.deleteComponentTemplate(...)
|
||||
==== delete_voting_config_exclusions
|
||||
Clears cluster voting config exclusions.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/voting-config-exclusions.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.deleteVotingConfigExclusions(...)
|
||||
@ -931,7 +931,7 @@ client.cluster.deleteVotingConfigExclusions(...)
|
||||
==== exists_component_template
|
||||
Returns information about whether a particular component template exist
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/indices-component-template.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.existsComponentTemplate(...)
|
||||
@ -941,7 +941,7 @@ client.cluster.existsComponentTemplate(...)
|
||||
==== get_component_template
|
||||
Returns one or more component templates
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/indices-component-template.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.getComponentTemplate(...)
|
||||
@ -951,7 +951,7 @@ client.cluster.getComponentTemplate(...)
|
||||
==== get_settings
|
||||
Returns cluster settings.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-get-settings.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-get-settings.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.getSettings(...)
|
||||
@ -961,7 +961,7 @@ client.cluster.getSettings(...)
|
||||
==== health
|
||||
Returns basic information about the health of the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-health.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.health(...)
|
||||
@ -972,7 +972,7 @@ client.cluster.health(...)
|
||||
Returns a list of any cluster-level changes (e.g. create index, update mapping,
|
||||
allocate or fail shard) which have not yet been executed.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-pending.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.pendingTasks(...)
|
||||
@ -982,7 +982,7 @@ client.cluster.pendingTasks(...)
|
||||
==== post_voting_config_exclusions
|
||||
Updates the cluster voting config exclusions by node ids or node names.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/voting-config-exclusions.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.postVotingConfigExclusions(...)
|
||||
@ -992,7 +992,7 @@ client.cluster.postVotingConfigExclusions(...)
|
||||
==== put_component_template
|
||||
Creates or updates a component template
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/indices-component-template.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.putComponentTemplate(...)
|
||||
@ -1002,7 +1002,7 @@ client.cluster.putComponentTemplate(...)
|
||||
==== put_settings
|
||||
Updates the cluster settings.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-update-settings.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.putSettings(...)
|
||||
@ -1012,7 +1012,7 @@ client.cluster.putSettings(...)
|
||||
==== remote_info
|
||||
Returns the information about configured remote clusters.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-remote-info.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.remoteInfo(...)
|
||||
@ -1022,7 +1022,7 @@ client.cluster.remoteInfo(...)
|
||||
==== reroute
|
||||
Allows to manually change the allocation of individual shards in the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-reroute.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.reroute(...)
|
||||
@ -1032,7 +1032,7 @@ client.cluster.reroute(...)
|
||||
==== state
|
||||
Returns a comprehensive information about the state of the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-state.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.state(...)
|
||||
@ -1042,7 +1042,7 @@ client.cluster.state(...)
|
||||
==== stats
|
||||
Returns high-level overview of cluster statistics.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-stats.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.stats(...)
|
||||
@ -2085,7 +2085,7 @@ client.migration.postFeatureUpgrade(...)
|
||||
==== close_job
|
||||
Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-close-job.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ml-close-job.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.closeJob(...)
|
||||
@ -2095,7 +2095,7 @@ client.ml.closeJob(...)
|
||||
==== delete_calendar
|
||||
Deletes a calendar.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-calendar.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ml-delete-calendar.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.deleteCalendar(...)
|
||||
@ -2105,7 +2105,7 @@ client.ml.deleteCalendar(...)
|
||||
==== delete_calendar_event
|
||||
Deletes scheduled events from a calendar.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-calendar-event.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ml-delete-calendar-event.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.deleteCalendarEvent(...)
|
||||
@ -2115,7 +2115,7 @@ client.ml.deleteCalendarEvent(...)
|
||||
==== delete_calendar_job
|
||||
Deletes anomaly detection jobs from a calendar.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-calendar-job.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ml-delete-calendar-job.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.deleteCalendarJob(...)
|
||||
@ -2125,7 +2125,7 @@ client.ml.deleteCalendarJob(...)
|
||||
==== delete_data_frame_analytics
|
||||
Deletes an existing data frame analytics job.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-dfanalytics.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/delete-dfanalytics.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.deleteDataFrameAnalytics(...)
|
||||
@ -2135,7 +2135,7 @@ client.ml.deleteDataFrameAnalytics(...)
|
||||
==== delete_datafeed
|
||||
Deletes an existing datafeed.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-datafeed.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/ml-delete-datafeed.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.deleteDatafeed(...)
|
||||
@ -2384,6 +2384,8 @@ client.ml.getJobs(...)
|
||||
[discrete]
|
||||
==== get_memory_stats
|
||||
Returns information on how ML is using memory.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-memory.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.getMemoryStats(...)
|
||||
@ -2543,7 +2545,7 @@ client.ml.putCalendarJob(...)
|
||||
==== put_data_frame_analytics
|
||||
Instantiates a data frame analytics job.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/put-dfanalytics.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/put-dfanalytics.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.putDataFrameAnalytics(...)
|
||||
@ -2795,7 +2797,7 @@ client.nodes.getRepositoriesMeteringInfo(...)
|
||||
==== hot_threads
|
||||
Returns information about hot threads on each node in the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-nodes-hot-threads.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.nodes.hotThreads(...)
|
||||
@ -2805,7 +2807,7 @@ client.nodes.hotThreads(...)
|
||||
==== info
|
||||
Returns information about nodes in the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-nodes-info.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.nodes.info(...)
|
||||
@ -2825,7 +2827,7 @@ client.nodes.reloadSecureSettings(...)
|
||||
==== stats
|
||||
Returns statistical information about nodes in the cluster.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-nodes-stats.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.nodes.stats(...)
|
||||
@ -2835,7 +2837,7 @@ client.nodes.stats(...)
|
||||
==== usage
|
||||
Returns low-level information about REST actions usage on nodes.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/cluster-nodes-usage.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.nodes.usage(...)
|
||||
@ -2980,6 +2982,8 @@ client.searchableSnapshots.stats(...)
|
||||
[discrete]
|
||||
==== activate_user_profile
|
||||
Creates or updates the user profile on behalf of another user.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.security.activateUserProfile(...)
|
||||
@ -3288,6 +3292,8 @@ client.security.getUserPrivileges(...)
|
||||
[discrete]
|
||||
==== get_user_profile
|
||||
Retrieves user profile for the given unique ID.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.security.getUserProfile(...)
|
||||
@ -3474,18 +3480,20 @@ client.security.samlServiceProviderMetadata(...)
|
||||
----
|
||||
|
||||
[discrete]
|
||||
==== search_user_profiles
|
||||
Searches for user profiles that match specified criteria.
|
||||
==== suggest_user_profiles
|
||||
Get suggestions for user profiles that match specified search criteria.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-search-user-profile.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.security.searchUserProfiles(...)
|
||||
client.security.suggestUserProfiles(...)
|
||||
----
|
||||
|
||||
[discrete]
|
||||
==== update_user_profile_data
|
||||
Update application specific data for the user profile of the given unique ID.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.security.updateUserProfileData(...)
|
||||
@ -3785,7 +3793,7 @@ client.ssl.certificates(...)
|
||||
==== cancel
|
||||
Cancels a task, if it can be cancelled through an API.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/tasks.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.tasks.cancel(...)
|
||||
@ -3795,7 +3803,7 @@ client.tasks.cancel(...)
|
||||
==== get
|
||||
Returns information about a task.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/tasks.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.tasks.get(...)
|
||||
@ -3805,7 +3813,7 @@ client.tasks.get(...)
|
||||
==== list
|
||||
Returns a list of tasks.
|
||||
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html[Endpoint documentation]
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/tasks.html[Endpoint documentation]
|
||||
[source,ts]
|
||||
----
|
||||
client.tasks.list(...)
|
||||
|
||||
10
package.json
10
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@elastic/elasticsearch",
|
||||
"version": "8.2.0",
|
||||
"versionCanary": "8.2.0-canary.2",
|
||||
"version": "8.2.1",
|
||||
"versionCanary": "8.2.1-canary.0",
|
||||
"description": "The official Elasticsearch client for Node.js",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
@ -57,6 +57,7 @@
|
||||
"@types/stoppable": "^1.1.1",
|
||||
"@types/tap": "^15.0.7",
|
||||
"cross-zip": "^4.0.0",
|
||||
"desm": "^1.2.0",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"into-stream": "^7.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
@ -65,7 +66,7 @@
|
||||
"ms": "^2.1.3",
|
||||
"node-abort-controller": "^3.0.1",
|
||||
"node-fetch": "^2.6.7",
|
||||
"ora": "^6.1.0",
|
||||
"ora": "^5.4.1",
|
||||
"proxy": "^1.0.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.7",
|
||||
@ -76,7 +77,8 @@
|
||||
"ts-standard": "^11.0.0",
|
||||
"typescript": "^4.6.4",
|
||||
"workq": "^3.0.0",
|
||||
"xmlbuilder2": "^3.0.2"
|
||||
"xmlbuilder2": "^3.0.2",
|
||||
"zx": "^6.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@elastic/transport": "^8.2.0",
|
||||
|
||||
@ -91,7 +91,7 @@ export default class Internal {
|
||||
async health (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async health (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async health (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedPath: string[] = ['component', 'feature']
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
|
||||
|
||||
@ -65,10 +65,10 @@ export default class AsyncSearch {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async get<TDocument = unknown> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchGetResponse<TDocument>>
|
||||
async get<TDocument = unknown> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchGetResponse<TDocument>, unknown>>
|
||||
async get<TDocument = unknown> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchGetResponse<TDocument>>
|
||||
async get<TDocument = unknown> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
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>>
|
||||
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchGetResponse<TDocument, TAggregations>>
|
||||
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
@ -109,10 +109,10 @@ export default class AsyncSearch {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchSubmitResponse<TDocument>>
|
||||
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchSubmitResponse<TDocument>, unknown>>
|
||||
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchSubmitResponse<TDocument>>
|
||||
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
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>>
|
||||
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>
|
||||
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', '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 querystring: Record<string, any> = {}
|
||||
|
||||
@ -68,5 +68,5 @@ export default async function BulkApi<TDocument = unknown, TPartialDocument = un
|
||||
method = 'POST'
|
||||
path = '/_bulk'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
|
||||
@ -103,10 +103,10 @@ export default class Cat {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
|
||||
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>>
|
||||
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise<T.CatComponentTemplatesResponse>
|
||||
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
@ -116,6 +116,7 @@ export default class Cat {
|
||||
if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ export default class Fleet {
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_fleet/_fleet_msearch'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
|
||||
async search<TDocument = unknown> (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetSearchResponse<TDocument>>
|
||||
|
||||
@ -1307,7 +1307,7 @@ export default class Ml {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/_data`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
|
||||
async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest | TB.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlPreviewDataFrameAnalyticsResponse>
|
||||
|
||||
@ -67,6 +67,6 @@ export default class Monitoring {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_monitoring/bulk'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,5 +68,5 @@ export default async function MsearchApi<TDocument = unknown, TAggregations = Re
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_msearch'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
|
||||
@ -68,5 +68,5 @@ export default async function MsearchTemplateApi<TDocument = unknown, TAggregati
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_msearch/template'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
|
||||
@ -100,11 +100,23 @@ export default class Shutdown {
|
||||
async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise<T.ShutdownPutNodeResponse>
|
||||
async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['node_id']
|
||||
const acceptedBody: string[] = ['type', 'reason', 'allocation_delay', 'target_node_name']
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
let body: Record<string, any> | string
|
||||
if (typeof userBody === 'string') {
|
||||
body = userBody
|
||||
} else {
|
||||
body = userBody != null ? { ...userBody } : undefined
|
||||
}
|
||||
|
||||
for (const key in params) {
|
||||
if (acceptedPath.includes(key)) {
|
||||
if (acceptedBody.includes(key)) {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
|
||||
@ -67,6 +67,6 @@ export default class TextStructure {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_text_structure/find_structure'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -556,10 +556,21 @@ export interface MsearchMultisearchBody {
|
||||
aggregations?: Record<string, AggregationsAggregationContainer>
|
||||
aggs?: Record<string, AggregationsAggregationContainer>
|
||||
query?: QueryDslQueryContainer
|
||||
explain?: boolean
|
||||
stored_fields?: Fields
|
||||
docvalue_fields?: (QueryDslFieldAndFormat | Field)[]
|
||||
from?: integer
|
||||
size?: integer
|
||||
pit?: SearchPointInTimeReference
|
||||
sort?: Sort
|
||||
_source?: SearchSourceConfig
|
||||
terminate_after?: long
|
||||
stats?: string[]
|
||||
timeout?: string
|
||||
track_scores?: boolean
|
||||
track_total_hits?: SearchTrackHits
|
||||
version?: boolean
|
||||
seq_no_primary_term?: boolean
|
||||
pit?: SearchPointInTimeReference
|
||||
suggest?: SearchSuggester
|
||||
}
|
||||
|
||||
@ -572,6 +583,9 @@ export interface MsearchMultisearchHeader {
|
||||
request_cache?: boolean
|
||||
routing?: string
|
||||
search_type?: SearchType
|
||||
ccs_minimize_roundtrips?: boolean
|
||||
allow_partial_search_results?: boolean
|
||||
ignore_throttled?: boolean
|
||||
}
|
||||
|
||||
export interface MsearchRequest extends RequestBase {
|
||||
@ -4676,7 +4690,6 @@ export type MappingProperty = MappingFlattenedProperty | MappingJoinProperty | M
|
||||
export interface MappingPropertyBase {
|
||||
local_metadata?: Metadata
|
||||
meta?: Record<string, string>
|
||||
name?: PropertyName
|
||||
properties?: Record<PropertyName, MappingProperty>
|
||||
ignore_above?: integer
|
||||
dynamic?: MappingDynamicMapping
|
||||
@ -5634,7 +5647,7 @@ export interface AsyncSearchGetRequest extends RequestBase {
|
||||
wait_for_completion_timeout?: Time
|
||||
}
|
||||
|
||||
export type AsyncSearchGetResponse<TDocument = unknown, AsyncSearchTAggregations = unknown> = AsyncSearchAsyncSearchDocumentResponseBase<TDocument, AsyncSearchTAggregations>
|
||||
export type AsyncSearchGetResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = AsyncSearchAsyncSearchDocumentResponseBase<TDocument, TAggregations>
|
||||
|
||||
export interface AsyncSearchStatusRequest extends RequestBase {
|
||||
id: Id
|
||||
@ -5714,7 +5727,7 @@ export interface AsyncSearchSubmitRequest extends RequestBase {
|
||||
runtime_mappings?: MappingRuntimeFields
|
||||
}
|
||||
|
||||
export type AsyncSearchSubmitResponse<TDocument = unknown, AsyncSearchTAggregations = unknown> = AsyncSearchAsyncSearchDocumentResponseBase<TDocument, AsyncSearchTAggregations>
|
||||
export type AsyncSearchSubmitResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = AsyncSearchAsyncSearchDocumentResponseBase<TDocument, TAggregations>
|
||||
|
||||
export interface AutoscalingAutoscalingPolicy {
|
||||
roles: string[]
|
||||
@ -5856,6 +5869,22 @@ export interface CatAllocationRequest extends CatCatRequestBase {
|
||||
|
||||
export type CatAllocationResponse = CatAllocationAllocationRecord[]
|
||||
|
||||
export interface CatComponentTemplatesComponentTemplate {
|
||||
name: string
|
||||
version: string
|
||||
alias_count: string
|
||||
mapping_count: string
|
||||
settings_count: string
|
||||
metadata_count: string
|
||||
included_in: string
|
||||
}
|
||||
|
||||
export interface CatComponentTemplatesRequest extends CatCatRequestBase {
|
||||
name?: string
|
||||
}
|
||||
|
||||
export type CatComponentTemplatesResponse = CatComponentTemplatesComponentTemplate[]
|
||||
|
||||
export interface CatCountCountRecord {
|
||||
epoch?: EpochMillis
|
||||
t?: EpochMillis
|
||||
@ -9062,7 +9091,7 @@ export interface IndicesFielddataFrequencyFilter {
|
||||
min_segment_size: integer
|
||||
}
|
||||
|
||||
export type IndicesIndexCheckOnStartup = boolean | 'false' | 'checksum' | 'true'
|
||||
export type IndicesIndexCheckOnStartup = boolean | 'true' | 'false' | 'checksum'
|
||||
|
||||
export interface IndicesIndexRouting {
|
||||
allocation?: IndicesIndexRoutingAllocation
|
||||
@ -15249,7 +15278,7 @@ export interface SecurityHasPrivilegesIndexPrivilegesCheck {
|
||||
export type SecurityHasPrivilegesPrivileges = Record<string, boolean>
|
||||
|
||||
export interface SecurityHasPrivilegesRequest extends RequestBase {
|
||||
user?: Name | null
|
||||
user?: Name
|
||||
application?: SecurityHasPrivilegesApplicationPrivilegesCheck[]
|
||||
cluster?: SecurityClusterPrivilege[]
|
||||
index?: SecurityHasPrivilegesIndexPrivilegesCheck[]
|
||||
@ -15462,8 +15491,12 @@ export interface SecurityUpdateUserProfileDataRequest extends RequestBase {
|
||||
|
||||
export type SecurityUpdateUserProfileDataResponse = AcknowledgedResponseBase
|
||||
|
||||
export type ShutdownType = 'restart' | 'remove' | 'replace'
|
||||
|
||||
export interface ShutdownDeleteNodeRequest extends RequestBase {
|
||||
node_id: NodeId
|
||||
master_timeout?: TimeUnit
|
||||
timeout?: TimeUnit
|
||||
}
|
||||
|
||||
export type ShutdownDeleteNodeResponse = AcknowledgedResponseBase
|
||||
@ -15489,6 +15522,8 @@ export interface ShutdownGetNodePluginsStatus {
|
||||
|
||||
export interface ShutdownGetNodeRequest extends RequestBase {
|
||||
node_id?: NodeIds
|
||||
master_timeout?: TimeUnit
|
||||
timeout?: TimeUnit
|
||||
}
|
||||
|
||||
export interface ShutdownGetNodeResponse {
|
||||
@ -15505,6 +15540,12 @@ export type ShutdownGetNodeShutdownType = 'remove' | 'restart'
|
||||
|
||||
export interface ShutdownPutNodeRequest extends RequestBase {
|
||||
node_id: NodeId
|
||||
master_timeout?: TimeUnit
|
||||
timeout?: TimeUnit
|
||||
type: ShutdownType
|
||||
reason: string
|
||||
allocation_delay?: string
|
||||
target_node_name?: string
|
||||
}
|
||||
|
||||
export type ShutdownPutNodeResponse = AcknowledgedResponseBase
|
||||
|
||||
@ -585,10 +585,21 @@ export interface MsearchMultisearchBody {
|
||||
aggregations?: Record<string, AggregationsAggregationContainer>
|
||||
aggs?: Record<string, AggregationsAggregationContainer>
|
||||
query?: QueryDslQueryContainer
|
||||
explain?: boolean
|
||||
stored_fields?: Fields
|
||||
docvalue_fields?: (QueryDslFieldAndFormat | Field)[]
|
||||
from?: integer
|
||||
size?: integer
|
||||
pit?: SearchPointInTimeReference
|
||||
sort?: Sort
|
||||
_source?: SearchSourceConfig
|
||||
terminate_after?: long
|
||||
stats?: string[]
|
||||
timeout?: string
|
||||
track_scores?: boolean
|
||||
track_total_hits?: SearchTrackHits
|
||||
version?: boolean
|
||||
seq_no_primary_term?: boolean
|
||||
pit?: SearchPointInTimeReference
|
||||
suggest?: SearchSuggester
|
||||
}
|
||||
|
||||
@ -601,6 +612,9 @@ export interface MsearchMultisearchHeader {
|
||||
request_cache?: boolean
|
||||
routing?: string
|
||||
search_type?: SearchType
|
||||
ccs_minimize_roundtrips?: boolean
|
||||
allow_partial_search_results?: boolean
|
||||
ignore_throttled?: boolean
|
||||
}
|
||||
|
||||
export interface MsearchRequest extends RequestBase {
|
||||
@ -4776,7 +4790,6 @@ export type MappingProperty = MappingFlattenedProperty | MappingJoinProperty | M
|
||||
export interface MappingPropertyBase {
|
||||
local_metadata?: Metadata
|
||||
meta?: Record<string, string>
|
||||
name?: PropertyName
|
||||
properties?: Record<PropertyName, MappingProperty>
|
||||
ignore_above?: integer
|
||||
dynamic?: MappingDynamicMapping
|
||||
@ -5734,7 +5747,7 @@ export interface AsyncSearchGetRequest extends RequestBase {
|
||||
wait_for_completion_timeout?: Time
|
||||
}
|
||||
|
||||
export type AsyncSearchGetResponse<TDocument = unknown, AsyncSearchTAggregations = unknown> = AsyncSearchAsyncSearchDocumentResponseBase<TDocument, AsyncSearchTAggregations>
|
||||
export type AsyncSearchGetResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = AsyncSearchAsyncSearchDocumentResponseBase<TDocument, TAggregations>
|
||||
|
||||
export interface AsyncSearchStatusRequest extends RequestBase {
|
||||
id: Id
|
||||
@ -5831,7 +5844,7 @@ export interface AsyncSearchSubmitRequest extends RequestBase {
|
||||
}
|
||||
}
|
||||
|
||||
export type AsyncSearchSubmitResponse<TDocument = unknown, AsyncSearchTAggregations = unknown> = AsyncSearchAsyncSearchDocumentResponseBase<TDocument, AsyncSearchTAggregations>
|
||||
export type AsyncSearchSubmitResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = AsyncSearchAsyncSearchDocumentResponseBase<TDocument, TAggregations>
|
||||
|
||||
export interface AutoscalingAutoscalingPolicy {
|
||||
roles: string[]
|
||||
@ -5974,6 +5987,22 @@ export interface CatAllocationRequest extends CatCatRequestBase {
|
||||
|
||||
export type CatAllocationResponse = CatAllocationAllocationRecord[]
|
||||
|
||||
export interface CatComponentTemplatesComponentTemplate {
|
||||
name: string
|
||||
version: string
|
||||
alias_count: string
|
||||
mapping_count: string
|
||||
settings_count: string
|
||||
metadata_count: string
|
||||
included_in: string
|
||||
}
|
||||
|
||||
export interface CatComponentTemplatesRequest extends CatCatRequestBase {
|
||||
name?: string
|
||||
}
|
||||
|
||||
export type CatComponentTemplatesResponse = CatComponentTemplatesComponentTemplate[]
|
||||
|
||||
export interface CatCountCountRecord {
|
||||
epoch?: EpochMillis
|
||||
t?: EpochMillis
|
||||
@ -9243,7 +9272,7 @@ export interface IndicesFielddataFrequencyFilter {
|
||||
min_segment_size: integer
|
||||
}
|
||||
|
||||
export type IndicesIndexCheckOnStartup = boolean | 'false' | 'checksum' | 'true'
|
||||
export type IndicesIndexCheckOnStartup = boolean | 'true' | 'false' | 'checksum'
|
||||
|
||||
export interface IndicesIndexRouting {
|
||||
allocation?: IndicesIndexRoutingAllocation
|
||||
@ -15669,7 +15698,7 @@ export interface SecurityHasPrivilegesIndexPrivilegesCheck {
|
||||
export type SecurityHasPrivilegesPrivileges = Record<string, boolean>
|
||||
|
||||
export interface SecurityHasPrivilegesRequest extends RequestBase {
|
||||
user?: Name | null
|
||||
user?: Name
|
||||
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
|
||||
body?: {
|
||||
application?: SecurityHasPrivilegesApplicationPrivilegesCheck[]
|
||||
@ -15926,8 +15955,12 @@ export interface SecurityUpdateUserProfileDataRequest extends RequestBase {
|
||||
|
||||
export type SecurityUpdateUserProfileDataResponse = AcknowledgedResponseBase
|
||||
|
||||
export type ShutdownType = 'restart' | 'remove' | 'replace'
|
||||
|
||||
export interface ShutdownDeleteNodeRequest extends RequestBase {
|
||||
node_id: NodeId
|
||||
master_timeout?: TimeUnit
|
||||
timeout?: TimeUnit
|
||||
}
|
||||
|
||||
export type ShutdownDeleteNodeResponse = AcknowledgedResponseBase
|
||||
@ -15953,6 +15986,8 @@ export interface ShutdownGetNodePluginsStatus {
|
||||
|
||||
export interface ShutdownGetNodeRequest extends RequestBase {
|
||||
node_id?: NodeIds
|
||||
master_timeout?: TimeUnit
|
||||
timeout?: TimeUnit
|
||||
}
|
||||
|
||||
export interface ShutdownGetNodeResponse {
|
||||
@ -15969,6 +16004,15 @@ export type ShutdownGetNodeShutdownType = 'remove' | 'restart'
|
||||
|
||||
export interface ShutdownPutNodeRequest extends RequestBase {
|
||||
node_id: NodeId
|
||||
master_timeout?: TimeUnit
|
||||
timeout?: TimeUnit
|
||||
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
|
||||
body?: {
|
||||
type: ShutdownType
|
||||
reason: string
|
||||
allocation_delay?: string
|
||||
target_node_name?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type ShutdownPutNodeResponse = AcknowledgedResponseBase
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
/* eslint-disable @typescript-eslint/promise-function-async */
|
||||
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
|
||||
|
||||
import assert from 'assert'
|
||||
import { promisify } from 'util'
|
||||
|
||||
@ -43,6 +43,10 @@ const MAX_FILE_TIME = 1000 * 30
|
||||
const MAX_TEST_TIME = 1000 * 3
|
||||
|
||||
const freeSkips = {
|
||||
// not supported yet
|
||||
'/free/cluster.desired_nodes/10_basic.yml': ['*'],
|
||||
'/free/health/30_feature.yml': ['*'],
|
||||
'/free/health/40_useractions.yml': ['*'],
|
||||
// the v8 client never sends the scroll_id in querystgring,
|
||||
// the way the test is structured causes a security exception
|
||||
'free/scroll/10_basic.yml': ['Body params override query string'],
|
||||
@ -63,13 +67,17 @@ const freeSkips = {
|
||||
// the expected error is returning a 503,
|
||||
// which triggers a retry and the node to be marked as dead
|
||||
'search.aggregation/240_max_buckets.yml': ['*'],
|
||||
// long values and json do not play nicely together
|
||||
'search.aggregation/40_range.yml': ['Min and max long range bounds'],
|
||||
// the yaml runner assumes that null means "does not exists",
|
||||
// while null is a valid json value, so the check will fail
|
||||
'search/320_disallow_queries.yml': ['Test disallow expensive queries'],
|
||||
'free/tsdb/90_unsupported_operations.yml': ['noop update']
|
||||
}
|
||||
const platinumBlackList = {
|
||||
'api_key/10_basic.yml': ['Test get api key'],
|
||||
'api_key/20_query.yml': ['*'],
|
||||
'api_key/11_invalidation.yml': ['Test invalidate api key by realm name'],
|
||||
'analytics/histogram.yml': ['Histogram requires values in increasing order'],
|
||||
// this two test cases are broken, we should
|
||||
// return on those in the future.
|
||||
@ -107,6 +115,7 @@ const platinumBlackList = {
|
||||
// Investigate why is failing
|
||||
'ml/inference_crud.yml': ['*'],
|
||||
'ml/categorization_agg.yml': ['Test categorization aggregation with poor settings'],
|
||||
'ml/filter_crud.yml': ['*'],
|
||||
// investigate why this is failing
|
||||
'monitoring/bulk/10_basic.yml': ['*'],
|
||||
'monitoring/bulk/20_privileges.yml': ['*'],
|
||||
@ -119,6 +128,8 @@ const platinumBlackList = {
|
||||
'service_accounts/10_basic.yml': ['*'],
|
||||
// we are setting two certificates in the docker config
|
||||
'ssl/10_basic.yml': ['*'],
|
||||
'token/10_basic.yml': ['*'],
|
||||
'token/11_invalidation.yml': ['*'],
|
||||
// very likely, the index template has not been loaded yet.
|
||||
// we should run a indices.existsTemplate, but the name of the
|
||||
// template may vary during time.
|
||||
|
||||
@ -188,6 +188,45 @@ function build (opts = {}) {
|
||||
client, 'tasks.cancel',
|
||||
tasks.map(id => ({ task_id: id }))
|
||||
)
|
||||
|
||||
// cleanup ml
|
||||
const jobsList = await client.ml.getJobs()
|
||||
const jobsIds = jobsList.jobs.map(j => j.job_id)
|
||||
await helper.runInParallel(
|
||||
client, 'ml.deleteJob',
|
||||
jobsIds.map(j => ({ job_id: j, force: true }))
|
||||
)
|
||||
|
||||
const dataFrame = await client.ml.getDataFrameAnalytics()
|
||||
const dataFrameIds = dataFrame.data_frame_analytics.map(d => d.id)
|
||||
await helper.runInParallel(
|
||||
client, 'ml.deleteDataFrameAnalytics',
|
||||
dataFrameIds.map(d => ({ id: d, force: true }))
|
||||
)
|
||||
|
||||
const calendars = await client.ml.getCalendars()
|
||||
const calendarsId = calendars.calendars.map(c => c.calendar_id)
|
||||
await helper.runInParallel(
|
||||
client, 'ml.deleteCalendar',
|
||||
calendarsId.map(c => ({ calendar_id: c }))
|
||||
)
|
||||
|
||||
const training = await client.ml.getTrainedModels()
|
||||
const trainingId = training.trained_model_configs
|
||||
.filter(t => t.created_by !== '_xpack')
|
||||
.map(t => t.model_id)
|
||||
await helper.runInParallel(
|
||||
client, 'ml.deleteTrainedModel',
|
||||
trainingId.map(t => ({ model_id: t, force: true }))
|
||||
)
|
||||
|
||||
// cleanup transforms
|
||||
const transforms = await client.transform.getTransform()
|
||||
const transformsId = transforms.transforms.map(t => t.id)
|
||||
await helper.runInParallel(
|
||||
client, 'transform.deleteTransform',
|
||||
transformsId.map(t => ({ transform_id: t, force: true }))
|
||||
)
|
||||
}
|
||||
|
||||
const shutdownNodes = await client.shutdown.getNode()
|
||||
|
||||
Reference in New Issue
Block a user