Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a8da143bfc | |||
| f6f0747b8c | |||
| 6e70735ac0 | |||
| f85de4aaaa | |||
| 10d4d18dfe | |||
| 36afd130f8 | |||
| 3186f4fc63 | |||
| 0096710263 | |||
| fc34ebc329 | |||
| af6a9245c2 | |||
| 811e952d2d | |||
| a8ae21f461 | |||
| b1389cfebe | |||
| 5b08121507 | |||
| 2a65740d62 | |||
| ab764ae5c7 | |||
| 29dfffef9f | |||
| 3ccd149249 | |||
| e88999f144 | |||
| 485e57a375 | |||
| b92146c708 | |||
| 111d126d8c | |||
| 135abcb850 | |||
| 1641930396 | |||
| 2b7d96e1e2 | |||
| 642f8309e9 |
@ -10,7 +10,5 @@ RUN apt-get clean -y && \
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package.json .
|
||||
RUN npm install --production=false
|
||||
|
||||
COPY . .
|
||||
RUN npm install --production=false
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
ARG NODE_JS_VERSION=${NODE_JS_VERSION:-18}
|
||||
FROM node:${NODE_JS_VERSION}
|
||||
|
||||
ARG BUILDER_UID=1000
|
||||
ARG BUILDER_GID=1000
|
||||
ENV BUILDER_USER elastic
|
||||
ENV BUILDER_GROUP elastic
|
||||
|
||||
# install zip util
|
||||
RUN apt-get clean -y && \
|
||||
apt-get update -y && \
|
||||
apt-get install -y zip
|
||||
|
||||
# Set user permissions and directory
|
||||
RUN (id -g ${BUILDER_GID} || groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP}) \
|
||||
&& (id -u ${BUILDER_UID} || useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GID} -m elastic) \
|
||||
&& mkdir -p /usr/src/elasticsearch-js \
|
||||
&& chown -R ${BUILDER_UID}:${BUILDER_GID} /usr/src/
|
||||
|
||||
WORKDIR /usr/src/elasticsearch-js
|
||||
|
||||
# run remainder of commands as non-root user
|
||||
USER ${BUILDER_UID}:${BUILDER_GID}
|
||||
|
||||
# install dependencies
|
||||
COPY package.json .
|
||||
RUN npm install --production=false
|
||||
|
||||
# copy project files
|
||||
COPY . .
|
||||
@ -2,7 +2,7 @@
|
||||
#
|
||||
# Shared cleanup routines between different steps
|
||||
#
|
||||
# Please source .buildkite/functions/imports.sh as a whole not just this file
|
||||
# Please source .ci/functions/imports.sh as a whole not just this file
|
||||
#
|
||||
# Version 1.0.0
|
||||
# - Initial version after refactor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#
|
||||
# Exposes a routine scripts can call to wait for a container if that container set up a health command
|
||||
#
|
||||
# Please source .buildkite/functions/imports.sh as a whole not just this file
|
||||
# Please source .ci/functions/imports.sh as a whole not just this file
|
||||
#
|
||||
# Version 1.0.1
|
||||
# - Initial version after refactor
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
---
|
||||
steps:
|
||||
- label: ":elasticsearch: :javascript: ES JavaScript ({{ matrix.nodejs }}) Test Suite: {{ matrix.suite }}"
|
||||
agents:
|
||||
@ -6,16 +5,16 @@ steps:
|
||||
env:
|
||||
NODE_VERSION: "{{ matrix.nodejs }}"
|
||||
TEST_SUITE: "{{ matrix.suite }}"
|
||||
STACK_VERSION: 8.14.0
|
||||
STACK_VERSION: 8.8.0-SNAPSHOT
|
||||
matrix:
|
||||
setup:
|
||||
suite:
|
||||
- "free"
|
||||
- "platinum"
|
||||
nodejs:
|
||||
- "16"
|
||||
- "18"
|
||||
- "20"
|
||||
- "22"
|
||||
command: ./.buildkite/run-tests.sh
|
||||
artifact_paths: "./junit-output/junit-*.xml"
|
||||
- wait: ~
|
||||
@ -27,6 +26,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
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
"\\.md$",
|
||||
"\\.asciidoc$",
|
||||
"^docs\\/",
|
||||
"^\\.ci\\/",
|
||||
"^scripts\\/",
|
||||
"^catalog-info\\.yaml$",
|
||||
"^test\\/unit\\/",
|
||||
|
||||
26
.ci/Dockerfile
Normal file
26
.ci/Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
ARG NODE_JS_VERSION=18
|
||||
FROM node:${NODE_JS_VERSION}
|
||||
|
||||
ARG BUILDER_UID=1000
|
||||
ARG BUILDER_GID=1000
|
||||
ENV BUILDER_USER elastic
|
||||
ENV BUILDER_GROUP elastic
|
||||
|
||||
# install zip util
|
||||
RUN apt-get clean -y && \
|
||||
apt-get update -y && \
|
||||
apt-get install -y zip
|
||||
|
||||
# Set user permissions and directory
|
||||
RUN groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP} \
|
||||
&& useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GROUP} -m elastic 1>/dev/null 2>/dev/null \
|
||||
&& mkdir -p /usr/src/elasticsearch-js \
|
||||
&& chown -R ${BUILDER_USER}:${BUILDER_GROUP} /usr/src/
|
||||
WORKDIR /usr/src/elasticsearch-js
|
||||
USER ${BUILDER_USER}:${BUILDER_GROUP}
|
||||
|
||||
# Install app dependencies
|
||||
COPY --chown=$BUILDER_USER:$BUILDER_GROUP package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY --chown=$BUILDER_USER:$BUILDER_GROUP . .
|
||||
@ -28,11 +28,6 @@ import assert from 'assert'
|
||||
import { join } from 'desm'
|
||||
import semver from 'semver'
|
||||
|
||||
// xz/globals loads minimist-parsed args as a global `argv`, but it
|
||||
// interprets args like '8.10' as numbers and shortens them to '8.1'.
|
||||
// so we have to import and configure minimist ourselves.
|
||||
import minimist from 'minimist'
|
||||
const argv = minimist(process.argv.slice(2), { string: ['_', 'task'] })
|
||||
assert(typeof argv.task === 'string', 'Missing task parameter')
|
||||
|
||||
switch (argv.task) {
|
||||
@ -74,15 +69,14 @@ async function release (args) {
|
||||
|
||||
async function bump (args) {
|
||||
assert(args.length === 1, 'Bump task expects one parameter')
|
||||
let [version] = args
|
||||
const [version] = args
|
||||
const packageJson = JSON.parse(await readFile(
|
||||
join(import.meta.url, '..', 'package.json'),
|
||||
'utf8'
|
||||
))
|
||||
|
||||
if (version.split('.').length === 2) version = `${version}.0`
|
||||
const cleanVersion = semver.clean(version.includes('SNAPSHOT') ? version.split('-')[0] : version)
|
||||
assert(semver.valid(cleanVersion), `${cleanVersion} is not seen as a valid semver version. raw version: ${version}`)
|
||||
assert(semver.valid(cleanVersion))
|
||||
packageJson.version = cleanVersion
|
||||
packageJson.versionCanary = `${cleanVersion}-canary.0`
|
||||
|
||||
@ -92,10 +86,10 @@ async function bump (args) {
|
||||
'utf8'
|
||||
)
|
||||
|
||||
const pipeline = await readFile(join(import.meta.url, '..', '.buildkite', 'pipeline.yml'), 'utf8')
|
||||
const pipeline = await readFile(join(import.meta.url, '..', '.buildkite', 'pipeline.yml'))
|
||||
await writeFile(
|
||||
join(import.meta.url, '..', '.buildkite', 'pipeline.yml'),
|
||||
pipeline.replace(/STACK_VERSION: [0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?/, `STACK_VERSION: ${cleanVersion}`),
|
||||
pipeline.replace(/STACK_VERSION: [0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?/, `STACK_VERSION: ${cleanVersion}-SNAPSHOT`), // eslint-disable-line
|
||||
'utf8'
|
||||
)
|
||||
}
|
||||
@ -3,7 +3,7 @@
|
||||
#
|
||||
# Build entry script for elasticsearch-js
|
||||
#
|
||||
# Must be called: ./.github/make.sh <target> <params>
|
||||
# Must be called: ./.ci/make.sh <target> <params>
|
||||
#
|
||||
# Version: 1.1.0
|
||||
#
|
||||
@ -34,8 +34,8 @@ STACK_VERSION=$VERSION
|
||||
set -euo pipefail
|
||||
|
||||
product="elastic/elasticsearch-js"
|
||||
output_folder=".buildkite/output"
|
||||
codegen_folder=".buildkite/output"
|
||||
output_folder=".ci/output"
|
||||
codegen_folder=".ci/output"
|
||||
OUTPUT_DIR="$repo/${output_folder}"
|
||||
NODE_JS_VERSION=18
|
||||
WORKFLOW=${WORKFLOW-staging}
|
||||
@ -131,7 +131,7 @@ esac
|
||||
echo -e "\033[34;1mINFO: building $product container\033[0m"
|
||||
|
||||
docker build \
|
||||
--file .buildkite/Dockerfile-make \
|
||||
--file .ci/Dockerfile \
|
||||
--tag "$product" \
|
||||
--build-arg NODE_JS_VERSION="$NODE_JS_VERSION" \
|
||||
--build-arg "BUILDER_UID=$(id -u)" \
|
||||
@ -144,42 +144,26 @@ docker build \
|
||||
|
||||
echo -e "\033[34;1mINFO: running $product container\033[0m"
|
||||
|
||||
if [[ -z "${BUILDKITE+x}" ]] && [[ -z "${CI+x}" ]] && [[ -z "${GITHUB_ACTIONS+x}" ]]; then
|
||||
echo -e "\033[34;1mINFO: Running in local mode"
|
||||
docker run \
|
||||
-u "$(id -u):$(id -g)" \
|
||||
--volume "$repo:/usr/src/elasticsearch-js" \
|
||||
--volume /usr/src/elasticsearch-js/node_modules \
|
||||
--volume "$(realpath $repo/../elastic-client-generator-js):/usr/src/elastic-client-generator-js" \
|
||||
--env "WORKFLOW=$WORKFLOW" \
|
||||
--name make-elasticsearch-js \
|
||||
--rm \
|
||||
$product \
|
||||
/bin/bash -c "mkdir -p /usr/src/elastic-client-generator-js/output && \
|
||||
node .buildkite/make.mjs --task $TASK ${TASK_ARGS[*]}"
|
||||
else
|
||||
echo -e "\033[34;1mINFO: Running in CI mode"
|
||||
docker run \
|
||||
--volume "$repo:/usr/src/elasticsearch-js" \
|
||||
--volume /usr/src/elasticsearch-js/node_modules \
|
||||
-u "$(id -u):$(id -g)" \
|
||||
--env "WORKFLOW=$WORKFLOW" \
|
||||
--name make-elasticsearch-js \
|
||||
--rm \
|
||||
$product \
|
||||
/bin/bash -c "cd /usr/src && \
|
||||
git clone https://$CLIENTS_GITHUB_TOKEN@github.com/elastic/elastic-client-generator-js.git && \
|
||||
mkdir -p /usr/src/elastic-client-generator-js/output && \
|
||||
cd /usr/src/elasticsearch-js && \
|
||||
node .buildkite/make.mjs --task $TASK ${TASK_ARGS[*]}"
|
||||
fi
|
||||
docker run \
|
||||
--volume "$repo:/usr/src/elasticsearch-js" \
|
||||
--volume /usr/src/elasticsearch-js/node_modules \
|
||||
-u "$(id -u):$(id -g)" \
|
||||
--env "WORKFLOW=$WORKFLOW" \
|
||||
--name make-elasticsearch-js \
|
||||
--rm \
|
||||
$product \
|
||||
/bin/bash -c "cd /usr/src && \
|
||||
git clone https://$CLIENTS_GITHUB_TOKEN@github.com/elastic/elastic-client-generator-js.git && \
|
||||
mkdir -p /usr/src/elastic-client-generator-js/output && \
|
||||
cd /usr/src/elasticsearch-js && \
|
||||
node .ci/make.mjs --task $TASK ${TASK_ARGS[*]}"
|
||||
|
||||
# ------------------------------------------------------- #
|
||||
# Post Command tasks & checks
|
||||
# ------------------------------------------------------- #
|
||||
|
||||
if [[ "$CMD" == "assemble" ]]; then
|
||||
if compgen -G ".buildkite/output/*" > /dev/null; 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"
|
||||
@ -3,5 +3,3 @@ npm-debug.log
|
||||
test/benchmarks
|
||||
elasticsearch
|
||||
.git
|
||||
lib
|
||||
junit-output
|
||||
|
||||
19
.github/workflows/backport.yml
vendored
19
.github/workflows/backport.yml
vendored
@ -1,27 +1,16 @@
|
||||
---
|
||||
name: Backport
|
||||
on:
|
||||
pull_request_target:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
backport:
|
||||
name: Backport
|
||||
runs-on: ubuntu-latest
|
||||
# Only react to merged PRs for security reasons.
|
||||
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
|
||||
if: >
|
||||
github.event.pull_request.merged
|
||||
&& (
|
||||
github.event.action == 'closed'
|
||||
|| (
|
||||
github.event.action == 'labeled'
|
||||
&& contains(github.event.label.name, 'backport')
|
||||
)
|
||||
)
|
||||
name: Backport
|
||||
steps:
|
||||
- uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4
|
||||
- name: Backport
|
||||
uses: tibdex/backport@7005ef85c4562bc23b0e9b4a9940d5922f439750
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
27
.github/workflows/nodejs.yml
vendored
27
.github/workflows/nodejs.yml
vendored
@ -1,40 +1,21 @@
|
||||
---
|
||||
name: Node CI
|
||||
|
||||
on:
|
||||
pull_request: {}
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
paths-filter:
|
||||
name: Detect files changed
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
src-only: "${{ steps.changes.outputs.src-only }}"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter/@v2.11.1
|
||||
id: changes
|
||||
with:
|
||||
filters: |
|
||||
src-only:
|
||||
- '!(**/*.{md,asciidoc,txt}|*.{md,asciidoc,txt}|{docs,.buildkite,scripts}/**/*|catalog-info.yaml)'
|
||||
- '.github/workflows/**'
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: paths-filter
|
||||
# only run if code relevant to unit tests was changed
|
||||
if: needs.paths-filter.outputs.src-only == 'true'
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [18.x, 20.x, 22.x]
|
||||
node-version: [14.x, 16.x, 18.x, 20.x]
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
@ -66,7 +47,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [22.x]
|
||||
node-version: [20.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
27
.github/workflows/npm-publish.yml
vendored
27
.github/workflows/npm-publish.yml
vendored
@ -1,27 +0,0 @@
|
||||
name: Publish Package to npm
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch:
|
||||
description: 'Git branch to build and publish'
|
||||
required: true
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.inputs.branch }}
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '20.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- run: npm install -g npm
|
||||
- run: npm install
|
||||
- run: npm test
|
||||
- run: npm publish --provenance --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
43
.github/workflows/serverless-patch.sh
vendored
43
.github/workflows/serverless-patch.sh
vendored
@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -exuo pipefail
|
||||
|
||||
merge_commit_sha=$(jq -r '.pull_request.merge_commit_sha' "$GITHUB_EVENT_PATH")
|
||||
pull_request_id=$(jq -r '.pull_request.number' "$GITHUB_EVENT_PATH")
|
||||
pr_shortcode="elastic/elasticsearch-js#$pull_request_id"
|
||||
|
||||
# generate patch file
|
||||
cd "$GITHUB_WORKSPACE/stack"
|
||||
git format-patch -1 --stdout "$merge_commit_sha" > /tmp/patch.diff
|
||||
|
||||
# set committer info
|
||||
git config --global user.email "elasticmachine@users.noreply.github.com"
|
||||
git config --global user.name "Elastic Machine"
|
||||
|
||||
# apply patch file
|
||||
cd "$GITHUB_WORKSPACE/serverless"
|
||||
git am -C1 --reject /tmp/patch.diff || git am --quit
|
||||
|
||||
# generate PR body comment
|
||||
comment="Patch applied from $pr_shortcode"
|
||||
|
||||
# enumerate rejected patches in PR comment
|
||||
has_rejects='false'
|
||||
for f in ./**/*.rej; do
|
||||
has_rejects='true'
|
||||
comment="$comment
|
||||
|
||||
## Rejected patch \`$f\` must be resolved:
|
||||
|
||||
\`\`\`diff
|
||||
$(cat "$f")
|
||||
\`\`\`
|
||||
"
|
||||
done
|
||||
|
||||
# delete .rej files
|
||||
rm -fv ./**/*.rej
|
||||
|
||||
# send data to output parameters
|
||||
echo "$comment" > /tmp/pr_body
|
||||
echo "PR_DRAFT=$has_rejects" >> "$GITHUB_OUTPUT"
|
||||
51
.github/workflows/serverless-patch.yml
vendored
51
.github/workflows/serverless-patch.yml
vendored
@ -1,51 +0,0 @@
|
||||
---
|
||||
name: Apply PR changes to serverless
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- closed
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
apply-patch:
|
||||
name: Apply patch
|
||||
runs-on: ubuntu-latest
|
||||
# Only react to merged PRs for security reasons.
|
||||
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
|
||||
if: >
|
||||
github.event.pull_request.merged
|
||||
&& (
|
||||
(
|
||||
github.event.action == 'closed'
|
||||
&& contains(github.event.pull_request.labels.*.name, 'apply-to-serverless')
|
||||
)
|
||||
||
|
||||
(
|
||||
github.event.action == 'labeled'
|
||||
&& github.event.label.name == 'apply-to-serverless'
|
||||
)
|
||||
)
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: elastic/elasticsearch-js
|
||||
ref: main
|
||||
path: stack
|
||||
fetch-depth: 0
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: elastic/elasticsearch-serverless-js
|
||||
ref: main
|
||||
path: serverless
|
||||
- name: Apply patch from stack to serverless
|
||||
id: apply-patch
|
||||
run: $GITHUB_WORKSPACE/stack/.github/workflows/serverless-patch.sh
|
||||
- uses: peter-evans/create-pull-request@v6
|
||||
with:
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
path: serverless
|
||||
title: 'Apply patch from elastic/elasticsearch-js#${{ github.event.pull_request.number }}'
|
||||
commit-message: 'Apply patch from elastic/elasticsearch-js#${{ github.event.pull_request.number }}'
|
||||
body-path: /tmp/pr_body
|
||||
draft: '${{ steps.apply-patch.outputs.PR_DRAFT }}'
|
||||
add-paths: ':!*.rej'
|
||||
21
.github/workflows/stale.yml
vendored
21
.github/workflows/stale.yml
vendored
@ -1,21 +0,0 @@
|
||||
---
|
||||
name: 'Close stale issues and PRs'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v8
|
||||
with:
|
||||
stale-issue-label: stale
|
||||
stale-pr-label: stale
|
||||
days-before-stale: 90
|
||||
days-before-close: 14
|
||||
exempt-issue-labels: 'good first issue'
|
||||
close-issue-label: closed-stale
|
||||
close-pr-label: closed-stale
|
||||
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove the `stale` label, or leave a comment, or this will be closed in 14 days.'
|
||||
stale-pr-message: 'This pull request is stale because it has been open 90 days with no activity. Remove the `stale` label, or leave a comment, or this will be closed in 14 days.'
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -63,4 +63,3 @@ test/bundlers/**/bundle.js
|
||||
test/bundlers/parcel-test/.parcel-cache
|
||||
|
||||
lib
|
||||
junit-output
|
||||
|
||||
@ -64,6 +64,7 @@ test
|
||||
scripts
|
||||
|
||||
# ci configuration
|
||||
.ci
|
||||
.travis.yml
|
||||
.buildkite
|
||||
certs
|
||||
|
||||
@ -8,7 +8,7 @@ improving the documentation,
|
||||
submitting bug reports and feature requests or writing code.
|
||||
|
||||
## Repository structure
|
||||
The `main` branch is considered unstable, and it's compatible with Elasticsearch main. Unless you are patching an issue, new features should always be sent to the `main` branch, in case of a bugfix, it depends if the bug affects all the release lines.<br/>
|
||||
The `master` branch is considered unstable, and it's compatible with Elasticsearch master. Unless you are patching an issue, new features should always be sent to the `master` branch, in case of a bugfix, it depends if the bug affects all the release lines.<br/>
|
||||
There is a branch for every supported release line, such as `7.x` or `6.x`. We release bugfixes as soon as possible, while minor and major releases are published at the same time of the Elastic Stack.
|
||||
|
||||
Usually for every release line there will be a *published* version and a *next* version. Eg: the `7.x` branch contains the version published on npm, and bugfixes should be sent there, while `7.2` *(assuming that 7.1.x is released)* contains the next version, and new features should be sent there.
|
||||
@ -31,7 +31,7 @@ Once your changes are ready to submit for review:
|
||||
1. Test your changes
|
||||
|
||||
Run the test suite to make sure that nothing is broken.
|
||||
Usually running `npm test` is enough; our CI will take care of running the integration tests. If you want to run the integration tests yourself, see [the *Testing* section](#testing) below.
|
||||
Usually run `npm test` is enough, our CI will take care of running the integration test. If you want to run the integration test yourself, see the *Testing* section below.
|
||||
|
||||
2. Submit a pull request
|
||||
|
||||
@ -58,50 +58,36 @@ Once your changes are ready to submit for review:
|
||||
|
||||
### Code generation
|
||||
|
||||
The entire content of the `src/api/` directory is automatically generated from [the Elasticsearch specification](https://github.com/elastic/elasticsearch-specification), as is the `docs/reference.asciidoc` file.
|
||||
This code generation is done using a separate repository that is not currently available to the public.
|
||||
|
||||
If you find discrepancies between this client's API code and what you see when actually interacting with an Elasticsearch API, you can open a pull request here to fix it.
|
||||
For API fixes, it's likely a change will need to be made to the specification as well, to ensure your fix is not undone by the code generation process.
|
||||
We will do our best to make sure this is addressed when reviewing and merging your changes.
|
||||
|
||||
PRs to improve the specification are also welcome!
|
||||
It is implemented in TypeScript, so JavaScript devs should be able to understand it fairly easily.
|
||||
Spec fixes are particularly helpful, as they will be reflected in ALL official Elasticsearch clients, not just this one.
|
||||
The entire content of the API folder is generated as well as the `docs/reference.asciidoc` file.<br/>
|
||||
If you want to run the code generation you should run the following command:
|
||||
```sh
|
||||
node scripts/generate --tag <tag name>
|
||||
# or
|
||||
node scripts/generate --branch <branch name>
|
||||
```
|
||||
Then you should copy the content of `api/generated.d.ts` into the `index.d.ts` file *(automate this step would be a nice pr!)*.
|
||||
|
||||
### Testing
|
||||
|
||||
There are a few different test scripts.
|
||||
Usually during development you only need to run `npm test`, but if you want you can run just a part of the suite:
|
||||
There are different test scripts, usually during development you only need to run `npm test`, but if you want you can run just a part of the suite, following you will find all the testing scripts and what they do.
|
||||
|
||||
| Script | Description |
|
||||
|---|---|
|
||||
| `npm run test:unit` | Runs the content of the `test/unit` folder. |
|
||||
| `npm run test:coverage-100` | Runs unit tests enforcing 100% coverage. |
|
||||
| `npm run test:coverage-report` | Runs unit tests and generates an `lcov` coverage report. |
|
||||
| `npm run test:coverage-ui` | Runs unit tests and generates an HTML coverage report. |
|
||||
| `npm run test:integration` | Runs the integration test runner.<br/>**Note: requires a living instance of Elasticsearch.** |
|
||||
| `npm run lint` | Run the [linter](https://github.com/standard/ts-standard). |
|
||||
| `npm run lint:fix` | Fixes linter errors. |
|
||||
| `npm run license-checker` | Checks that all dependencies have acceptable open source licenses. |
|
||||
|
||||
| `npm test` | Runs `lint` and `test:unit`. |
|
||||
| `npm run test:behavior` | Runs the content of the `test/behavior` folder. |
|
||||
| `npm run test:types` | Runs the content of the `test/types` folder. |
|
||||
| `npm run test:unit -- --cov --coverage-report=html` | Runs the content of the `test/unit` folder and calculates the code coverage. |
|
||||
| `npm run test:integration` | Runs the integration test runner.<br/>*Note: it requires a living instance of Elasticsearch.* |
|
||||
| `npm run lint` | Run the [linter](https://standardjs.com/). |
|
||||
| `npm run lint:fix` | Fixes the lint errors. |
|
||||
| `npm test` | Runs lint, unit, behavior, and types test. |
|
||||
|
||||
#### Integration test
|
||||
The integration test are generated on the fly by the runner you will find inside `test/integration`, once you execute it, it will clone the Elasticsearch repository and checkout the correct version to grab the [OSS yaml files](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/test) and the [Elastic licensed yaml files](https://github.com/elastic/elasticsearch/tree/master/x-pack/plugin/src/test/resources/rest-api-spec/test) that will be used for generating the test.
|
||||
|
||||
The integration tests are generated on the fly by the runner you will find inside `test/integration`.
|
||||
Once you execute it, it will fetch the [YAML REST test files](https://github.com/elastic/elasticsearch/tree/main/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test) from our artifacts API.
|
||||
These are used to generate the integration tests.
|
||||
|
||||
Usually this step is executed by CI since it takes some time, but you can easily run this yourself!
|
||||
Just follow this steps:
|
||||
1. Boot a fresh Elasticsearch instance, which can be done in a Docker container by running `STACK_VERSION=8.10.0 DETACH=true .buildkite/run-elasticsearch.sh`, where `STACK_VERSION` and `DETACH` environment variables can be adjusted to your needs. A `TEST_SUITE` env var can also be set to `free` or `platinum`, and defaults to `free`.
|
||||
1. Run `npm run test:integration` to run the whole suite, or `npm run test:integration -- --bail` to stop after the first failure.
|
||||
1. Grab a coffee, it will take some time. ;)
|
||||
|
||||
This suite is very large, and not all tests will pass.
|
||||
This is fine.
|
||||
This suite is mostly used to identify notable changes in success/fail rate over time as we make changes to the client.
|
||||
Usually this step is executed by CI since it takes some time, but you can easily run this yourself! Just follow this steps:
|
||||
1. Boot an Elasticsearch instance, you can do that by running `./scripts/es-docker.sh` or `./scripts/es-docker-platinum.sh`, the first one will work only with the OSS APIs, while the second will work also with the Elastic licensed APIs;
|
||||
1. If you are running the OSS test, you should use `npm run test:integration`, otherwise use `TEST_ES_SERVER=https://elastic:changeme@localhost:9200 npm run test:integration`. You can also pass a `-b` parameter if you want the test to bail out at the first failure: `npm run test:integration -- -b`;
|
||||
1. Grab a coffee, it will take some time ;)
|
||||
|
||||
### Releasing
|
||||
|
||||
|
||||
11
Makefile
Normal file
11
Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
.PHONY: integration-setup
|
||||
integration-setup: integration-cleanup
|
||||
DETACH=true .ci/run-elasticsearch.sh
|
||||
|
||||
.PHONY: integration-cleanup
|
||||
integration-cleanup:
|
||||
docker container rm --force --volumes instance || true
|
||||
|
||||
.PHONY: integration
|
||||
integration: integration-setup
|
||||
npm run test:integration
|
||||
30
README.md
30
README.md
@ -4,11 +4,6 @@
|
||||
|
||||
[](http://standardjs.com/) [](https://buildkite.com/elastic/elasticsearch-javascript-client-integration-tests/builds?branch=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)
|
||||
|
||||
**[Download the latest version of Elasticsearch](https://www.elastic.co/downloads/elasticsearch)**
|
||||
or
|
||||
**[sign-up](https://cloud.elastic.co/registration?elektra=en-ess-sign-up-page)**
|
||||
**for a free trial of Elastic Cloud**.
|
||||
|
||||
The official Node.js client for Elasticsearch.
|
||||
|
||||
## Installation
|
||||
@ -21,25 +16,6 @@ of the getting started documentation.
|
||||
Refer to the [Connecting section](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_connecting)
|
||||
of the getting started documentation.
|
||||
|
||||
## Compatibility
|
||||
|
||||
The Elasticsearch client is compatible with currently maintained JS versions.
|
||||
|
||||
Language clients are forward compatible; meaning that clients support
|
||||
communicating with greater or equal minor versions of Elasticsearch without
|
||||
breaking. It does not mean that the client automatically supports new features
|
||||
of newer Elasticsearch versions; it is only possible after a release of a new
|
||||
client version. For example, a 8.12 client version won't automatically support
|
||||
the new features of the 8.13 version of Elasticsearch, the 8.13 client version
|
||||
is required for that. Elasticsearch language clients are only backwards
|
||||
compatible with default distributions and without guarantees made.
|
||||
|
||||
| Elasticsearch Version | Elasticsearch-JS Branch | Supported |
|
||||
| --------------------- | ------------------------ | --------- |
|
||||
| main | main | |
|
||||
| 8.x | 8.x | 8.x |
|
||||
| 7.x | 7.x | 7.17 |
|
||||
|
||||
## Usage
|
||||
|
||||
* [Creating an index](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_creating_an_index)
|
||||
@ -52,7 +28,7 @@ compatible with default distributions and without guarantees made.
|
||||
|
||||
### Node.js support
|
||||
|
||||
NOTE: The minimum supported version of Node.js is `v18`.
|
||||
NOTE: The minimum supported version of Node.js is `v14`.
|
||||
|
||||
The client versioning follows the Elastic Stack versioning, this means that
|
||||
major, minor, and patch releases are done following a precise schedule that
|
||||
@ -77,7 +53,6 @@ of `^7.10.0`).
|
||||
| `10.x` | `April 2021` | `7.12` (mid 2021) |
|
||||
| `12.x` | `April 2022` | `8.2` (early 2022) |
|
||||
| `14.x` | `April 2023` | `8.8` (early 2023) |
|
||||
| `16.x` | `September 2023` | `8.11` (late 2023) |
|
||||
|
||||
### Compatibility
|
||||
|
||||
@ -98,8 +73,7 @@ npm install @elastic/elasticsearch@<major>
|
||||
|
||||
#### Browser
|
||||
|
||||
> [!WARNING]
|
||||
> There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues.
|
||||
WARNING: There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues.
|
||||
We recommend that you write a lightweight proxy that uses this client instead, you can see a proxy example [here](./docs/examples/proxy).
|
||||
|
||||
## Documentation
|
||||
|
||||
@ -35,13 +35,15 @@ spec:
|
||||
access_level: READ_ONLY
|
||||
provider_settings:
|
||||
build_pull_requests: false
|
||||
build_branches: false
|
||||
cancel_intermediate_builds: true
|
||||
cancel_intermediate_builds_branch_filter: '!main'
|
||||
schedules:
|
||||
main:
|
||||
main_semi_daily:
|
||||
branch: 'main'
|
||||
cronline: '@daily'
|
||||
8_13:
|
||||
branch: '8.13'
|
||||
cronline: '0 */12 * * *'
|
||||
8_8_semi_daily:
|
||||
branch: '8.8'
|
||||
cronline: '0 */12 * * *'
|
||||
8_7_daily:
|
||||
branch: '8.7'
|
||||
cronline: '@daily'
|
||||
|
||||
@ -91,95 +91,6 @@ const client = new Client({
|
||||
})
|
||||
----
|
||||
|
||||
[discrete]
|
||||
[[redaction]]
|
||||
==== Redaction of potentially sensitive data
|
||||
|
||||
When the client raises an `Error` that originated at the HTTP layer, like a `ConnectionError` or `TimeoutError`, a `meta` object is often attached to the error object that includes metadata useful for debugging, like request and response information. Because this can include potentially sensitive data, like authentication secrets in an `Authorization` header, the client takes measures to redact common sources of sensitive data when this metadata is attached and serialized.
|
||||
|
||||
If your configuration requires extra headers or other configurations that may include sensitive data, you may want to adjust these settings to account for that.
|
||||
|
||||
By default, the `redaction` option is set to `{ type: 'replace' }`, which recursively searches for sensitive key names, case insensitive, and replaces their values with the string `[redacted]`.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
|
||||
const client = new Client({
|
||||
cloud: { id: '<cloud-id>' },
|
||||
auth: { apiKey: 'base64EncodedKey' },
|
||||
})
|
||||
|
||||
try {
|
||||
await client.indices.create({ index: 'my_index' })
|
||||
} catch (err) {
|
||||
console.log(err.meta.meta.request.options.headers.authorization) // prints "[redacted]"
|
||||
}
|
||||
----
|
||||
|
||||
If you would like to redact additional properties, you can include additional key names to search and replace:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
|
||||
const client = new Client({
|
||||
cloud: { id: '<cloud-id>' },
|
||||
auth: { apiKey: 'base64EncodedKey' },
|
||||
headers: { 'X-My-Secret-Password': 'shhh it's a secret!' },
|
||||
redaction: {
|
||||
type: "replace",
|
||||
additionalKeys: ["x-my-secret-password"]
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
await client.indices.create({ index: 'my_index' })
|
||||
} catch (err) {
|
||||
console.log(err.meta.meta.request.options.headers['X-My-Secret-Password']) // prints "[redacted]"
|
||||
}
|
||||
----
|
||||
|
||||
Alternatively, if you know you're not going to use the metadata at all, setting the redaction type to `remove` will remove all optional sources of potentially sensitive data entirely, or replacing them with `null` for required properties.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
|
||||
const client = new Client({
|
||||
cloud: { id: '<cloud-id>' },
|
||||
auth: { apiKey: 'base64EncodedKey' },
|
||||
redaction: { type: "remove" }
|
||||
})
|
||||
|
||||
try {
|
||||
await client.indices.create({ index: 'my_index' })
|
||||
} catch (err) {
|
||||
console.log(err.meta.meta.request.options.headers) // undefined
|
||||
}
|
||||
----
|
||||
|
||||
Finally, if you prefer to turn off redaction altogether, perhaps while debugging on a local developer environment, you can set the redaction type to `off`. This will revert the client to pre-8.11.0 behavior, where basic redaction is only performed during common serialization methods like `console.log` and `JSON.stringify`.
|
||||
|
||||
WARNING: Setting `redaction.type` to `off` is not recommended in production environments.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
|
||||
const client = new Client({
|
||||
cloud: { id: '<cloud-id>' },
|
||||
auth: { apiKey: 'base64EncodedKey' },
|
||||
redaction: { type: "off" }
|
||||
})
|
||||
|
||||
try {
|
||||
await client.indices.create({ index: 'my_index' })
|
||||
} catch (err) {
|
||||
console.log(err.meta.meta.request.options.headers.authorization) // the actual header value will be logged
|
||||
}
|
||||
----
|
||||
|
||||
[discrete]
|
||||
==== Migrate to v8
|
||||
|
||||
|
||||
@ -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_LENGTH +
|
||||
|`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 +
|
||||
_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_LENGTH +
|
||||
|`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 +
|
||||
_Default:_ `null`
|
||||
|
||||
|===
|
||||
|
||||
@ -1,177 +1,6 @@
|
||||
[[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
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.13.0`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.13/release-notes-8.13.0.html[here].
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Ensure new connections inherit client's set defaults https://github.com/elastic/elasticsearch-js/pull/2159[#2159]
|
||||
|
||||
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
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Upgrade transport to 8.4.1 https://github.com/elastic/elasticsearch-js/pull/2137[#2137]
|
||||
|
||||
Upgrades `@elastic/transport` to 8.4.1 to resolve https://github.com/elastic/elastic-transport-js/pull/83[a bug] where arrays in error diagnostics were unintentionally transformed into objects.
|
||||
|
||||
[discrete]
|
||||
=== 8.12.1
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Fix hang in bulk helper semaphore https://github.com/elastic/elasticsearch-js/pull/2027[#2027]
|
||||
|
||||
The failing state could be reached when a server's response times are slower than flushInterval.
|
||||
|
||||
[discrete]
|
||||
=== 8.12.0
|
||||
|
||||
[discrete]
|
||||
=== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.12.0`
|
||||
|
||||
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
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.11.0`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.11/release-notes-8.11.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Enhanced support for redacting potentially sensitive data https://github.com/elastic/elasticsearch-js/pull/2095[#2095]
|
||||
|
||||
`@elastic/transport` https://github.com/elastic/elastic-transport-js/releases/tag/v8.4.0[version 8.4.0] introduces enhanced measures for ensuring that request metadata attached to some `Error` objects is redacted. This functionality is primarily to address custom logging solutions that don't use common serialization methods like `JSON.stringify`, `console.log`, or `util.inspect`, which were already accounted for.
|
||||
|
||||
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
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.10.0`
|
||||
|
||||
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
|
||||
|
||||
@ -490,7 +319,7 @@ client.search({ params }, { options }, (err, result) => {
|
||||
client.search({ params }, { options })
|
||||
.then(console.log)
|
||||
.catch(console.log)
|
||||
|
||||
|
||||
// async-style (sugar syntax on top of promises)
|
||||
const response = await client.search({ params }, { options })
|
||||
console.log(response)
|
||||
@ -545,9 +374,6 @@ The client API leaks HTTP-related notions in many places, and removing them woul
|
||||
|
||||
This could be a rather big breaking change, so a double solution could be used during the 8.x lifecycle. (accepting body keys without them being wrapped in the body as well as the current solution).
|
||||
|
||||
To convert code from 7.x, you need to remove the `body` parameter in all the endpoints request.
|
||||
For instance, this is an example for the `search` endpoint:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
// from
|
||||
@ -586,12 +412,6 @@ If you weren't extending the internals of the client, this won't be a breaking c
|
||||
The client API leaks HTTP-related notions in many places, and removing them would definitely improve the DX.
|
||||
The client will expose a new request-specific option to still get the full response details.
|
||||
|
||||
The new behaviour returns the `body` value directly as response.
|
||||
If you want to have the 7.x response format, you need to add `meta : true` in the request.
|
||||
This will return all the HTTP meta information, including the `body`.
|
||||
|
||||
For instance, this is an example for the `search` endpoint:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
// from
|
||||
@ -650,7 +470,7 @@ If you weren't extending the internals of the client, this won't be a breaking c
|
||||
|
||||
*Breaking: Yes* | *Migration effort: Medium*
|
||||
|
||||
Currently, every path or query parameter could be expressed in both `snake_case` and `camelCase`. Internally the client will convert everything to `snake_case`.
|
||||
Currently, every path or query parameter could be expressed in both `snake_case` and `camelCase`. Internally the client will convert everything to `snake_case`.
|
||||
This was done in an effort to reduce the friction of migrating from the legacy to the new client, but now it no longer makes sense.
|
||||
If you are already using `snake_case` keys, this won't be a breaking change for you.
|
||||
|
||||
|
||||
@ -11,8 +11,6 @@ This page contains the information you need to connect and use the Client with
|
||||
* <<client-faas-env, Using the Client in a Function-as-a-Service Environment>>
|
||||
* <<client-connect-proxy, Connecting through a proxy>>
|
||||
* <<client-error-handling, Handling errors>>
|
||||
* <<keep-alive, Keep-alive connections>>
|
||||
* <<close-connections, Closing a client's connections>>
|
||||
* <<product-check, Automatic product check>>
|
||||
|
||||
[[authentication]]
|
||||
@ -661,51 +659,6 @@ a|* `name` - `string`
|
||||
* `headers` - `object`, the response status code
|
||||
|===
|
||||
|
||||
[[keep-alive]]
|
||||
[discrete]
|
||||
=== Keep-alive connections
|
||||
|
||||
By default, the client uses persistent, keep-alive connections to reduce the overhead of creating a new HTTP connection for each Elasticsearch request.
|
||||
If you are using the default `UndiciConnection` connection class, it maintains a pool of 256 connections with a keep-alive of 10 minutes.
|
||||
If you are using the legacy `HttpConnection` connection class, it maintains a pool of 256 connections with a keep-alive of 1 minute.
|
||||
|
||||
If you need to disable keep-alive connections, you can override the HTTP agent with your preferred https://nodejs.org/api/http.html#http_new_agent_options[HTTP agent options]:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
// the function takes as parameter the option
|
||||
// object passed to the Connection constructor
|
||||
agent: (opts) => new CustomAgent()
|
||||
})
|
||||
----
|
||||
|
||||
Or you can disable the HTTP agent entirely:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
// Disable agent and keep-alive
|
||||
agent: false
|
||||
})
|
||||
----
|
||||
|
||||
[discrete]
|
||||
[[close-connections]]
|
||||
=== Closing a client's connections
|
||||
|
||||
If you would like to close all open connections being managed by an instance of the client, use the `close()` function:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200'
|
||||
});
|
||||
client.close();
|
||||
----
|
||||
|
||||
[discrete]
|
||||
[[product-check]]
|
||||
=== Automatic product check
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
[source,js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: 'books',
|
||||
query: {
|
||||
match: {
|
||||
name: 'brave'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
@ -1,13 +0,0 @@
|
||||
[source,js]
|
||||
----
|
||||
const response = await client.index({
|
||||
index: 'books',
|
||||
document: {
|
||||
name: 'Snow Crash',
|
||||
author: 'Neal Stephenson',
|
||||
release_date: '1992-06-01',
|
||||
page_count: 470,
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
@ -1,7 +0,0 @@
|
||||
[source,js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: 'books'
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
@ -1,43 +0,0 @@
|
||||
[source,js]
|
||||
----
|
||||
const response = await client.bulk({
|
||||
operations: [
|
||||
{ index: { _index: 'books' } },
|
||||
{
|
||||
name: 'Revelation Space',
|
||||
author: 'Alastair Reynolds',
|
||||
release_date: '2000-03-15',
|
||||
page_count: 585,
|
||||
},
|
||||
{ index: { _index: 'books' } },
|
||||
{
|
||||
name: '1984',
|
||||
author: 'George Orwell',
|
||||
release_date: '1985-06-01',
|
||||
page_count: 328,
|
||||
},
|
||||
{ index: { _index: 'books' } },
|
||||
{
|
||||
name: 'Fahrenheit 451',
|
||||
author: 'Ray Bradbury',
|
||||
release_date: '1953-10-15',
|
||||
page_count: 227,
|
||||
},
|
||||
{ index: { _index: 'books' } },
|
||||
{
|
||||
name: 'Brave New World',
|
||||
author: 'Aldous Huxley',
|
||||
release_date: '1932-06-01',
|
||||
page_count: 268,
|
||||
},
|
||||
{ index: { _index: 'books' } },
|
||||
{
|
||||
name: 'The Handmaids Tale',
|
||||
author: 'Margaret Atwood',
|
||||
release_date: '1985-06-01',
|
||||
page_count: 311,
|
||||
}
|
||||
]
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
@ -1,7 +1,7 @@
|
||||
[[as_stream_examples]]
|
||||
=== asStream
|
||||
|
||||
Instead of getting the parsed body back, you will get the raw Node.js stream of
|
||||
Instead of getting the parsed body back, you will get the raw Node.js stream of
|
||||
data.
|
||||
|
||||
[source,js]
|
||||
@ -57,18 +57,28 @@ async function run () {
|
||||
asStream: true
|
||||
})
|
||||
|
||||
// stream async iteration, available in Node.js ≥ 10
|
||||
let payload = ''
|
||||
result.setEncoding('utf8')
|
||||
body.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)
|
||||
----
|
||||
|
||||
TIP: This can be useful if you need to pipe the {es}'s response to a proxy, or
|
||||
TIP: This can be useful if you need to pipe the {es}'s response to a proxy, or
|
||||
send it directly to another source.
|
||||
|
||||
[source,js]
|
||||
|
||||
@ -36,27 +36,27 @@ async function run () {
|
||||
id: 1,
|
||||
text: 'If I fall, don\'t bring me back.',
|
||||
user: 'jon',
|
||||
time: new Date()
|
||||
date: new Date()
|
||||
}, {
|
||||
id: 2,
|
||||
text: 'Winter is coming',
|
||||
user: 'ned',
|
||||
time: new Date()
|
||||
date: new Date()
|
||||
}, {
|
||||
id: 3,
|
||||
text: 'A Lannister always pays his debts.',
|
||||
user: 'tyrion',
|
||||
time: new Date()
|
||||
date: new Date()
|
||||
}, {
|
||||
id: 4,
|
||||
text: 'I am the blood of the dragon.',
|
||||
user: 'daenerys',
|
||||
time: new Date()
|
||||
date: new Date()
|
||||
}, {
|
||||
id: 5, // change this value to a string to see the bulk response with errors
|
||||
text: 'A girl is Arya Stark of Winterfell. And I\'m going home.',
|
||||
user: 'arya',
|
||||
time: new Date()
|
||||
date: new Date()
|
||||
}]
|
||||
|
||||
const operations = dataset.flatMap(doc => [{ index: { _index: 'tweets' } }, doc])
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"test": "standard"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Elastic Client Library Maintainers",
|
||||
"author": "Tomas Della Vedova",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@elastic/elasticsearch": "^8.0.0"
|
||||
|
||||
@ -55,7 +55,7 @@ async function run () {
|
||||
source: {
|
||||
index: 'game-of-thrones',
|
||||
query: {
|
||||
match: { house: 'stark' }
|
||||
match: { character: 'stark' }
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
|
||||
@ -98,17 +98,6 @@ 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`
|
||||
@ -613,97 +602,3 @@ 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>()
|
||||
----
|
||||
|
||||
@ -24,7 +24,7 @@ To learn more about the supported major versions, please refer to the
|
||||
[[nodejs-support]]
|
||||
=== Node.js support
|
||||
|
||||
NOTE: The minimum supported version of Node.js is `v18`.
|
||||
NOTE: The minimum supported version of Node.js is `v14`.
|
||||
|
||||
The client versioning follows the {stack} versioning, this means that
|
||||
major, minor, and patch releases are done following a precise schedule that
|
||||
@ -64,46 +64,31 @@ of `^7.10.0`).
|
||||
|`14.x`
|
||||
|April 2023
|
||||
|`8.8` (early 2023)
|
||||
|
||||
|`16.x`
|
||||
|September 2023
|
||||
|`8.11` (late 2023)
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
[[js-compatibility-matrix]]
|
||||
=== Compatibility matrix
|
||||
|
||||
Language clients are forward compatible; meaning that clients support
|
||||
communicating with greater or equal minor versions of {es} without breaking. It
|
||||
does not mean that the client automatically supports new features of newer {es}
|
||||
versions; it is only possible after a release of a new client version. For
|
||||
example, a 8.12 client version won't automatically support the new features of
|
||||
the 8.13 version of {es}, the 8.13 client version is required for that.
|
||||
{es} language clients are only backwards compatible with default distributions
|
||||
and without guarantees made.
|
||||
Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch.
|
||||
Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
|
||||
|
||||
[%header,cols=3*]
|
||||
[%header,cols=2*]
|
||||
|===
|
||||
|{es} Version
|
||||
|Client Version
|
||||
|Supported
|
||||
|
||||
|`8.x`
|
||||
|`8.x`
|
||||
|`8.x`
|
||||
|
||||
|`7.x`
|
||||
|`7.x`
|
||||
|`7.17`
|
||||
|
||||
|`6.x`
|
||||
|`6.x`
|
||||
|
|
||||
|
||||
|`5.x`
|
||||
|`5.x`
|
||||
|
|
||||
|===
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "@elastic/elasticsearch",
|
||||
"version": "8.14.1",
|
||||
"versionCanary": "8.14.1-canary.0",
|
||||
"version": "8.9.2",
|
||||
"versionCanary": "8.9.2-canary.0",
|
||||
"description": "The official Elasticsearch client for Node.js",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"type": "commonjs",
|
||||
"scripts": {
|
||||
"test": "npm run build && npm run lint && tap test/unit/{*,**/*}.test.ts",
|
||||
"test:unit": "npm run build && tap test/unit/{*,**/*}.test.ts",
|
||||
@ -33,7 +32,11 @@
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Elastic Client Library Maintainers",
|
||||
"name": "Tomas Della Vedova",
|
||||
"company": "Elastic BV"
|
||||
},
|
||||
{
|
||||
"name": "Josh Mock",
|
||||
"company": "Elastic BV"
|
||||
}
|
||||
],
|
||||
@ -47,7 +50,7 @@
|
||||
},
|
||||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1",
|
||||
@ -83,7 +86,7 @@
|
||||
"zx": "^7.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@elastic/transport": "^8.6.0",
|
||||
"@elastic/transport": "~8.3.4",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"tap": {
|
||||
|
||||
77
scripts/es-docker-platinum.sh
Executable file
77
scripts/es-docker-platinum.sh
Executable file
@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Images are cached locally, it may be needed
|
||||
# to delete an old image and download again
|
||||
# the latest snapshot.
|
||||
|
||||
repo=$(pwd)
|
||||
testnodecrt="/.ci/certs/testnode.crt"
|
||||
testnodekey="/.ci/certs/testnode.key"
|
||||
cacrt="/.ci/certs/ca.crt"
|
||||
|
||||
# pass `--clean` to reemove the old snapshot
|
||||
if [ "$1" == "--clean" ]; then
|
||||
docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep '8.0.0-SNAPSHOT')
|
||||
fi
|
||||
|
||||
# Create the 'elastic' network if doesn't exist
|
||||
exec docker network ls | grep elastic > /dev/null || docker network create elastic > /dev/null
|
||||
|
||||
if [ "$1" == "--detach" ]; then
|
||||
exec docker run \
|
||||
--rm \
|
||||
-e "node.attr.testattr=test" \
|
||||
-e "path.repo=/tmp" \
|
||||
-e "repositories.url.allowed_urls=http://snapshot.*" \
|
||||
-e "discovery.type=single-node" \
|
||||
-e "action.destructive_requires_name=false" \
|
||||
-e "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
|
||||
-e "ELASTIC_PASSWORD=changeme" \
|
||||
-e "xpack.security.enabled=true" \
|
||||
-e "xpack.license.self_generated.type=trial" \
|
||||
-e "xpack.security.http.ssl.enabled=true" \
|
||||
-e "xpack.security.http.ssl.verification_mode=certificate" \
|
||||
-e "xpack.security.http.ssl.key=certs/testnode.key" \
|
||||
-e "xpack.security.http.ssl.certificate=certs/testnode.crt" \
|
||||
-e "xpack.security.http.ssl.certificate_authorities=certs/ca.crt" \
|
||||
-e "xpack.security.transport.ssl.enabled=true" \
|
||||
-e "xpack.security.transport.ssl.key=certs/testnode.key" \
|
||||
-e "xpack.security.transport.ssl.certificate=certs/testnode.crt" \
|
||||
-e "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt" \
|
||||
-v "$repo$testnodecrt:/usr/share/elasticsearch/config/certs/testnode.crt" \
|
||||
-v "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \
|
||||
-v "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \
|
||||
-p 9200:9200 \
|
||||
--detach \
|
||||
--network=elastic \
|
||||
--name=elasticsearch \
|
||||
docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
|
||||
else
|
||||
exec docker run \
|
||||
--rm \
|
||||
-e "node.attr.testattr=test" \
|
||||
-e "path.repo=/tmp" \
|
||||
-e "repositories.url.allowed_urls=http://snapshot.*" \
|
||||
-e "discovery.type=single-node" \
|
||||
-e "action.destructive_requires_name=false" \
|
||||
-e "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
|
||||
-e "ELASTIC_PASSWORD=changeme" \
|
||||
-e "xpack.security.enabled=true" \
|
||||
-e "xpack.license.self_generated.type=trial" \
|
||||
-e "xpack.security.http.ssl.enabled=true" \
|
||||
-e "xpack.security.http.ssl.verification_mode=certificate" \
|
||||
-e "xpack.security.http.ssl.key=certs/testnode.key" \
|
||||
-e "xpack.security.http.ssl.certificate=certs/testnode.crt" \
|
||||
-e "xpack.security.http.ssl.certificate_authorities=certs/ca.crt" \
|
||||
-e "xpack.security.transport.ssl.enabled=true" \
|
||||
-e "xpack.security.transport.ssl.key=certs/testnode.key" \
|
||||
-e "xpack.security.transport.ssl.certificate=certs/testnode.crt" \
|
||||
-e "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt" \
|
||||
-v "$repo$testnodecrt:/usr/share/elasticsearch/config/certs/testnode.crt" \
|
||||
-v "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \
|
||||
-v "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \
|
||||
-p 9200:9200 \
|
||||
--network=elastic \
|
||||
--name=elasticsearch \
|
||||
docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
|
||||
fi
|
||||
40
scripts/es-docker.sh
Executable file
40
scripts/es-docker.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Images are cached locally, it may be needed
|
||||
# to delete an old image and download again
|
||||
# the latest snapshot.
|
||||
|
||||
# pass `--clean` to reemove the old snapshot
|
||||
if [ "$1" == "--clean" ]; then
|
||||
docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep '8.0.0-SNAPSHOT')
|
||||
fi
|
||||
|
||||
# Create the 'elastic' network if doesn't exist
|
||||
exec docker network ls | grep elastic > /dev/null || docker network create elastic > /dev/null
|
||||
|
||||
if [ "$1" == "--detach" ]; then
|
||||
exec docker run \
|
||||
--rm \
|
||||
-e "node.attr.testattr=test" \
|
||||
-e "path.repo=/tmp" \
|
||||
-e "repositories.url.allowed_urls=http://snapshot.*" \
|
||||
-e "discovery.type=single-node" \
|
||||
-e "action.destructive_requires_name=false" \
|
||||
-p 9200:9200 \
|
||||
--detach \
|
||||
--network=elastic \
|
||||
--name=elasticsearch \
|
||||
docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
|
||||
else
|
||||
exec docker run \
|
||||
--rm \
|
||||
-e "node.attr.testattr=test" \
|
||||
-e "path.repo=/tmp" \
|
||||
-e "repositories.url.allowed_urls=http://snapshot.*" \
|
||||
-e "discovery.type=single-node" \
|
||||
-e "action.destructive_requires_name=false" \
|
||||
-p 9200:9200 \
|
||||
--network=elastic \
|
||||
--name=elasticsearch \
|
||||
docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
|
||||
fi
|
||||
@ -232,7 +232,7 @@ function generateSingleApi (version, spec, common) {
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
${buildPath()}
|
||||
${buildPath(api)}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
@ -254,7 +254,7 @@ function generateSingleApi (version, spec, common) {
|
||||
documentation: generateDocumentation(spec[api], api)
|
||||
}
|
||||
|
||||
function genRequiredChecks () {
|
||||
function genRequiredChecks (param) {
|
||||
const code = required
|
||||
.map(_genRequiredCheck)
|
||||
.concat(_noBody())
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class AsyncSearch {
|
||||
|
||||
/**
|
||||
* Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/async-search.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,18 +66,12 @@ export default class AsyncSearch {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_async_search/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'async_search.delete',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the results of a previously submitted async search request given its ID.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/async-search.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -99,18 +92,12 @@ export default class AsyncSearch {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_async_search/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'async_search.get',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the status of a previously submitted async search request given its ID.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/async-search.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -131,18 +118,12 @@ export default class AsyncSearch {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_async_search/status/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'async_search.status',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a search request asynchronously.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/async-search.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -189,12 +170,6 @@ export default class AsyncSearch {
|
||||
method = 'POST'
|
||||
path = '/_async_search'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'async_search.submit',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,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/8.14/autoscaling-delete-autoscaling-policy.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,18 +66,12 @@ export default class Autoscaling {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_autoscaling/policy/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'autoscaling.delete_autoscaling_policy',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -100,15 +93,12 @@ export default class Autoscaling {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_autoscaling/capacity'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'autoscaling.get_autoscaling_capacity'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -129,18 +119,12 @@ export default class Autoscaling {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_autoscaling/policy/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'autoscaling.get_autoscaling_policy',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/autoscaling-put-autoscaling-policy.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -166,12 +150,6 @@ export default class Autoscaling {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_autoscaling/policy/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'autoscaling.put_autoscaling_policy',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/docs-bulk.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -73,11 +72,5 @@ export default async function BulkApi<TDocument = unknown, TPartialDocument = un
|
||||
method = 'POST'
|
||||
path = '/_bulk'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'bulk',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,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/8.14/cat-alias.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -75,18 +74,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/aliases'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.aliases',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/cat-allocation.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -115,18 +108,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/allocation'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.allocation',
|
||||
pathParts: {
|
||||
node_id: params.node_id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about existing component_templates templates.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-component-templates.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -155,18 +142,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/component_templates'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.component_templates',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/cat-count.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -195,18 +176,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/count'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.count',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/cat-fielddata.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -235,18 +210,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/fielddata'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.fielddata',
|
||||
pathParts: {
|
||||
fields: params.fields
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a concise representation of the cluster health.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-health.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -268,15 +237,12 @@ export default class Cat {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cat/health'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.health'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns help for the Cat APIs.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -298,15 +264,12 @@ export default class Cat {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cat'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.help'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about indices: number of primaries and replicas, document counts, disk size, ...
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-indices.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -335,18 +298,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/indices'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.indices',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about the master node.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-master.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -368,15 +325,12 @@ export default class Cat {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cat/master'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.master'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configuration and usage information about data frame analytics jobs.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-dfanalytics.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -405,18 +359,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/ml/data_frame/analytics'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.ml_data_frame_analytics',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configuration and usage information about datafeeds.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-datafeeds.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -445,18 +393,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/ml/datafeeds'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.ml_datafeeds',
|
||||
pathParts: {
|
||||
datafeed_id: params.datafeed_id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configuration and usage information about anomaly detection jobs.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-anomaly-detectors.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -485,18 +427,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/ml/anomaly_detectors'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.ml_jobs',
|
||||
pathParts: {
|
||||
job_id: params.job_id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configuration and usage information about inference trained models.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-trained-model.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -525,18 +461,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/ml/trained_models'
|
||||
}
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about custom node attributes.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-nodeattrs.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -558,15 +488,12 @@ export default class Cat {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cat/nodeattrs'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.nodeattrs'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns basic statistics about performance of cluster nodes.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-nodes.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -588,15 +515,12 @@ export default class Cat {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cat/nodes'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.nodes'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a concise representation of the cluster pending tasks.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-pending-tasks.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -618,15 +542,12 @@ export default class Cat {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cat/pending_tasks'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.pending_tasks'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about installed plugins across nodes node.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-plugins.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -648,15 +569,12 @@ export default class Cat {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cat/plugins'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.plugins'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about index shard recoveries, both on-going completed.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-recovery.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -685,18 +603,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/recovery'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.recovery',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about snapshot repositories registered in the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-repositories.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -718,15 +630,12 @@ export default class Cat {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cat/repositories'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.repositories'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides low-level information about the segments in the shards of an index.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-segments.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -755,18 +664,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/segments'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.segments',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a detailed view of shard allocation on nodes.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-shards.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -795,18 +698,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/shards'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.shards',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all snapshots in a specific repository.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-snapshots.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -835,18 +732,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/snapshots'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.snapshots',
|
||||
pathParts: {
|
||||
repository: params.repository
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/tasks.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -868,15 +759,12 @@ export default class Cat {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cat/tasks'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.tasks'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about existing templates.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-templates.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -905,18 +793,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/templates'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.templates',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/cat-thread-pool.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -945,18 +827,12 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/thread_pool'
|
||||
}
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configuration and usage information about transforms.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cat-transforms.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -985,12 +861,6 @@ export default class Cat {
|
||||
method = 'GET'
|
||||
path = '/_cat/transforms'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cat.transforms',
|
||||
pathParts: {
|
||||
transform_id: params.transform_id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class Ccr {
|
||||
|
||||
/**
|
||||
* Deletes auto-follow patterns.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-delete-auto-follow-pattern.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,18 +66,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.delete_auto_follow_pattern',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new follower index configured to follow the referenced leader index.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-put-follow.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -111,18 +104,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/follow`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.follow',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/ccr-get-follow-info.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -143,18 +130,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/info`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.follow_info',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/ccr-get-follow-stats.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -175,18 +156,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/stats`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.follow_stats',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the follower retention leases from the leader.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-post-forget-follower.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -219,18 +194,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/forget_follower`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.forget_follower',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-get-auto-follow-pattern.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -259,18 +228,12 @@ export default class Ccr {
|
||||
method = 'GET'
|
||||
path = '/_ccr/auto_follow'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.get_auto_follow_pattern',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Pauses an auto-follow pattern
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-pause-auto-follow-pattern.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -291,18 +254,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}/pause`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.pause_auto_follow_pattern',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/ccr-post-pause-follow.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -323,18 +280,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/pause_follow`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.pause_follow',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/ccr-put-auto-follow-pattern.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -367,18 +318,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.put_auto_follow_pattern',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Resumes an auto-follow pattern that has been paused
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-resume-auto-follow-pattern.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -399,18 +344,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/_ccr/auto_follow/${encodeURIComponent(params.name.toString())}/resume`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.resume_auto_follow_pattern',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Resumes a follower index that has been paused
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-post-resume-follow.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -443,18 +382,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/resume_follow`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.resume_follow',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all stats related to cross-cluster replication.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ccr-get-stats.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -476,15 +409,12 @@ export default class Ccr {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_ccr/stats'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.stats'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/ccr-post-unfollow.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -505,12 +435,6 @@ export default class Ccr {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ccr/unfollow`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ccr.unfollow',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Explicitly clears the search context for a scroll.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/clear-scroll-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -74,11 +73,5 @@ export default async function ClearScrollApi (this: That, params?: T.ClearScroll
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = '/_search/scroll'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'clear_scroll',
|
||||
pathParts: {
|
||||
scroll_id: params.scroll_id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Close a point in time
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/point-in-time-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -73,8 +72,5 @@ export default async function ClosePointInTimeApi (this: That, params: T.ClosePo
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = '/_pit'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'close_point_in_time'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class Cluster {
|
||||
|
||||
/**
|
||||
* Provides explanations for shard allocations in the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-allocation-explain.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -80,15 +79,12 @@ export default class Cluster {
|
||||
|
||||
const method = body != null ? 'POST' : 'GET'
|
||||
const path = '/_cluster/allocation/explain'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.allocation_explain'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a component template
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-component-template.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -109,18 +105,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_component_template/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.delete_component_template',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears cluster voting config exclusions.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/voting-config-exclusions.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -142,15 +132,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = '/_cluster/voting_config_exclusions'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.delete_voting_config_exclusions'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about whether a particular component template exist
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-component-template.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -171,18 +158,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'HEAD'
|
||||
const path = `/_component_template/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.exists_component_template',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns one or more component templates
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-component-template.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -211,18 +192,12 @@ export default class Cluster {
|
||||
method = 'GET'
|
||||
path = '/_component_template'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.get_component_template',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns cluster settings.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-get-settings.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -244,15 +219,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cluster/settings'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.get_settings'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns basic information about the health of the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-health.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -281,18 +253,12 @@ export default class Cluster {
|
||||
method = 'GET'
|
||||
path = '/_cluster/health'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.health',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns different information about the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-info.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -313,18 +279,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_info/${encodeURIComponent(params.target.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.info',
|
||||
pathParts: {
|
||||
target: params.target
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/cluster-pending.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -346,15 +306,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_cluster/pending_tasks'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.pending_tasks'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the cluster voting config exclusions by node ids or node names.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/voting-config-exclusions.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -376,22 +333,19 @@ export default class Cluster {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_cluster/voting_config_exclusions'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.post_voting_config_exclusions'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates a component template
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-component-template.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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[] = ['template', 'version', '_meta', 'deprecated']
|
||||
const acceptedBody: string[] = ['template', 'version', '_meta', 'allow_auto_create']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
@ -417,18 +371,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_component_template/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.put_component_template',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the cluster settings.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-update-settings.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -462,15 +410,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = '/_cluster/settings'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.put_settings'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the information about configured remote clusters.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-remote-info.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -492,15 +437,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_remote/info'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.remote_info'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to manually change the allocation of individual shards in the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-reroute.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -534,15 +476,12 @@ export default class Cluster {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_cluster/reroute'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.reroute'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a comprehensive information about the state of the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-state.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -574,19 +513,12 @@ export default class Cluster {
|
||||
method = 'GET'
|
||||
path = '/_cluster/state'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.state',
|
||||
pathParts: {
|
||||
metric: params.metric,
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns high-level overview of cluster statistics.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-stats.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -615,12 +547,6 @@ export default class Cluster {
|
||||
method = 'GET'
|
||||
path = '/_cluster/stats'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'cluster.stats',
|
||||
pathParts: {
|
||||
node_id: params.node_id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns number of documents matching a query.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-count.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -81,11 +80,5 @@ export default async function CountApi (this: That, params?: T.CountRequest | TB
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_count'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'count',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/docs-index_.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -66,12 +65,5 @@ export default async function CreateApi<TDocument = unknown> (this: That, params
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_create/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'create',
|
||||
pathParts: {
|
||||
id: params.id,
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class DanglingIndices {
|
||||
|
||||
/**
|
||||
* Deletes the specified dangling index
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-gateway-dangling-indices.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,18 +66,12 @@ export default class DanglingIndices {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_dangling/${encodeURIComponent(params.index_uuid.toString())}`
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports the specified dangling index
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-gateway-dangling-indices.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -99,18 +92,12 @@ export default class DanglingIndices {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/_dangling/${encodeURIComponent(params.index_uuid.toString())}`
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all dangling indices.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-gateway-dangling-indices.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -132,9 +119,6 @@ export default class DanglingIndices {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_dangling'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'dangling_indices.list_dangling_indices'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Removes a document from the index.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-delete.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,12 +60,5 @@ 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())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'delete',
|
||||
pathParts: {
|
||||
id: params.id,
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Deletes documents matching the provided query.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-delete-by-query.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -73,11 +72,5 @@ export default async function DeleteByQueryApi (this: That, params: T.DeleteByQu
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_delete_by_query`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'delete_by_query',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/docs-delete-by-query.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,11 +60,5 @@ export default async function DeleteByQueryRethrottleApi (this: That, params: T.
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/_delete_by_query/${encodeURIComponent(params.task_id.toString())}/_rethrottle`
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Deletes a script.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-scripting.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,11 +60,5 @@ export default async function DeleteScriptApi (this: That, params: T.DeleteScrip
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_scripts/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'delete_script',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class Enrich {
|
||||
|
||||
/**
|
||||
* Deletes an existing enrich policy and its enrich index.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-enrich-policy-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,18 +66,12 @@ export default class Enrich {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'enrich.delete_policy',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the enrich index for an existing enrich policy.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/execute-enrich-policy-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -99,18 +92,12 @@ export default class Enrich {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}/_execute`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'enrich.execute_policy',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets information about an enrich policy.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-enrich-policy-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -139,18 +126,12 @@ export default class Enrich {
|
||||
method = 'GET'
|
||||
path = '/_enrich/policy'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'enrich.get_policy',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new enrich policy.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/put-enrich-policy-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -183,18 +164,12 @@ export default class Enrich {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'enrich.put_policy',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets enrich coordinator statistics and information about enrich policies that are currently executing.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/enrich-stats-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -216,9 +191,6 @@ export default class Enrich {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_enrich/_stats'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'enrich.stats'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class Eql {
|
||||
|
||||
/**
|
||||
* Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/eql-search-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,18 +66,12 @@ export default class Eql {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_eql/search/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'eql.delete',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns async results from previously executed Event Query Language (EQL) search
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-async-eql-search-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -99,18 +92,12 @@ export default class Eql {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_eql/search/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'eql.get',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/get-async-eql-status-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/eql-search-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>>
|
||||
@ -131,18 +118,12 @@ export default class Eql {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_eql/search/status/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'eql.get_status',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns results matching a query expressed in Event Query Language (EQL)
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/eql-search-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -175,12 +156,6 @@ export default class Eql {
|
||||
|
||||
const method = body != null ? 'POST' : 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_eql/search`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'eql.search',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,148 +0,0 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
/* eslint-disable @typescript-eslint/no-misused-new */
|
||||
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
// This file was automatically generated by elastic/elastic-client-generator-js
|
||||
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
|
||||
// and elastic/elastic-client-generator-js to regenerate this file again.
|
||||
|
||||
import {
|
||||
Transport,
|
||||
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 Esql {
|
||||
transport: Transport
|
||||
constructor (transport: Transport) {
|
||||
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/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>>
|
||||
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlQueryResponse>
|
||||
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'query']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
let body: Record<string, any> | string
|
||||
if (typeof userBody === 'string') {
|
||||
body = userBody
|
||||
} else {
|
||||
body = userBody != null ? { ...userBody } : undefined
|
||||
}
|
||||
|
||||
for (const key in params) {
|
||||
if (acceptedBody.includes(key)) {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_query'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'esql.query'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/docs-get.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,12 +60,5 @@ 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())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'exists',
|
||||
pathParts: {
|
||||
id: params.id,
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/docs-get.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,12 +60,5 @@ export default async function ExistsSourceApi (this: That, params: T.ExistsSourc
|
||||
|
||||
const method = 'HEAD'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_source/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'exists_source',
|
||||
pathParts: {
|
||||
id: params.id,
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/search-explain.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -73,12 +72,5 @@ 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())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'explain',
|
||||
pathParts: {
|
||||
id: params.id,
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,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/8.14/get-features-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -68,15 +67,12 @@ export default class Features {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_features'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'features.get_features'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the internal state of features, usually by deleting system indices
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-snapshots.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -98,9 +94,6 @@ export default class Features {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_features/_reset'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'features.reset_features'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/search-field-caps.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -81,11 +80,5 @@ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequ
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_field_caps'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'field_caps',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -44,71 +43,9 @@ export default class Fleet {
|
||||
this.transport = transport
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a secret stored by Fleet.
|
||||
*/
|
||||
async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
|
||||
params = params ?? {}
|
||||
for (const key in params) {
|
||||
if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_fleet/secret/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'fleet.delete_secret',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a secret stored by Fleet.
|
||||
*/
|
||||
async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async getSecret (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 = `/_fleet/secret/${encodeURIComponent(params.id.toString())}`
|
||||
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/8.14/get-global-checkpoints.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -129,13 +66,7 @@ export default class Fleet {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_fleet/global_checkpoints`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'fleet.global_checkpoints',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -172,41 +103,7 @@ export default class Fleet {
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_fleet/_fleet_msearch'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'fleet.msearch',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a secret stored by Fleet.
|
||||
*/
|
||||
async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async postSecret (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 = '/_fleet/secret'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'fleet.post_secret'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -243,12 +140,6 @@ export default class Fleet {
|
||||
|
||||
const method = body != null ? 'POST' : 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_fleet/_fleet_search`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'fleet.search',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns a document.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-get.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,12 +60,5 @@ 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())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'get',
|
||||
pathParts: {
|
||||
id: params.id,
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns a script.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-scripting.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,11 +60,5 @@ export default async function GetScriptApi (this: That, params: T.GetScriptReque
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_scripts/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'get_script',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns all script contexts.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/8.14/painless-contexts.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/8.9/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>>
|
||||
@ -62,8 +61,5 @@ export default async function GetScriptContextApi (this: That, params?: T.GetScr
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_script_context'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'get_script_context'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns available script types, languages and contexts
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-scripting.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -62,8 +61,5 @@ export default async function GetScriptLanguagesApi (this: That, params?: T.GetS
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_script_language'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'get_script_languages'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns the source of a document.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-get.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,12 +60,5 @@ export default async function GetSourceApi<TDocument = unknown> (this: That, par
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_source/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'get_source',
|
||||
pathParts: {
|
||||
id: params.id,
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,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/8.14/graph-explore-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -79,12 +78,6 @@ export default class Graph {
|
||||
|
||||
const method = body != null ? 'POST' : 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_graph/explore`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'graph.explore',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns the health of the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/health-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -69,11 +68,5 @@ export default async function HealthReportApi (this: That, params?: T.HealthRepo
|
||||
method = 'GET'
|
||||
path = '/_health_report'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'health_report',
|
||||
pathParts: {
|
||||
feature: params.feature
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,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/8.14/ilm-delete-lifecycle.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,18 +66,12 @@ export default class Ilm {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_ilm/policy/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.delete_lifecycle',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/ilm-explain-lifecycle.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -99,18 +92,12 @@ export default class Ilm {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ilm/explain`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.explain_lifecycle',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the specified policy definition. Includes the policy version and last modified date.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-get-lifecycle.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -139,18 +126,12 @@ export default class Ilm {
|
||||
method = 'GET'
|
||||
path = '/_ilm/policy'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.get_lifecycle',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the current index lifecycle management (ILM) status.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-get-status.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -172,15 +153,12 @@ export default class Ilm {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_ilm/status'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.get_status'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/ilm-migrate-to-data-tiers.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -214,15 +192,12 @@ export default class Ilm {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_ilm/migrate_to_data_tiers'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.migrate_to_data_tiers'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually moves an index into the specified step and executes that step.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-move-to-step.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -255,18 +230,12 @@ export default class Ilm {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/_ilm/move/${encodeURIComponent(params.index.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.move_to_step',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a lifecycle policy
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-put-lifecycle.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -299,18 +268,12 @@ export default class Ilm {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_ilm/policy/${encodeURIComponent(params.name.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.put_lifecycle',
|
||||
pathParts: {
|
||||
name: params.name
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the assigned lifecycle policy and stops managing the specified index
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-remove-policy.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -331,18 +294,12 @@ export default class Ilm {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ilm/remove`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.remove_policy',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retries executing the policy for an index that is in the ERROR step.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-retry-policy.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -363,18 +320,12 @@ export default class Ilm {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_ilm/retry`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.retry',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the index lifecycle management (ILM) plugin.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-start.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -396,15 +347,12 @@ export default class Ilm {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_ilm/start'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.start'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ilm-stop.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -426,9 +374,6 @@ export default class Ilm {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_ilm/stop'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ilm.stop'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Creates or updates a document in an index.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-index_.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -73,12 +72,5 @@ export default async function IndexApi<TDocument = unknown> (this: That, params:
|
||||
method = 'POST'
|
||||
path = `/${encodeURIComponent(params.index.toString())}/_doc`
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'index',
|
||||
pathParts: {
|
||||
id: params.id,
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,226 +0,0 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
/* eslint-disable @typescript-eslint/no-misused-new */
|
||||
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
// This file was automatically generated by elastic/elastic-client-generator-js
|
||||
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
|
||||
// and elastic/elastic-client-generator-js to regenerate this file again.
|
||||
|
||||
import {
|
||||
Transport,
|
||||
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 Inference {
|
||||
transport: Transport
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete model in the Inference API
|
||||
* @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>>
|
||||
async deleteModel (this: That, params: T.InferenceDeleteModelRequest | TB.InferenceDeleteModelRequest, options?: TransportRequestOptions): Promise<T.InferenceDeleteModelResponse>
|
||||
async deleteModel (this: That, params: T.InferenceDeleteModelRequest | TB.InferenceDeleteModelRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['task_type', 'inference_id']
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
|
||||
for (const key in params) {
|
||||
if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
let method = ''
|
||||
let path = ''
|
||||
if (params.task_type != null && params.inference_id != null) {
|
||||
method = 'DELETE'
|
||||
path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}`
|
||||
} else {
|
||||
method = 'DELETE'
|
||||
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
|
||||
}
|
||||
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/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>>
|
||||
async getModel (this: That, params: T.InferenceGetModelRequest | TB.InferenceGetModelRequest, options?: TransportRequestOptions): Promise<T.InferenceGetModelResponse>
|
||||
async getModel (this: That, params: T.InferenceGetModelRequest | TB.InferenceGetModelRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['task_type', 'inference_id']
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
|
||||
for (const key in params) {
|
||||
if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
let method = ''
|
||||
let path = ''
|
||||
if (params.task_type != null && params.inference_id != null) {
|
||||
method = 'GET'
|
||||
path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}`
|
||||
} else if (params.inference_id != null) {
|
||||
method = 'GET'
|
||||
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
|
||||
} else {
|
||||
method = 'GET'
|
||||
path = '/_inference'
|
||||
}
|
||||
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/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[] = ['query', 'input', 'task_settings']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
let body: Record<string, any> | string
|
||||
if (typeof userBody === 'string') {
|
||||
body = userBody
|
||||
} else {
|
||||
body = userBody != null ? { ...userBody } : undefined
|
||||
}
|
||||
|
||||
for (const key in params) {
|
||||
if (acceptedBody.includes(key)) {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
let method = ''
|
||||
let path = ''
|
||||
if (params.task_type != null && params.inference_id != null) {
|
||||
method = 'POST'
|
||||
path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}`
|
||||
} else {
|
||||
method = 'POST'
|
||||
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
|
||||
}
|
||||
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/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>>
|
||||
async putModel (this: That, params: T.InferencePutModelRequest | TB.InferencePutModelRequest, options?: TransportRequestOptions): Promise<T.InferencePutModelResponse>
|
||||
async putModel (this: That, params: T.InferencePutModelRequest | TB.InferencePutModelRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['task_type', 'inference_id']
|
||||
const acceptedBody: string[] = ['model_config']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
let body: any = params.body ?? undefined
|
||||
|
||||
for (const key in params) {
|
||||
if (acceptedBody.includes(key)) {
|
||||
// @ts-expect-error
|
||||
body = params[key]
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
let method = ''
|
||||
let path = ''
|
||||
if (params.task_type != null && params.inference_id != null) {
|
||||
method = 'PUT'
|
||||
path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}`
|
||||
} else {
|
||||
method = 'PUT'
|
||||
path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns basic information about the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/index.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -62,8 +61,5 @@ export default async function InfoApi (this: That, params?: T.InfoRequest | TB.I
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'info'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class Ingest {
|
||||
|
||||
/**
|
||||
* Deletes a pipeline.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-pipeline-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,18 +66,12 @@ export default class Ingest {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_ingest/pipeline/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ingest.delete_pipeline',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns statistical information about geoip databases
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/geoip-processor.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/geoip-stats-api.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>>
|
||||
@ -100,15 +93,12 @@ export default class Ingest {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_ingest/geoip/stats'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ingest.geo_ip_stats'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a pipeline.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-pipeline-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -137,18 +127,12 @@ export default class Ingest {
|
||||
method = 'GET'
|
||||
path = '/_ingest/pipeline'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ingest.get_pipeline',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of the built-in patterns.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/grok-processor.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/grok-processor.html#grok-processor-rest-get | 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>>
|
||||
@ -170,15 +154,12 @@ export default class Ingest {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_ingest/processor/grok'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ingest.processor_grok'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates a pipeline.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/ingest.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/put-pipeline-api.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>>
|
||||
@ -211,18 +192,12 @@ export default class Ingest {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_ingest/pipeline/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ingest.put_pipeline',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to simulate a pipeline with example documents.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/simulate-pipeline-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -263,12 +238,6 @@ export default class Ingest {
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_ingest/pipeline/_simulate'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ingest.simulate',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Performs a kNN search.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-search.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -73,11 +72,5 @@ export default async function KnnSearchApi<TDocument = unknown> (this: That, par
|
||||
|
||||
const method = body != null ? 'POST' : 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_knn_search`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'knn_search',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class License {
|
||||
|
||||
/**
|
||||
* Deletes licensing information for the cluster
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/delete-license.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -68,15 +67,12 @@ export default class License {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = '/_license'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'license.delete'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves licensing information for the cluster
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-license.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -98,15 +94,12 @@ export default class License {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_license'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'license.get'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves information about the status of the basic license.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-basic-status.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -128,15 +121,12 @@ export default class License {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_license/basic_status'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'license.get_basic_status'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves information about the status of the trial license.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-trial-status.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -158,15 +148,12 @@ export default class License {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_license/trial_status'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'license.get_trial_status'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the license for the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/update-license.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -200,15 +187,12 @@ export default class License {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = '/_license'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'license.post'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts an indefinite basic license.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/start-basic.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -230,15 +214,12 @@ export default class License {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_license/start_basic'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'license.post_start_basic'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* starts a limited time trial license.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/start-trial.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -260,9 +241,6 @@ export default class License {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_license/start_trial'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'license.post_start_trial'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class Logstash {
|
||||
|
||||
/**
|
||||
* Deletes Logstash Pipelines used by Central Management
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/logstash-api-delete-pipeline.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,28 +66,21 @@ export default class Logstash {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'logstash.delete_pipeline',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves Logstash Pipelines used by Central Management
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/logstash-api-get-pipeline.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
async getPipeline (this: That, params?: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptions): Promise<T.LogstashGetPipelineResponse>
|
||||
async getPipeline (this: That, params?: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
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>>
|
||||
async getPipeline (this: That, params: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptions): Promise<T.LogstashGetPipelineResponse>
|
||||
async getPipeline (this: That, params: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, 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
|
||||
@ -107,18 +99,12 @@ export default class Logstash {
|
||||
method = 'GET'
|
||||
path = '/_logstash/pipeline'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'logstash.get_pipeline',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds and updates Logstash Pipelines used for Central Management
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/logstash-api-put-pipeline.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -144,12 +130,6 @@ export default class Logstash {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'logstash.put_pipeline',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Allows to get multiple documents in one request.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-multi-get.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -81,11 +80,5 @@ export default async function MgetApi<TDocument = unknown> (this: That, params?:
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_mget'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'mget',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,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/8.14/migration-api-deprecation.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -75,18 +74,12 @@ export default class Migration {
|
||||
method = 'GET'
|
||||
path = '/_migration/deprecations'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'migration.deprecations',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out whether system features need to be upgraded or not
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/migration-api-feature-upgrade.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -108,15 +101,12 @@ export default class Migration {
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_migration/system_features'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'migration.get_feature_upgrade_status'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Begin upgrades for system features
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/migration-api-feature-upgrade.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -138,9 +128,6 @@ export default class Migration {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_migration/system_features'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'migration.post_feature_upgrade'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class Monitoring {
|
||||
|
||||
/**
|
||||
* Used by the monitoring features to send monitoring data.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/monitor-elasticsearch-cluster.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -72,12 +71,6 @@ export default class Monitoring {
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_monitoring/bulk'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'monitoring.bulk',
|
||||
pathParts: {
|
||||
type: params.type
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Allows to execute several search operations in one request.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-multi-search.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -73,11 +72,5 @@ export default async function MsearchApi<TDocument = unknown, TAggregations = Re
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_msearch'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'msearch',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/search-multi-search.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -73,11 +72,5 @@ export default async function MsearchTemplateApi<TDocument = unknown, TAggregati
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_msearch/template'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'msearch_template',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns multiple termvectors in one request.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-multi-termvectors.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -81,11 +80,5 @@ export default async function MtermvectorsApi (this: That, params?: T.Mtermvecto
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_mtermvectors'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'mtermvectors',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,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/8.14/clear-repositories-metering-archive-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,19 +66,12 @@ export default class Nodes {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/_repositories_metering/${encodeURIComponent(params.max_archive_version.toString())}`
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns cluster repositories metering information.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/get-repositories-metering-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -100,18 +92,12 @@ export default class Nodes {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_nodes/${encodeURIComponent(params.node_id.toString())}/_repositories_metering`
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about hot threads on each node in the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-nodes-hot-threads.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -140,18 +126,12 @@ export default class Nodes {
|
||||
method = 'GET'
|
||||
path = '/_nodes/hot_threads'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'nodes.hot_threads',
|
||||
pathParts: {
|
||||
node_id: params.node_id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about nodes in the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-nodes-info.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -186,19 +166,12 @@ export default class Nodes {
|
||||
method = 'GET'
|
||||
path = '/_nodes'
|
||||
}
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads secure settings.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/secure-settings.html#reloadable-secure-settings | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -239,18 +212,12 @@ export default class Nodes {
|
||||
method = 'POST'
|
||||
path = '/_nodes/reload_secure_settings'
|
||||
}
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns statistical information about nodes in the cluster.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-nodes-stats.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -291,20 +258,12 @@ export default class Nodes {
|
||||
method = 'GET'
|
||||
path = '/_nodes/stats'
|
||||
}
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns low-level information about REST actions usage on nodes.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/cluster-nodes-usage.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -339,13 +298,6 @@ export default class Nodes {
|
||||
method = 'GET'
|
||||
path = '/_nodes/usage'
|
||||
}
|
||||
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)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/point-in-time-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,11 +60,5 @@ export default async function OpenPointInTimeApi (this: That, params: T.OpenPoin
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_pit`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'open_point_in_time',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Returns whether the cluster is running.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/index.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -62,8 +61,5 @@ export default async function PingApi (this: That, params?: T.PingRequest | TB.P
|
||||
|
||||
const method = 'HEAD'
|
||||
const path = '/'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'ping'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -1,162 +0,0 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
/* eslint-disable @typescript-eslint/no-misused-new */
|
||||
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
// This file was automatically generated by elastic/elastic-client-generator-js
|
||||
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
|
||||
// and elastic/elastic-client-generator-js to regenerate this file again.
|
||||
|
||||
import {
|
||||
Transport,
|
||||
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)
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,7 @@ interface That { transport: Transport }
|
||||
|
||||
/**
|
||||
* Creates or updates a script.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/modules-scripting.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -80,12 +79,5 @@ export default async function PutScriptApi (this: That, params: T.PutScriptReque
|
||||
method = 'PUT'
|
||||
path = `/_scripts/${encodeURIComponent(params.id.toString())}`
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'put_script',
|
||||
pathParts: {
|
||||
id: params.id,
|
||||
context: params.context
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -1,184 +0,0 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
/* eslint-disable @typescript-eslint/no-misused-new */
|
||||
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
// This file was automatically generated by elastic/elastic-client-generator-js
|
||||
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
|
||||
// and elastic/elastic-client-generator-js to regenerate this file again.
|
||||
|
||||
import {
|
||||
Transport,
|
||||
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 QueryRuleset {
|
||||
transport: Transport
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a query ruleset.
|
||||
* @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>>
|
||||
async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptions): Promise<T.QueryRulesetDeleteResponse>
|
||||
async delete (this: That, params: T.QueryRulesetDeleteRequest | TB.QueryRulesetDeleteRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['ruleset_id']
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
|
||||
for (const key in params) {
|
||||
if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
|
||||
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/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>>
|
||||
async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptions): Promise<T.QueryRulesetGetResponse>
|
||||
async get (this: That, params: T.QueryRulesetGetRequest | TB.QueryRulesetGetRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['ruleset_id']
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
|
||||
for (const key in params) {
|
||||
if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
|
||||
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/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>>
|
||||
async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptions): Promise<T.QueryRulesetListResponse>
|
||||
async list (this: That, params?: T.QueryRulesetListRequest | TB.QueryRulesetListRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const querystring: Record<string, any> = {}
|
||||
const body = undefined
|
||||
|
||||
params = params ?? {}
|
||||
for (const key in params) {
|
||||
if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_query_rules'
|
||||
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/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>>
|
||||
async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptions): Promise<T.QueryRulesetPutResponse>
|
||||
async put (this: That, params: T.QueryRulesetPutRequest | TB.QueryRulesetPutRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['ruleset_id']
|
||||
const acceptedBody: string[] = ['rules']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
let body: Record<string, any> | string
|
||||
if (typeof userBody === 'string') {
|
||||
body = userBody
|
||||
} else {
|
||||
body = userBody != null ? { ...userBody } : undefined
|
||||
}
|
||||
|
||||
for (const key in params) {
|
||||
if (acceptedBody.includes(key)) {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_query_rules/${encodeURIComponent(params.ruleset_id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'query_ruleset.put',
|
||||
pathParts: {
|
||||
ruleset_id: params.ruleset_id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/search-rank-eval.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -80,11 +79,5 @@ export default async function RankEvalApi (this: That, params: T.RankEvalRequest
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_rank_eval'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'rank_eval',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/docs-reindex.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -73,8 +72,5 @@ export default async function ReindexApi (this: That, params: T.ReindexRequest |
|
||||
|
||||
const method = 'POST'
|
||||
const path = '/_reindex'
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'reindex'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/docs-reindex.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -61,11 +60,5 @@ export default async function ReindexRethrottleApi (this: That, params: T.Reinde
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/_reindex/${encodeURIComponent(params.task_id.toString())}/_rethrottle`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'reindex_rethrottle',
|
||||
pathParts: {
|
||||
task_id: params.task_id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -40,7 +39,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/8.14/render-search-template-api.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -81,11 +80,5 @@ export default async function RenderSearchTemplateApi (this: That, params?: T.Re
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = '/_render/template'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'render_search_template',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
import {
|
||||
Transport,
|
||||
TransportRequestMetadata,
|
||||
TransportRequestOptions,
|
||||
TransportRequestOptionsWithMeta,
|
||||
TransportRequestOptionsWithOutMeta,
|
||||
@ -46,7 +45,7 @@ export default class Rollup {
|
||||
|
||||
/**
|
||||
* Deletes an existing rollup job.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-delete-job.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -67,18 +66,12 @@ export default class Rollup {
|
||||
|
||||
const method = 'DELETE'
|
||||
const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'rollup.delete_job',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the configuration, stats, and status of rollup jobs.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-get-job.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -107,18 +100,12 @@ export default class Rollup {
|
||||
method = 'GET'
|
||||
path = '/_rollup/job'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'rollup.get_jobs',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/rollup-get-rollup-caps.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -147,18 +134,12 @@ export default class Rollup {
|
||||
method = 'GET'
|
||||
path = '/_rollup/data'
|
||||
}
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'rollup.get_rollup_caps',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, 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/8.14/rollup-get-rollup-index-caps.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -179,18 +160,12 @@ export default class Rollup {
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_rollup/data`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'rollup.get_rollup_index_caps',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a rollup job.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-put-job.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -223,18 +198,12 @@ export default class Rollup {
|
||||
|
||||
const method = 'PUT'
|
||||
const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'rollup.put_job',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables searching rolled-up data using the standard query DSL.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-search.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -267,18 +236,12 @@ export default class Rollup {
|
||||
|
||||
const method = body != null ? 'POST' : 'GET'
|
||||
const path = `/${encodeURIComponent(params.index.toString())}/_rollup_search`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'rollup.rollup_search',
|
||||
pathParts: {
|
||||
index: params.index
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts an existing, stopped rollup job.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-start-job.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -299,18 +262,12 @@ export default class Rollup {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}/_start`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'rollup.start_job',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops an existing, started rollup job.
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.14/rollup-stop-job.html | Elasticsearch API documentation}
|
||||
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.9/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>>
|
||||
@ -331,12 +288,6 @@ export default class Rollup {
|
||||
|
||||
const method = 'POST'
|
||||
const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}/_stop`
|
||||
const meta: TransportRequestMetadata = {
|
||||
name: 'rollup.stop_job',
|
||||
pathParts: {
|
||||
id: params.id
|
||||
}
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body, meta }, options)
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user