Compare commits
78 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cfcff78a7e | |||
| bf482cf269 | |||
| f9e2d5f708 | |||
| ed8adba2ab | |||
| 098aef0a58 | |||
| 6d5b5f6af3 | |||
| 02ad9a9759 | |||
| 965536b369 | |||
| 5c144154ad | |||
| a52cf6be38 | |||
| c91ceb12d8 | |||
| c1eadd6e88 | |||
| d080f1bdad | |||
| 14fc908d4b | |||
| 7d810f8110 | |||
| 962e26f791 | |||
| ee36f7b43f | |||
| 8a85738258 | |||
| d06f67d881 | |||
| c67a5dfdc2 | |||
| 885147b889 | |||
| 3c99839e4a | |||
| 24da41e994 | |||
| 662e4d5ca7 | |||
| 1afa23b11d | |||
| 48c6ad15a6 | |||
| 48233503f7 | |||
| 11c7475566 | |||
| e530ed2313 | |||
| 59b9403fdc | |||
| 01ab682fb7 | |||
| b11e7ffc9f | |||
| 11da9a4650 | |||
| 352a2c3652 | |||
| 5ce9f55481 | |||
| e7f7993407 | |||
| baac03846e | |||
| 41050f23f5 | |||
| 2daa6d35c6 | |||
| 9bcfc08b20 | |||
| 45744762d3 | |||
| 516139c48e | |||
| 29091da864 | |||
| 4346bfd9a0 | |||
| ef2b025489 | |||
| 12101dc1ae | |||
| 1325471c45 | |||
| 59f88c22f9 | |||
| 8f131d5a6d | |||
| 81e09a71c2 | |||
| 41fa164611 | |||
| 9fa31a96c6 | |||
| eb95d6bda1 | |||
| 69844fa93f | |||
| 203e11f2f8 | |||
| 10d660c6dc | |||
| fcad02768b | |||
| 5cb51850c9 | |||
| a35c6e97b7 | |||
| 17fc9fb38e | |||
| dc5102d30b | |||
| 4d551319dd | |||
| 1acfd1b895 | |||
| 2458bb5721 | |||
| 5d8b2b0c26 | |||
| d5256e2fc1 | |||
| 55fd03942f | |||
| ead63b9e6d | |||
| 284a9deac7 | |||
| 3faac68c5b | |||
| 9bb4083a6e | |||
| 02299f7ec1 | |||
| a8c19984d6 | |||
| 0b739ea23c | |||
| 5c51bf7128 | |||
| 51ef62b4f1 | |||
| 5030efd2d0 | |||
| dd9707e42e |
185
.ci/Jenkinsfile
vendored
185
.ci/Jenkinsfile
vendored
@ -1,185 +0,0 @@
|
|||||||
#!/usr/bin/env groovy
|
|
||||||
|
|
||||||
@Library('apm@current') _
|
|
||||||
|
|
||||||
def NODE_JS_VERSIONS = [8,10,12]
|
|
||||||
def nodeJsVersion = NODE_JS_VERSIONS[randomNumber(min: 0, max:2)]
|
|
||||||
|
|
||||||
pipeline {
|
|
||||||
agent {
|
|
||||||
label 'docker && immutable'
|
|
||||||
}
|
|
||||||
|
|
||||||
environment {
|
|
||||||
REPO = 'elasticsearch-js'
|
|
||||||
BASE_DIR = "src/github.com/elastic/${env.REPO}"
|
|
||||||
NODE_JS_DEFAULT_VERSION = "${nodeJsVersion}"
|
|
||||||
NODE_JS_VERSIONS = "${NODE_JS_VERSIONS.join(',')}"
|
|
||||||
HOME = "${env.WORKSPACE}"
|
|
||||||
npm_config_cache = 'npm-cache'
|
|
||||||
}
|
|
||||||
|
|
||||||
options {
|
|
||||||
timeout(time: 1, unit: 'HOURS')
|
|
||||||
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
|
|
||||||
timestamps()
|
|
||||||
ansiColor('xterm')
|
|
||||||
disableResume()
|
|
||||||
durabilityHint('PERFORMANCE_OPTIMIZED')
|
|
||||||
}
|
|
||||||
|
|
||||||
triggers {
|
|
||||||
issueCommentTrigger('(?i).*(?:jenkins\\W+)?run\\W+(?:the\\W+)?tests(?:\\W+please)?.*')
|
|
||||||
// env.CHANGE_ID as a value in case of a commit or a pr, which means
|
|
||||||
// that we will have a daily cron job only for branches that don't have an active pr
|
|
||||||
cron(env.CHANGE_ID ? '' : '@daily')
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('Checkout') {
|
|
||||||
options { skipDefaultCheckout() }
|
|
||||||
steps {
|
|
||||||
deleteDir()
|
|
||||||
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: false)
|
|
||||||
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Install dependencies') {
|
|
||||||
options { skipDefaultCheckout() }
|
|
||||||
steps {
|
|
||||||
deleteDir()
|
|
||||||
unstash 'source'
|
|
||||||
script {
|
|
||||||
buildDockerImage(image: "node:${env.NODE_JS_DEFAULT_VERSION}-alpine").inside(){
|
|
||||||
dir("${BASE_DIR}"){
|
|
||||||
sh(label: 'System info', script: 'node --version; npm --version')
|
|
||||||
sh(label: 'Install dependencies', script: 'npm install')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stash allowEmpty: true, name: 'source-dependencies', useDefaultExcludes: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('License check') {
|
|
||||||
options { skipDefaultCheckout() }
|
|
||||||
steps {
|
|
||||||
withGithubNotify(context: 'License check') {
|
|
||||||
deleteDir()
|
|
||||||
unstash 'source-dependencies'
|
|
||||||
script {
|
|
||||||
buildDockerImage(image: "node:${env.NODE_JS_DEFAULT_VERSION}-alpine").inside(){
|
|
||||||
dir("${BASE_DIR}"){
|
|
||||||
sh(label: 'Check production dependencies licenses', script: 'npm run license-checker')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Linter') {
|
|
||||||
options { skipDefaultCheckout() }
|
|
||||||
steps {
|
|
||||||
withGithubNotify(context: 'Linter') {
|
|
||||||
deleteDir()
|
|
||||||
unstash 'source-dependencies'
|
|
||||||
script {
|
|
||||||
buildDockerImage(image: "node:${env.NODE_JS_DEFAULT_VERSION}-alpine").inside(){
|
|
||||||
dir("${BASE_DIR}"){
|
|
||||||
sh(label: 'Lint code with standardjs', script: 'npm run lint')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Unit test') {
|
|
||||||
failFast true
|
|
||||||
options { skipDefaultCheckout() }
|
|
||||||
steps {
|
|
||||||
withGithubNotify(context: 'Unit test') {
|
|
||||||
script {
|
|
||||||
def versions = env.NODE_JS_VERSIONS.split(',')
|
|
||||||
def parallelTasks = [:]
|
|
||||||
versions.each{ version ->
|
|
||||||
parallelTasks["Node.js v${version}"] = buildUnitTest(version: version)
|
|
||||||
}
|
|
||||||
parallel(parallelTasks)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Integration test') {
|
|
||||||
options { skipDefaultCheckout() }
|
|
||||||
environment {
|
|
||||||
TEST_ES_SERVER = 'http://elasticsearch:9200'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
withGithubNotify(context: 'Integration test OSS') {
|
|
||||||
deleteDir()
|
|
||||||
unstash 'source-dependencies'
|
|
||||||
dir("${BASE_DIR}"){
|
|
||||||
// Sometimes the docker registry fails and has random timeouts
|
|
||||||
// this block will retry a doker image 3 times before to fail.
|
|
||||||
retry(3) {
|
|
||||||
sleep randomNumber(min: 5, max: 10)
|
|
||||||
sh(label: 'Start Elasticsearch', script: './scripts/es-docker.sh --detach')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
script {
|
|
||||||
buildDockerImage(fromDockerfile: true).inside('--network=elastic'){
|
|
||||||
dir("${BASE_DIR}"){
|
|
||||||
sh(label: 'Integration test', script: 'npm run test:integration | tee test-integration.tap')
|
|
||||||
sh(label: 'Generating test reporting', script: './node_modules/.bin/tap-mocha-reporter xunit < test-integration.tap > junit-integration.xml')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sh(label: 'Stop Elasticsearch', script: 'docker kill $(docker ps -q)')
|
|
||||||
junit(allowEmptyResults: true, keepLongStdio: true, testResults: "${BASE_DIR}/**/junit-*.xml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sometimes the docker registry fails and has random timeouts
|
|
||||||
// this function will retry a doker image 3 times before to fail.
|
|
||||||
def buildDockerImage(args) {
|
|
||||||
def image
|
|
||||||
retry(3) {
|
|
||||||
sleep randomNumber(min: 5, max: 10)
|
|
||||||
if (args.fromDockerfile == true) {
|
|
||||||
image = docker.build('nodejs-image', "--build-arg NODE_JS_VERSION=${env.NODE_JS_DEFAULT_VERSION} ${BASE_DIR}/.ci/docker")
|
|
||||||
} else {
|
|
||||||
image = docker.image(args.image)
|
|
||||||
// make sure we have the latest available from Docker Hub
|
|
||||||
image.pull()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return image
|
|
||||||
}
|
|
||||||
|
|
||||||
def buildUnitTest(args) {
|
|
||||||
return {
|
|
||||||
node('docker && immutable') {
|
|
||||||
deleteDir()
|
|
||||||
unstash 'source'
|
|
||||||
script {
|
|
||||||
buildDockerImage(image: "node:${args.version}-alpine").inside(){
|
|
||||||
dir("${BASE_DIR}"){
|
|
||||||
sh(label: 'Install dependencies', script: 'npm install')
|
|
||||||
sh(label: 'Run unit test', script: 'npm run test:unit | tee test-unit.tap')
|
|
||||||
sh(label: 'Run behavior test', script: 'npm run test:behavior | tee test-behavior.tap')
|
|
||||||
sh(label: 'Run types test', script: 'npm run test:types')
|
|
||||||
sh(label: 'Generating test reporting', script: './node_modules/.bin/tap-mocha-reporter xunit < test-unit.tap > junit-unit.xml; ./node_modules/.bin/tap-mocha-reporter xunit < test-behavior.tap > junit-behavior.xml')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
junit(allowEmptyResults: true, keepLongStdio: true, testResults: "${BASE_DIR}/**/junit-*.xml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -22,7 +22,7 @@ services:
|
|||||||
- elasticsearch-oss
|
- elasticsearch-oss
|
||||||
|
|
||||||
elasticsearch-oss:
|
elasticsearch-oss:
|
||||||
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-5.6.15}
|
image: docker.elastic.co/elasticsearch/elasticsearch-oss:${ELASTICSEARCH_VERSION:-6.6.2}
|
||||||
volumes:
|
volumes:
|
||||||
- esvol:/tmp
|
- esvol:/tmp
|
||||||
networks:
|
networks:
|
||||||
@ -32,10 +32,63 @@ services:
|
|||||||
- "repositories.url.allowed_urls=http://snapshot.*"
|
- "repositories.url.allowed_urls=http://snapshot.*"
|
||||||
- node.attr.testattr=test
|
- node.attr.testattr=test
|
||||||
- bootstrap.memory_lock=false
|
- bootstrap.memory_lock=false
|
||||||
- "xpack.security.enabled=false"
|
|
||||||
- "discovery.type=single-node"
|
- "discovery.type=single-node"
|
||||||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||||
|
|
||||||
|
client-platinum:
|
||||||
|
image: docker.elastic.co/clients/elasticsearch-js:${NODE_JS_VERSION:-10}
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: .ci/Dockerfile
|
||||||
|
args:
|
||||||
|
NODE_JS_VERSION: ${NODE_JS_VERSION:-10}
|
||||||
|
environment:
|
||||||
|
- "TEST_ES_SERVER=https://elastic:changeme@elasticsearch-platinum:9200"
|
||||||
|
volumes:
|
||||||
|
- ..:/usr/src/app
|
||||||
|
# This will mount the node_modules directory
|
||||||
|
# to the host machine using the buildtime directory.
|
||||||
|
- /usr/src/app/node_modules
|
||||||
|
- esvol:/tmp
|
||||||
|
networks:
|
||||||
|
- esnet-platinum
|
||||||
|
depends_on:
|
||||||
|
- elasticsearch-platinum
|
||||||
|
# there is not need to run again also the unit test
|
||||||
|
command: ["npm", "run", "test:integration"]
|
||||||
|
|
||||||
|
elasticsearch-platinum:
|
||||||
|
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-6.6.2}
|
||||||
|
ports:
|
||||||
|
- "9200:9200"
|
||||||
|
networks:
|
||||||
|
- esnet-platinum
|
||||||
|
environment:
|
||||||
|
- "node.attr.testattr=test"
|
||||||
|
- "path.repo=/tmp"
|
||||||
|
- "repositories.url.allowed_urls=http://snapshot.*"
|
||||||
|
- "discovery.type=single-node"
|
||||||
|
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
|
||||||
|
- "ELASTIC_PASSWORD=changeme"
|
||||||
|
- "xpack.security.enabled=true"
|
||||||
|
- "xpack.license.self_generated.type=trial"
|
||||||
|
- "xpack.security.http.ssl.enabled=true"
|
||||||
|
- "xpack.security.http.ssl.verification_mode=certificate"
|
||||||
|
- "xpack.security.http.ssl.key=certs/testnode.key"
|
||||||
|
- "xpack.security.http.ssl.certificate=certs/testnode.crt"
|
||||||
|
- "xpack.security.http.ssl.certificate_authorities=certs/ca.crt"
|
||||||
|
- "xpack.security.transport.ssl.enabled=true"
|
||||||
|
- "xpack.security.transport.ssl.key=certs/testnode.key"
|
||||||
|
- "xpack.security.transport.ssl.certificate=certs/testnode.crt"
|
||||||
|
- "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt"
|
||||||
|
volumes:
|
||||||
|
- "./certs/testnode.crt:/usr/share/elasticsearch/config/certs/testnode.crt"
|
||||||
|
- "./certs/testnode.key:/usr/share/elasticsearch/config/certs/testnode.key"
|
||||||
|
- "./certs/ca.crt:/usr/share/elasticsearch/config/certs/ca.crt"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
# we need two networks otherwise the two ES instances will join each other
|
||||||
esnet-oss:
|
esnet-oss:
|
||||||
|
esnet-platinum:
|
||||||
volumes:
|
volumes:
|
||||||
esvol:
|
esvol:
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
ARG NODE_JS_VERSION=10
|
|
||||||
FROM node:${NODE_JS_VERSION}-alpine
|
|
||||||
|
|
||||||
RUN apk --no-cache add git
|
|
||||||
|
|
||||||
# Create app directory
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
@ -47,10 +47,6 @@
|
|||||||
type: yaml
|
type: yaml
|
||||||
filename: .ci/test-matrix.yml
|
filename: .ci/test-matrix.yml
|
||||||
name: NODE_JS_VERSION
|
name: NODE_JS_VERSION
|
||||||
- axis:
|
|
||||||
type: yaml
|
|
||||||
filename: .ci/test-matrix.yml
|
|
||||||
name: TEST_SUITE
|
|
||||||
yaml-strategy:
|
yaml-strategy:
|
||||||
exclude-key: exclude
|
exclude-key: exclude
|
||||||
filename: .ci/test-matrix.yml
|
filename: .ci/test-matrix.yml
|
||||||
@ -69,6 +65,3 @@
|
|||||||
publishers:
|
publishers:
|
||||||
- email:
|
- email:
|
||||||
recipients: infra-root+build@elastic.co
|
recipients: infra-root+build@elastic.co
|
||||||
# - junit:
|
|
||||||
# results: "*-junit.xml"
|
|
||||||
# allow-empty-results: true
|
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source /usr/local/bin/bash_standard_lib.sh
|
|
||||||
|
|
||||||
DOCKER_IMAGES="node:12-alpine
|
|
||||||
node:10-alpine
|
|
||||||
node:8-alpine
|
|
||||||
"
|
|
||||||
|
|
||||||
for di in ${DOCKER_IMAGES}
|
|
||||||
do
|
|
||||||
(retry 2 docker pull "${di}") || echo "Error pulling ${di} Docker image, we continue"
|
|
||||||
done
|
|
||||||
|
|
||||||
@ -1,177 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Launch one or more Elasticsearch nodes via the Docker image,
|
|
||||||
# to form a cluster suitable for running the REST API tests.
|
|
||||||
#
|
|
||||||
# Export the ELASTICSEARCH_VERSION variable, eg. 'elasticsearch:8.0.0-SNAPSHOT'.
|
|
||||||
|
|
||||||
if [[ -z "$ELASTICSEARCH_VERSION" ]]; then
|
|
||||||
echo -e "\033[31;1mERROR:\033[0m Required environment variable [ELASTICSEARCH_VERSION] not set\033[0m"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
set -euxo pipefail
|
|
||||||
|
|
||||||
moniker=$(echo "$ELASTICSEARCH_VERSION" | tr -C "[:alnum:]" '-')
|
|
||||||
suffix=rest-test
|
|
||||||
|
|
||||||
NODE_NAME=${NODE_NAME-${moniker}node1}
|
|
||||||
MASTER_NODE_NAME=${MASTER_NODE_NAME-${NODE_NAME}}
|
|
||||||
CLUSTER_NAME=${CLUSTER_NAME-${moniker}${suffix}}
|
|
||||||
HTTP_PORT=${HTTP_PORT-9200}
|
|
||||||
|
|
||||||
ELASTIC_PASSWORD=${ELASTIC_PASSWORD-changeme}
|
|
||||||
SSL_CERT=${SSL_CERT-"$PWD/certs/testnode.crt"}
|
|
||||||
SSL_KEY=${SSL_KEY-"$PWD/certs/testnode.key"}
|
|
||||||
SSL_CA=${SSL_CA-"$PWD/certs/ca.crt"}
|
|
||||||
|
|
||||||
DETACH=${DETACH-false}
|
|
||||||
CLEANUP=${CLEANUP-false}
|
|
||||||
|
|
||||||
volume_name=${NODE_NAME}-${suffix}-data
|
|
||||||
network_default=${moniker}${suffix}
|
|
||||||
NETWORK_NAME=${NETWORK_NAME-"$network_default"}
|
|
||||||
|
|
||||||
set +x
|
|
||||||
|
|
||||||
function cleanup_volume {
|
|
||||||
if [[ "$(docker volume ls -q -f name=$1)" ]]; then
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m Removing volume $1\033[0m"
|
|
||||||
(docker volume rm "$1") || true
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
function cleanup_node {
|
|
||||||
if [[ "$(docker ps -q -f name=$1)" ]]; then
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m Removing container $1\033[0m"
|
|
||||||
(docker container rm --force --volumes "$1") || true
|
|
||||||
cleanup_volume "$1-${suffix}-data"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
function cleanup_network {
|
|
||||||
if [[ "$(docker network ls -q -f name=$1)" ]]; then
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m Removing network $1\033[0m"
|
|
||||||
(docker network rm "$1") || true
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function cleanup {
|
|
||||||
if [[ "$DETACH" != "true" ]] || [[ "$1" == "1" ]]; then
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m clean the node and volume on startup (1) OR on exit if not detached\033[0m"
|
|
||||||
cleanup_node "$NODE_NAME"
|
|
||||||
fi
|
|
||||||
if [[ "$DETACH" != "true" ]]; then
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m clean the network if not detached (start and exit)\033[0m"
|
|
||||||
cleanup_network "$NETWORK_NAME"
|
|
||||||
fi
|
|
||||||
};
|
|
||||||
trap "cleanup 0" EXIT
|
|
||||||
|
|
||||||
if [[ "$CLEANUP" == "true" ]]; then
|
|
||||||
trap - EXIT
|
|
||||||
if [[ -z "$(docker network ls -q -f name=${NETWORK_NAME})" ]]; then
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m $NETWORK_NAME is already deleted\033[0m"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
containers=$(docker network inspect -f '{{ range $key, $value := .Containers }}{{ printf "%s\n" .Name}}{{ end }}' ${NETWORK_NAME})
|
|
||||||
while read -r container; do
|
|
||||||
cleanup_node "$container"
|
|
||||||
done <<< "$containers"
|
|
||||||
cleanup_network "$NETWORK_NAME"
|
|
||||||
echo -e "\033[32;1mSUCCESS:\033[0m Cleaned up and exiting\033[0m"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m Making sure previous run leftover infrastructure is removed \033[0m"
|
|
||||||
cleanup 1
|
|
||||||
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m Creating network $NETWORK_NAME if it does not exist already \033[0m"
|
|
||||||
docker network inspect "$NETWORK_NAME" > /dev/null 2>&1 || docker network create "$NETWORK_NAME"
|
|
||||||
|
|
||||||
environment=($(cat <<-END
|
|
||||||
--env discovery.zen.ping.unicast.hosts=${NODE_NAME}
|
|
||||||
--env xpack.security.enabled=false
|
|
||||||
--env xpack.monitoring.enabled=false
|
|
||||||
--env xpack.ml.enabled=false
|
|
||||||
--env cluster.routing.allocation.disk.threshold_enabled=false
|
|
||||||
--env bootstrap.memory_lock=true
|
|
||||||
--env node.attr.testattr=test
|
|
||||||
--env path.repo=/tmp
|
|
||||||
--env repositories.url.allowed_urls=http://snapshot.test*
|
|
||||||
END
|
|
||||||
))
|
|
||||||
|
|
||||||
volumes=($(cat <<-END
|
|
||||||
--volume $volume_name:/usr/share/elasticsearch/data
|
|
||||||
END
|
|
||||||
))
|
|
||||||
|
|
||||||
# if [[ "$ELASTICSEARCH_VERSION" != *oss* ]]; then
|
|
||||||
# environment+=($(cat <<-END
|
|
||||||
# --env ELASTIC_PASSWORD=$ELASTIC_PASSWORD
|
|
||||||
# --env xpack.license.self_generated.type=trial
|
|
||||||
# --env xpack.security.enabled=true
|
|
||||||
# --env xpack.security.http.ssl.enabled=true
|
|
||||||
# --env xpack.security.http.ssl.verification_mode=certificate
|
|
||||||
# --env xpack.security.http.ssl.key=certs/testnode.key
|
|
||||||
# --env xpack.security.http.ssl.certificate=certs/testnode.crt
|
|
||||||
# --env xpack.security.http.ssl.certificate_authorities=certs/ca.crt
|
|
||||||
# --env xpack.security.transport.ssl.enabled=true
|
|
||||||
# --env xpack.security.transport.ssl.key=certs/testnode.key
|
|
||||||
# --env xpack.security.transport.ssl.certificate=certs/testnode.crt
|
|
||||||
# --env xpack.security.transport.ssl.certificate_authorities=certs/ca.crt
|
|
||||||
# END
|
|
||||||
# ))
|
|
||||||
# volumes+=($(cat <<-END
|
|
||||||
# --volume $SSL_CERT:/usr/share/elasticsearch/config/certs/testnode.crt
|
|
||||||
# --volume $SSL_KEY:/usr/share/elasticsearch/config/certs/testnode.key
|
|
||||||
# --volume $SSL_CA:/usr/share/elasticsearch/config/certs/ca.crt
|
|
||||||
# END
|
|
||||||
# ))
|
|
||||||
# fi
|
|
||||||
|
|
||||||
url="http://$NODE_NAME"
|
|
||||||
if [[ "$ELASTICSEARCH_VERSION" != *oss* ]]; then
|
|
||||||
url="https://elastic:$ELASTIC_PASSWORD@$NODE_NAME"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m Starting container $NODE_NAME \033[0m"
|
|
||||||
set -x
|
|
||||||
docker run \
|
|
||||||
--name "$NODE_NAME" \
|
|
||||||
--network "$NETWORK_NAME" \
|
|
||||||
--env ES_JAVA_OPTS=-"Xms1g -Xmx1g" \
|
|
||||||
"${environment[@]}" \
|
|
||||||
"${volumes[@]}" \
|
|
||||||
--publish "$HTTP_PORT":9200 \
|
|
||||||
--ulimit nofile=65536:65536 \
|
|
||||||
--ulimit memlock=-1:-1 \
|
|
||||||
--detach="$DETACH" \
|
|
||||||
--health-cmd="curl --silent --insecure --fail $url:9200/_cluster/health || exit 1" \
|
|
||||||
--health-interval=2s \
|
|
||||||
--health-retries=20 \
|
|
||||||
--health-timeout=2s \
|
|
||||||
--rm \
|
|
||||||
docker.elastic.co/elasticsearch/"$ELASTICSEARCH_VERSION";
|
|
||||||
set +x
|
|
||||||
|
|
||||||
if [[ "$DETACH" == "true" ]]; then
|
|
||||||
until [[ "$(docker inspect -f "{{.State.Health.Status}}" ${NODE_NAME})" != "starting" ]]; do
|
|
||||||
sleep 2;
|
|
||||||
echo ""
|
|
||||||
echo -e "\033[34;1mINFO:\033[0m waiting for node $NODE_NAME to be up\033[0m"
|
|
||||||
done;
|
|
||||||
# Always show the node getting started logs, this is very useful both on CI as well as while developing
|
|
||||||
docker logs "$NODE_NAME"
|
|
||||||
if [[ "$(docker inspect -f "{{.State.Health.Status}}" ${NODE_NAME})" != "healthy" ]]; then
|
|
||||||
cleanup 1
|
|
||||||
echo
|
|
||||||
echo -e "\033[31;1mERROR:\033[0m Failed to start ${ELASTICSEARCH_VERSION} in detached mode beyond health checks\033[0m"
|
|
||||||
echo -e "\033[31;1mERROR:\033[0m dumped the docker log before shutting the node down\033[0m"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo
|
|
||||||
echo -e "\033[32;1mSUCCESS:\033[0m Detached and healthy: ${NODE_NAME} on docker network: ${NETWORK_NAME}\033[0m"
|
|
||||||
echo -e "\033[32;1mSUCCESS:\033[0m Running on: ${url/$NODE_NAME/localhost}:${HTTP_PORT}\033[0m"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
@ -8,7 +8,6 @@
|
|||||||
#
|
#
|
||||||
# - $ELASTICSEARCH_VERSION
|
# - $ELASTICSEARCH_VERSION
|
||||||
# - $NODE_JS_VERSION
|
# - $NODE_JS_VERSION
|
||||||
# - $TEST_SUITE
|
|
||||||
#
|
#
|
||||||
|
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
@ -19,49 +18,93 @@ export CODECOV_TOKEN=$(vault read -field=token secret/clients-ci/elasticsearch-j
|
|||||||
unset VAULT_ROLE_ID VAULT_SECRET_ID VAULT_TOKEN
|
unset VAULT_ROLE_ID VAULT_SECRET_ID VAULT_TOKEN
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
function cleanup {
|
||||||
|
docker container rm --force --volumes elasticsearch-oss > /dev/null 2>&1 || true
|
||||||
|
docker container rm --force --volumes elasticsearch-platinum > /dev/null 2>&1 || true
|
||||||
|
docker container rm --force --volumes elasticsearch-js-oss > /dev/null 2>&1 || true
|
||||||
|
docker container rm --force --volumes elasticsearch-js-platinum > /dev/null 2>&1 || true
|
||||||
|
docker network rm esnet-oss > /dev/null
|
||||||
|
docker network rm esnet-platinum > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
# create network and volume
|
||||||
|
docker network create esnet-oss
|
||||||
|
docker network create esnet-platinum
|
||||||
|
|
||||||
|
# create client image
|
||||||
docker build \
|
docker build \
|
||||||
--file .ci/Dockerfile \
|
--file .ci/Dockerfile \
|
||||||
--tag elastic/elasticsearch-js \
|
--tag elastic/elasticsearch-js \
|
||||||
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
|
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
|
||||||
.
|
.
|
||||||
|
|
||||||
NODE_NAME="es1"
|
# run elasticsearch oss
|
||||||
|
docker run \
|
||||||
|
--rm \
|
||||||
|
--env "node.attr.testattr=test" \
|
||||||
|
--env "path.repo=/tmp" \
|
||||||
|
--env "repositories.url.allowed_urls=http://snapshot.*" \
|
||||||
|
--env "discovery.type=single-node" \
|
||||||
|
--network=esnet-oss \
|
||||||
|
--name=elasticsearch-oss \
|
||||||
|
--detach \
|
||||||
|
docker.elastic.co/elasticsearch/elasticsearch-oss:${ELASTICSEARCH_VERSION}
|
||||||
|
|
||||||
|
# run elasticsearch platinum
|
||||||
repo=$(pwd)
|
repo=$(pwd)
|
||||||
testnodecrt="/.ci/certs/testnode.crt"
|
testnodecrt="/.ci/certs/testnode.crt"
|
||||||
testnodekey="/.ci/certs/testnode.key"
|
testnodekey="/.ci/certs/testnode.key"
|
||||||
cacrt="/.ci/certs/ca.crt"
|
cacrt="/.ci/certs/ca.crt"
|
||||||
|
|
||||||
elasticsearch_image="elasticsearch"
|
|
||||||
elasticsearch_url="https://elastic:changeme@${NODE_NAME}:9200"
|
|
||||||
if [[ $TEST_SUITE != "xpack" ]]; then
|
|
||||||
elasticsearch_image="elasticsearch"
|
|
||||||
elasticsearch_url="http://${NODE_NAME}:9200"
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker network create esnet
|
|
||||||
|
|
||||||
docker run \
|
docker run \
|
||||||
--rm \
|
--rm \
|
||||||
--env "node.attr.testattr=test" \
|
--env "node.attr.testattr=test" \
|
||||||
--env "path.repo=/tmp" \
|
--env "path.repo=/tmp" \
|
||||||
--env "repositories.url.allowed_urls=http://snapshot.*" \
|
--env "repositories.url.allowed_urls=http://snapshot.*" \
|
||||||
--env "discovery.zen.ping.unicast.hosts=${NODE_NAME}" \
|
--env "discovery.type=single-node" \
|
||||||
--env "xpack.security.enabled=false" \
|
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
|
||||||
--env "xpack.monitoring.enabled=false" \
|
--env "ELASTIC_PASSWORD=changeme" \
|
||||||
--env "xpack.ml.enabled=false" \
|
--env "xpack.security.enabled=true" \
|
||||||
--env ES_JAVA_OPTS="-Xms1g -Xmx1g" \
|
--env "xpack.license.self_generated.type=trial" \
|
||||||
--network=esnet \
|
--env "xpack.security.http.ssl.enabled=true" \
|
||||||
--name=$NODE_NAME \
|
--env "xpack.security.http.ssl.verification_mode=certificate" \
|
||||||
|
--env "xpack.security.http.ssl.key=certs/testnode.key" \
|
||||||
|
--env "xpack.security.http.ssl.certificate=certs/testnode.crt" \
|
||||||
|
--env "xpack.security.http.ssl.certificate_authorities=certs/ca.crt" \
|
||||||
|
--env "xpack.security.transport.ssl.enabled=true" \
|
||||||
|
--env "xpack.security.transport.ssl.key=certs/testnode.key" \
|
||||||
|
--env "xpack.security.transport.ssl.certificate=certs/testnode.crt" \
|
||||||
|
--env "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt" \
|
||||||
|
--volume "$repo$testnodecrt:/usr/share/elasticsearch/config/certs/testnode.crt" \
|
||||||
|
--volume "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \
|
||||||
|
--volume "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \
|
||||||
|
--network=esnet-platinum \
|
||||||
|
--name=elasticsearch-platinum \
|
||||||
--detach \
|
--detach \
|
||||||
docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION}
|
docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION}
|
||||||
|
|
||||||
|
# run the client unit and oss integration test
|
||||||
docker run \
|
docker run \
|
||||||
--network=esnet \
|
--network=esnet-oss \
|
||||||
--env "TEST_ES_SERVER=${elasticsearch_url}" \
|
--env "TEST_ES_SERVER=http://elasticsearch-oss:9200" \
|
||||||
--env "CODECOV_TOKEN" \
|
--env "CODECOV_TOKEN" \
|
||||||
--volume $(pwd):/usr/src/app \
|
--volume $repo:/usr/src/app \
|
||||||
--volume /usr/src/app/node_modules \
|
--volume /usr/src/app/node_modules \
|
||||||
--name elasticsearch-js \
|
--name elasticsearch-js-oss \
|
||||||
--rm \
|
--rm \
|
||||||
elastic/elasticsearch-js \
|
elastic/elasticsearch-js \
|
||||||
npm run ci
|
npm run ci
|
||||||
|
|
||||||
|
# run the client platinium integration test
|
||||||
|
docker run \
|
||||||
|
--network=esnet-platinum \
|
||||||
|
--env "TEST_ES_SERVER=https://elastic:changeme@elasticsearch-platinum:9200" \
|
||||||
|
--volume $repo:/usr/src/app \
|
||||||
|
--volume /usr/src/app/node_modules \
|
||||||
|
--name elasticsearch-js-platinum \
|
||||||
|
--rm \
|
||||||
|
elastic/elasticsearch-js \
|
||||||
|
npm run test:integration
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
---
|
---
|
||||||
ELASTICSEARCH_VERSION:
|
ELASTICSEARCH_VERSION:
|
||||||
- 5.6.16
|
- 6.7.1
|
||||||
|
|
||||||
NODE_JS_VERSION:
|
NODE_JS_VERSION:
|
||||||
- 12
|
- 12
|
||||||
- 10
|
- 10
|
||||||
- 8
|
- 8
|
||||||
|
|
||||||
TEST_SUITE:
|
|
||||||
- oss
|
|
||||||
|
|
||||||
exclude: ~
|
exclude: ~
|
||||||
|
|||||||
6
.gitignore
vendored
6
.gitignore
vendored
@ -50,6 +50,8 @@ package-lock.json
|
|||||||
# elasticsearch repo or binary files
|
# elasticsearch repo or binary files
|
||||||
elasticsearch*
|
elasticsearch*
|
||||||
|
|
||||||
test/benchmarks/macro/fixtures/*
|
# Generated typings, we don't commit them
|
||||||
|
# because we should copy them in the main .d.ts file
|
||||||
|
api/generated.d.ts
|
||||||
|
|
||||||
*-junit.xml
|
test/benchmarks/macro/fixtures/*
|
||||||
|
|||||||
16
.travis.yml
16
.travis.yml
@ -1,3 +1,7 @@
|
|||||||
|
dist: trusty
|
||||||
|
|
||||||
|
sudo: required
|
||||||
|
|
||||||
language: node_js
|
language: node_js
|
||||||
|
|
||||||
node_js:
|
node_js:
|
||||||
@ -5,21 +9,11 @@ node_js:
|
|||||||
- "10"
|
- "10"
|
||||||
- "8"
|
- "8"
|
||||||
|
|
||||||
cache:
|
|
||||||
npm: false
|
|
||||||
|
|
||||||
os:
|
|
||||||
- windows
|
|
||||||
- linux
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- npm install
|
- npm install
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then npm run license-checker; fi
|
- npm run license-checker && npm run test
|
||||||
- npm run lint
|
|
||||||
- npm run test:coverage
|
|
||||||
- npm run test:types
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
|||||||
252
README.md
252
README.md
@ -1,24 +1,23 @@
|
|||||||
<img align="right" width="auto" height="auto" src="https://www.elastic.co/static-res/images/elastic-logo-200.png">
|
<img align="right" width="auto" height="auto" src="https://www.elastic.co/static-res/images/elastic-logo-200.png">
|
||||||
|
|
||||||
# Elasticsearch Node.js client
|
# @elastic/elasticsearch
|
||||||
|
|
||||||
[](http://standardjs.com/) [](https://clients-ci.elastic.co/view/Javascript/job/elastic+elasticsearch-js+master/) [](https://codecov.io/gh/elastic/elasticsearch-js) [](https://www.npmjs.com/package/@elastic/elasticsearch)
|
[](http://standardjs.com/) [](https://clients-ci.elastic.co/job/elastic+elasticsearch-js+master/) [](https://codecov.io/gh/elastic/elasticsearch-js) [](https://www.npmjs.com/package/@elastic/elasticsearch)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Note:** In the past months we have worked on the new Elasticsearch Node.js client, and if you want you can already try it by following the instructions below, while if you're going to use the legacy one or report an issue, please check out [elastic/elasticsearch-js-legacy](https://github.com/elastic/elasticsearch-js-legacy).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
The official Node.js client for Elasticsearch.
|
The official Node.js client for Elasticsearch.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Note:** In the past months we have worked on the new Elasticsearch Node.js client and you can use it by following the instructions below. If you're going to use the legacy one or report an issue, however, please check out [elastic/elasticsearch-js-legacy](https://github.com/elastic/elasticsearch-js-legacy).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- One-to-one mapping with REST API.
|
- One-to-one mapping with REST API.
|
||||||
- Generalized, pluggable architecture.
|
- Generalized, pluggable architecture.
|
||||||
- Configurable, automatic discovery of cluster nodes.
|
- Configurable, automatic discovery of cluster nodes.
|
||||||
- Persistent, Keep-Alive connections.
|
- Persistent, Keep-Alive connections.
|
||||||
- Load balancing across all available nodes.
|
- Load balancing (with pluggable selection strategy) across all available nodes.
|
||||||
- Child client support.
|
|
||||||
- TypeScript support out of the box.
|
- TypeScript support out of the box.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
@ -30,49 +29,62 @@ npm install @elastic/elasticsearch
|
|||||||
|
|
||||||
The minimum supported version of Node.js is `v8`.
|
The minimum supported version of Node.js is `v8`.
|
||||||
|
|
||||||
The library is compatible with all Elasticsearch versions since 5.x, and you should use the same major version of the Elasticsearch instance that you are using.
|
The library is compatible with all Elasticsearch versions since 5.x, but you should use the same major version of the Elasticsearch instance that you are using.
|
||||||
|
|
||||||
| Elasticsearch Version | Client Version |
|
|
||||||
| --------------------- |----------------|
|
|
||||||
| `master` | `master` |
|
|
||||||
| `7.x` | `7.x` |
|
|
||||||
| `6.x` | `6.x` |
|
|
||||||
| `5.x` | `5.x` |
|
|
||||||
|
|
||||||
To install a specific major of the client, run the following command:
|
|
||||||
```
|
```
|
||||||
npm install @elastic/elasticsearch@<major>
|
# Elasticsearch 7.x
|
||||||
|
@elastic/elasticsearch@7
|
||||||
|
|
||||||
|
# Elasticsearch 6.x
|
||||||
|
@elastic/elasticsearch@6
|
||||||
|
|
||||||
|
# Elasticsearch 5.x
|
||||||
|
@elastic/elasticsearch@5
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Browser
|
#### Install multiple versions
|
||||||
|
If you are using multiple versions of Elasticsearch, you need to use multiple versions of the client. In the past, install multiple versions of the same package was not possible, but with `npm v6.9`, you can do that via aliasing.
|
||||||
|
|
||||||
WARNING: There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues.
|
The command you must run to install different version of the client is:
|
||||||
We recommend that you write a lightweight proxy that uses this client instead.
|
```sh
|
||||||
|
npm install <alias>@npm:@elastic/elasticsearch@<version>
|
||||||
|
```
|
||||||
|
So for example if you need to install `7.x` and `6.x`, you will run
|
||||||
|
```sh
|
||||||
|
npm install es6@npm:@elastic/elasticsearch@6
|
||||||
|
npm install es7@npm:@elastic/elasticsearch@7
|
||||||
|
```
|
||||||
|
And your `package.json` will look like the following:
|
||||||
|
```json
|
||||||
|
"dependencies": {
|
||||||
|
"es6": "npm:@elastic/elasticsearch@^6.7.0",
|
||||||
|
"es7": "npm:@elastic/elasticsearch@^7.0.0"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
And finally, you will require the packages from your code by using the alias you have defined.
|
||||||
|
```js
|
||||||
|
const { Client: Client6 } = require('es6')
|
||||||
|
const { Client: Client7 } = require('es7')
|
||||||
|
|
||||||
## Documentation
|
const client6 = new Client6({ node: 'http://localhost:9200' })
|
||||||
|
const client7 = new Client7({ node: 'http://localhost:9201' })
|
||||||
|
|
||||||
- [Introduction](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html)
|
client6.info(console.log)
|
||||||
- [Usage](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-usage.html)
|
client7.info(console.log)
|
||||||
- [Client configuration](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html)
|
```
|
||||||
- [API reference](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)
|
|
||||||
- [Breaking changes coming from the old client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/breaking-changes.html)
|
|
||||||
- [Authentication](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html)
|
|
||||||
- [Observability](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html)
|
|
||||||
- [Creating a child client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/child-client.html)
|
|
||||||
- [Extend the client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/extend-client.html)
|
|
||||||
- [Typescript support](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/typescript.html)
|
|
||||||
- [Examples](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/examples.html)
|
|
||||||
|
|
||||||
## Quick start
|
Finally, if you want to install the client for the next version of Elasticsearch *(the one that lives in Elasticsearch’s master branch)*, you can use the following command:
|
||||||
|
```sh
|
||||||
|
npm install esmaster@github:elastic/elasticsearch-js
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
You can find the full documentation in our [docs](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html) website.
|
||||||
|
|
||||||
First of all, require the client and initialize it:
|
|
||||||
```js
|
```js
|
||||||
const { Client } = require('@elastic/elasticsearch')
|
const { Client } = require('@elastic/elasticsearch')
|
||||||
const client = new Client({ node: 'http://localhost:9200' })
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
```
|
|
||||||
|
|
||||||
You can use both the callback-style API and the promise-style API, both behave the same way.
|
|
||||||
```js
|
|
||||||
// promise API
|
// promise API
|
||||||
const result = await client.search({
|
const result = await client.search({
|
||||||
index: 'my-index',
|
index: 'my-index',
|
||||||
@ -97,98 +109,84 @@ The returned value of **every** API call is formed as follows:
|
|||||||
meta: object
|
meta: object
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
### Client options
|
||||||
|
|
||||||
Let's see a complete example!
|
The client is designed to be easily configured as you see fit for your needs, following you can see all the possible options that you can use to configure it.
|
||||||
```js
|
|
||||||
'use strict'
|
|
||||||
|
|
||||||
const { Client } = require('@elastic/elasticsearch')
|
```ts
|
||||||
const client = new Client({ node: 'http://localhost:9200' })
|
{
|
||||||
|
// the Elasticsearch endpoint to use
|
||||||
async function run () {
|
node: string | string[];
|
||||||
// Let's start by indexing some data
|
// alias of above
|
||||||
await client.index({
|
nodes: string | string[];
|
||||||
index: 'game-of-thrones',
|
// custom connection class
|
||||||
// type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6
|
Connection: typeof Connection;
|
||||||
body: {
|
// custom connection pool class
|
||||||
character: 'Ned Stark',
|
ConnectionPool: typeof ConnectionPool;
|
||||||
quote: 'Winter is coming.'
|
// custom transport class
|
||||||
}
|
Transport: typeof Transport;
|
||||||
})
|
// custom serializer class
|
||||||
|
Serializer: typeof Serializer;
|
||||||
await client.index({
|
// max number of retries for each request
|
||||||
index: 'game-of-thrones',
|
maxRetries: number;
|
||||||
// type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6
|
// max request timeout for each request
|
||||||
body: {
|
requestTimeout: number;
|
||||||
character: 'Daenerys Targaryen',
|
// max ping timeout for each request
|
||||||
quote: 'I am the blood of the dragon.'
|
pingTimeout: number;
|
||||||
}
|
// perform a sniff operation every `n` milliseconds
|
||||||
})
|
sniffInterval: number;
|
||||||
|
// perform a sniff once the client is started
|
||||||
await client.index({
|
sniffOnStart: boolean;
|
||||||
index: 'game-of-thrones',
|
// custom sniff endpoint, defaults `_nodes/_all/http`
|
||||||
// type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6
|
sniffEndpoint: string;
|
||||||
body: {
|
// perform a sniff on connection fault
|
||||||
character: 'Tyrion Lannister',
|
sniffOnConnectionFault: boolean;
|
||||||
quote: 'A mind needs books like a sword needs a whetstone.'
|
// configurethe node resurrection strategy, default `ping`
|
||||||
}
|
resurrectStrategy: 'ping' | 'optimistic' | 'none';
|
||||||
})
|
// adds `accept-encoding` header to every request
|
||||||
|
suggestCompression: boolean;
|
||||||
// here we are forcing an index refresh, otherwise we will not
|
// enable gzip request body compression
|
||||||
// get any result in the consequent search
|
compression: 'gzip';
|
||||||
await client.indices.refresh({ index: 'game-of-thrones' })
|
// ssl configuraton
|
||||||
|
ssl: http.SecureContextOptions;
|
||||||
// Let's search!
|
// http agent options
|
||||||
const { body } = await client.search({
|
agent: http.AgentOptions;
|
||||||
index: 'game-of-thrones',
|
// filters which node not to use for a request
|
||||||
// type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6
|
nodeFilter: nodeFilterFn;
|
||||||
body: {
|
// custom selection strategy, defaults `round-robin`
|
||||||
query: {
|
nodeSelector: nodeSelectorFn | string;
|
||||||
match: { quote: 'winter' }
|
// function to generate the request id for every request
|
||||||
}
|
generateRequestId: generateRequestIdFn;
|
||||||
}
|
// name to identify the client instance in the events
|
||||||
})
|
name: string;
|
||||||
|
|
||||||
console.log(body.hits.hits)
|
|
||||||
}
|
|
||||||
|
|
||||||
run().catch(console.log)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Install multiple versions
|
|
||||||
If you are using multiple versions of Elasticsearch, you need to use multiple versions of the client. In the past, install multiple versions of the same package was not possible, but with `npm v6.9`, you can do that via aliasing.
|
|
||||||
|
|
||||||
The command you must run to install different version of the client is:
|
|
||||||
```sh
|
|
||||||
npm install <alias>@npm:@elastic/elasticsearch@<version>
|
|
||||||
```
|
|
||||||
So for example if you need to install `7.x` and `6.x`, you will run
|
|
||||||
```sh
|
|
||||||
npm install es6@npm:@elastic/elasticsearch@6
|
|
||||||
npm install es7@npm:@elastic/elasticsearch@7
|
|
||||||
```
|
|
||||||
And your `package.json` will look like the following:
|
|
||||||
```json
|
|
||||||
"dependencies": {
|
|
||||||
"es6": "npm:@elastic/elasticsearch@^6.7.0",
|
|
||||||
"es7": "npm:@elastic/elasticsearch@^7.0.0"
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
You will require the packages from your code by using the alias you have defined.
|
|
||||||
|
### Request specific options
|
||||||
|
If needed you can pass request specific options in a second object:
|
||||||
```js
|
```js
|
||||||
const { Client: Client6 } = require('es6')
|
// promise API
|
||||||
const { Client: Client7 } = require('es7')
|
const result = await client.search({
|
||||||
|
index: 'my-index',
|
||||||
const client6 = new Client6({ node: 'http://localhost:9200' })
|
body: { foo: 'bar' }
|
||||||
const client7 = new Client7({ node: 'http://localhost:9201' })
|
}, {
|
||||||
|
ignore: [404],
|
||||||
client6.info(console.log)
|
maxRetries: 3
|
||||||
client7.info(console.log)
|
})
|
||||||
```
|
```
|
||||||
|
The supported *request specific options* are:
|
||||||
Finally, if you want to install the client for the next version of Elasticsearch *(the one that lives in Elasticsearch’s master branch)*, you can use the following command:
|
```ts
|
||||||
```sh
|
{
|
||||||
npm install esmaster@github:elastic/elasticsearch-js
|
ignore: [number], // default `null`
|
||||||
|
requestTimeout: number, // client default
|
||||||
|
maxRetries: number, // default `5`
|
||||||
|
asStream: boolean, // default `false`
|
||||||
|
compression: string, // default `false`
|
||||||
|
headers: object, // default `null`
|
||||||
|
querystring: object // default `null`,
|
||||||
|
context: object // default `null`,
|
||||||
|
id: any // default incr. integer
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildBulk (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-bulk.html) request
|
* Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request
|
||||||
*
|
*
|
||||||
* @param {string} index - Default index for items which don't provide one
|
* @param {string} index - Default index for items which don't provide one
|
||||||
* @param {string} type - Default document type for items which don't provide one
|
* @param {string} type - Default document type for items which don't provide one
|
||||||
@ -22,8 +37,8 @@ function buildBulk (opts) {
|
|||||||
* @param {string} type - Default document type for items which don't provide one
|
* @param {string} type - Default document type for items which don't provide one
|
||||||
* @param {list} fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request
|
* @param {list} fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request
|
||||||
* @param {list} _source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
|
* @param {list} _source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
|
||||||
* @param {list} _source_exclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
|
* @param {list} _source_excludes - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
|
||||||
* @param {list} _source_include - Default list of fields to extract and return from the _source field, can be overridden on each sub-request
|
* @param {list} _source_includes - Default list of fields to extract and return from the _source field, can be overridden on each sub-request
|
||||||
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
|
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
|
||||||
* @param {object} body - The operation definition and data (action-data pairs), separated by newlines
|
* @param {object} body - The operation definition and data (action-data pairs), separated by newlines
|
||||||
*/
|
*/
|
||||||
@ -36,8 +51,8 @@ function buildBulk (opts) {
|
|||||||
'type',
|
'type',
|
||||||
'fields',
|
'fields',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_exclude',
|
'_source_excludes',
|
||||||
'_source_include',
|
'_source_includes',
|
||||||
'pipeline',
|
'pipeline',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
@ -48,8 +63,8 @@ function buildBulk (opts) {
|
|||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
waitForActiveShards: 'wait_for_active_shards',
|
waitForActiveShards: 'wait_for_active_shards',
|
||||||
_sourceExclude: '_source_exclude',
|
_sourceExcludes: '_source_excludes',
|
||||||
_sourceInclude: '_source_include',
|
_sourceIncludes: '_source_includes',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatAliases (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-alias.html) request
|
* Perform a [cat.aliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html) request
|
||||||
*
|
*
|
||||||
* @param {list} name - A comma-separated list of alias names to return
|
* @param {list} name - A comma-separated list of alias names to return
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatAllocation (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-allocation.html) request
|
* Perform a [cat.allocation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request
|
||||||
*
|
*
|
||||||
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information
|
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatCount (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-count.html) request
|
* Perform a [cat.count](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatFielddata (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-fielddata.html) request
|
* Perform a [cat.fielddata](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html) request
|
||||||
*
|
*
|
||||||
* @param {list} fields - A comma-separated list of fields to return the fielddata size
|
* @param {list} fields - A comma-separated list of fields to return the fielddata size
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatHealth (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-health.html) request
|
* Perform a [cat.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html) request
|
||||||
*
|
*
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatHelp (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat.html) request
|
* Perform a [cat.help](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request
|
||||||
*
|
*
|
||||||
* @param {boolean} help - Return help information
|
* @param {boolean} help - Return help information
|
||||||
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
* @param {list} s - Comma-separated list of column names or column aliases to sort by
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatIndices (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-indices.html) request
|
* Perform a [cat.indices](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatMaster (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-master.html) request
|
* Perform a [cat.master](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html) request
|
||||||
*
|
*
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatNodeattrs (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-nodeattrs.html) request
|
* Perform a [cat.nodeattrs](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html) request
|
||||||
*
|
*
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatNodes (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-nodes.html) request
|
* Perform a [cat.nodes](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html) request
|
||||||
*
|
*
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
* @param {boolean} full_id - Return the full node ID instead of the shortened version (default: false)
|
* @param {boolean} full_id - Return the full node ID instead of the shortened version (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatPendingTasks (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.pending_tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-pending-tasks.html) request
|
* Perform a [cat.pending_tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html) request
|
||||||
*
|
*
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatPlugins (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-plugins.html) request
|
* Perform a [cat.plugins](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html) request
|
||||||
*
|
*
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatRecovery (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-recovery.html) request
|
* Perform a [cat.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatRepositories (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-repositories.html) request
|
* Perform a [cat.repositories](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html) request
|
||||||
*
|
*
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node
|
* @param {boolean} local - Return local information, do not retrieve the state from master node
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatSegments (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-segments.html) request
|
* Perform a [cat.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatShards (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-shards.html) request
|
* Perform a [cat.shards](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to limit the returned information
|
* @param {list} index - A comma-separated list of index names to limit the returned information
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatSnapshots (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-snapshots.html) request
|
* Perform a [cat.snapshots](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html) request
|
||||||
*
|
*
|
||||||
* @param {list} repository - Name of repository from which to fetch the snapshot information
|
* @param {list} repository - Name of repository from which to fetch the snapshot information
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
@ -58,10 +73,6 @@ function buildCatSnapshots (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check required parameters
|
// check required parameters
|
||||||
if (params['repository'] == null) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter: repository')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
if (params.body != null) {
|
if (params.body != null) {
|
||||||
const err = new ConfigurationError('This API does not require a body')
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,13 +26,12 @@ function buildCatTasks (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/tasks.html) request
|
* Perform a [cat.tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
|
||||||
*
|
*
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
||||||
* @param {list} actions - A comma-separated list of actions that should be returned. Leave empty to return all.
|
* @param {list} actions - A comma-separated list of actions that should be returned. Leave empty to return all.
|
||||||
* @param {boolean} detailed - Return detailed task information (default: false)
|
* @param {boolean} detailed - Return detailed task information (default: false)
|
||||||
* @param {string} parent_node - Return tasks with specified parent node.
|
|
||||||
* @param {number} parent_task - Return tasks with specified parent task id. Set to -1 to return all.
|
* @param {number} parent_task - Return tasks with specified parent task id. Set to -1 to return all.
|
||||||
* @param {list} h - Comma-separated list of column names to display
|
* @param {list} h - Comma-separated list of column names to display
|
||||||
* @param {boolean} help - Return help information
|
* @param {boolean} help - Return help information
|
||||||
@ -30,7 +44,6 @@ function buildCatTasks (opts) {
|
|||||||
'node_id',
|
'node_id',
|
||||||
'actions',
|
'actions',
|
||||||
'detailed',
|
'detailed',
|
||||||
'parent_node',
|
|
||||||
'parent_task',
|
'parent_task',
|
||||||
'h',
|
'h',
|
||||||
'help',
|
'help',
|
||||||
@ -45,7 +58,6 @@ function buildCatTasks (opts) {
|
|||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
nodeId: 'node_id',
|
nodeId: 'node_id',
|
||||||
parentNode: 'parent_node',
|
|
||||||
parentTask: 'parent_task',
|
parentTask: 'parent_task',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatTemplates (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-templates.html) request
|
* Perform a [cat.templates](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html) request
|
||||||
*
|
*
|
||||||
* @param {string} name - A pattern that returned template names must match
|
* @param {string} name - A pattern that returned template names must match
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCatThreadPool (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cat.thread_pool](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-thread-pool.html) request
|
* Perform a [cat.thread_pool](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html) request
|
||||||
*
|
*
|
||||||
* @param {list} thread_pool_patterns - A comma-separated list of regular-expressions to filter the thread pools in the output
|
* @param {list} thread_pool_patterns - A comma-separated list of regular-expressions to filter the thread pools in the output
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
|
|||||||
96
api/api/ccr.delete_auto_follow_pattern.js
Normal file
96
api/api/ccr.delete_auto_follow_pattern.js
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrDeleteAutoFollowPattern (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.delete_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html) request
|
||||||
|
*
|
||||||
|
* @param {string} name - The name of the auto follow pattern.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrDeleteAutoFollowPattern (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['name'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: name')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, name, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'DELETE'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrDeleteAutoFollowPattern
|
||||||
102
api/api/ccr.follow.js
Normal file
102
api/api/ccr.follow.js
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrFollow (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html) request
|
||||||
|
*
|
||||||
|
* @param {string} index - The name of the follower index
|
||||||
|
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||||
|
* @param {object} body - The name of the leader index and other optional ccr related parameters
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
'wait_for_active_shards'
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
waitForActiveShards: 'wait_for_active_shards'
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrFollow (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['index'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: index')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
if (params['body'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'PUT'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrFollow
|
||||||
90
api/api/ccr.follow_info.js
Normal file
90
api/api/ccr.follow_info.js
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrFollowInfo (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.follow_info](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html) request
|
||||||
|
*
|
||||||
|
* @param {list} index - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrFollowInfo (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'GET'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: null,
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrFollowInfo
|
||||||
90
api/api/ccr.follow_stats.js
Normal file
90
api/api/ccr.follow_stats.js
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrFollowStats (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.follow_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html) request
|
||||||
|
*
|
||||||
|
* @param {list} index - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrFollowStats (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'GET'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: null,
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrFollowStats
|
||||||
101
api/api/ccr.forget_follower.js
Normal file
101
api/api/ccr.forget_follower.js
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrForgetFollower (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.forget_follower](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
|
||||||
|
*
|
||||||
|
* @param {string} index - the name of the leader index for which specified follower retention leases should be removed
|
||||||
|
* @param {object} body - the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrForgetFollower (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['index'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: index')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
if (params['body'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrForgetFollower
|
||||||
94
api/api/ccr.get_auto_follow_pattern.js
Normal file
94
api/api/ccr.get_auto_follow_pattern.js
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrGetAutoFollowPattern (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.get_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html) request
|
||||||
|
*
|
||||||
|
* @param {string} name - The name of the auto follow pattern.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrGetAutoFollowPattern (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, name, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'GET'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
if ((name) != null) {
|
||||||
|
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
|
||||||
|
} else {
|
||||||
|
path = '/' + '_ccr' + '/' + 'auto_follow'
|
||||||
|
}
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: null,
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrGetAutoFollowPattern
|
||||||
96
api/api/ccr.pause_follow.js
Normal file
96
api/api/ccr.pause_follow.js
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrPauseFollow (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.pause_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html) request
|
||||||
|
*
|
||||||
|
* @param {string} index - The name of the follower index that should pause following its leader index.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrPauseFollow (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['index'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: index')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrPauseFollow
|
||||||
101
api/api/ccr.put_auto_follow_pattern.js
Normal file
101
api/api/ccr.put_auto_follow_pattern.js
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrPutAutoFollowPattern (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.put_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html) request
|
||||||
|
*
|
||||||
|
* @param {string} name - The name of the auto follow pattern.
|
||||||
|
* @param {object} body - The specification of the auto follow pattern
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrPutAutoFollowPattern (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['name'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: name')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
if (params['body'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, name, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'PUT'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrPutAutoFollowPattern
|
||||||
97
api/api/ccr.resume_follow.js
Normal file
97
api/api/ccr.resume_follow.js
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrResumeFollow (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.resume_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html) request
|
||||||
|
*
|
||||||
|
* @param {string} index - The name of the follow index to resume following.
|
||||||
|
* @param {object} body - The name of the leader index and other optional ccr related parameters
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrResumeFollow (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['index'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: index')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrResumeFollow
|
||||||
89
api/api/ccr.stats.js
Normal file
89
api/api/ccr.stats.js
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrStats (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html) request
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrStats (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'GET'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_ccr' + '/' + 'stats'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: null,
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrStats
|
||||||
96
api/api/ccr.unfollow.js
Normal file
96
api/api/ccr.unfollow.js
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildCcrUnfollow (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ccr.unfollow](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
|
||||||
|
*
|
||||||
|
* @param {string} index - The name of the follower index that should be turned into a regular index.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ccrUnfollow (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['index'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: index')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildCcrUnfollow
|
||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildClearScroll (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [clear_scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-request-scroll.html) request
|
* Perform a [clear_scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request
|
||||||
*
|
*
|
||||||
* @param {list} scroll_id - A comma-separated list of scroll IDs to clear
|
* @param {list} scroll_id - A comma-separated list of scroll IDs to clear
|
||||||
* @param {object} body - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
|
* @param {object} body - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildClusterAllocationExplain (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cluster.allocation_explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-allocation-explain.html) request
|
* Perform a [cluster.allocation_explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html) request
|
||||||
*
|
*
|
||||||
* @param {boolean} include_yes_decisions - Return 'YES' decisions in explanation (default: false)
|
* @param {boolean} include_yes_decisions - Return 'YES' decisions in explanation (default: false)
|
||||||
* @param {boolean} include_disk_info - Return information about disk usage and shard sizes (default: false)
|
* @param {boolean} include_disk_info - Return information about disk usage and shard sizes (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildClusterGetSettings (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cluster.get_settings](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-update-settings.html) request
|
* Perform a [cluster.get_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request
|
||||||
*
|
*
|
||||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildClusterHealth (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-health.html) request
|
* Perform a [cluster.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - Limit the information returned to a specific index
|
* @param {list} index - Limit the information returned to a specific index
|
||||||
* @param {enum} level - Specify the level of detail for returned information
|
* @param {enum} level - Specify the level of detail for returned information
|
||||||
@ -22,6 +37,7 @@ function buildClusterHealth (opts) {
|
|||||||
* @param {string} wait_for_nodes - Wait until the specified number of nodes is available
|
* @param {string} wait_for_nodes - Wait until the specified number of nodes is available
|
||||||
* @param {enum} wait_for_events - Wait until all currently queued events with the given priority are processed
|
* @param {enum} wait_for_events - Wait until all currently queued events with the given priority are processed
|
||||||
* @param {boolean} wait_for_no_relocating_shards - Whether to wait until there are no relocating shards in the cluster
|
* @param {boolean} wait_for_no_relocating_shards - Whether to wait until there are no relocating shards in the cluster
|
||||||
|
* @param {boolean} wait_for_no_initializing_shards - Whether to wait until there are no initializing shards in the cluster
|
||||||
* @param {enum} wait_for_status - Wait until cluster is in a specific state
|
* @param {enum} wait_for_status - Wait until cluster is in a specific state
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -34,6 +50,7 @@ function buildClusterHealth (opts) {
|
|||||||
'wait_for_nodes',
|
'wait_for_nodes',
|
||||||
'wait_for_events',
|
'wait_for_events',
|
||||||
'wait_for_no_relocating_shards',
|
'wait_for_no_relocating_shards',
|
||||||
|
'wait_for_no_initializing_shards',
|
||||||
'wait_for_status',
|
'wait_for_status',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
@ -48,6 +65,7 @@ function buildClusterHealth (opts) {
|
|||||||
waitForNodes: 'wait_for_nodes',
|
waitForNodes: 'wait_for_nodes',
|
||||||
waitForEvents: 'wait_for_events',
|
waitForEvents: 'wait_for_events',
|
||||||
waitForNoRelocatingShards: 'wait_for_no_relocating_shards',
|
waitForNoRelocatingShards: 'wait_for_no_relocating_shards',
|
||||||
|
waitForNoInitializingShards: 'wait_for_no_initializing_shards',
|
||||||
waitForStatus: 'wait_for_status',
|
waitForStatus: 'wait_for_status',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildClusterPendingTasks (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cluster.pending_tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-pending.html) request
|
* Perform a [cluster.pending_tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html) request
|
||||||
*
|
*
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
* @param {time} master_timeout - Specify timeout for connection to master
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildClusterPutSettings (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cluster.put_settings](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-update-settings.html) request
|
* Perform a [cluster.put_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request
|
||||||
*
|
*
|
||||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||||
@ -49,6 +64,12 @@ function buildClusterPutSettings (opts) {
|
|||||||
options = {}
|
options = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['body'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildClusterRemoteInfo (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cluster.remote_info](http://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-remote-info.html) request
|
* Perform a [cluster.remote_info](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html) request
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildClusterReroute (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-reroute.html) request
|
* Perform a [cluster.reroute](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html) request
|
||||||
*
|
*
|
||||||
* @param {boolean} dry_run - Simulate the operation only and return the resulting state
|
* @param {boolean} dry_run - Simulate the operation only and return the resulting state
|
||||||
* @param {boolean} explain - Return an explanation of why the commands can or cannot be executed
|
* @param {boolean} explain - Return an explanation of why the commands can or cannot be executed
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,13 +26,15 @@ function buildClusterState (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-state.html) request
|
* Perform a [cluster.state](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {list} metric - Limit the information returned to the specified metrics
|
* @param {list} metric - Limit the information returned to the specified metrics
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
* @param {time} master_timeout - Specify timeout for connection to master
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||||
|
* @param {number} wait_for_metadata_version - Wait for the metadata version to be equal or greater than the specified metadata version
|
||||||
|
* @param {time} wait_for_timeout - The maximum time to wait for wait_for_metadata_version before timing out
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||||
@ -27,6 +44,8 @@ function buildClusterState (opts) {
|
|||||||
'local',
|
'local',
|
||||||
'master_timeout',
|
'master_timeout',
|
||||||
'flat_settings',
|
'flat_settings',
|
||||||
|
'wait_for_metadata_version',
|
||||||
|
'wait_for_timeout',
|
||||||
'ignore_unavailable',
|
'ignore_unavailable',
|
||||||
'allow_no_indices',
|
'allow_no_indices',
|
||||||
'expand_wildcards',
|
'expand_wildcards',
|
||||||
@ -40,6 +59,8 @@ function buildClusterState (opts) {
|
|||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
masterTimeout: 'master_timeout',
|
masterTimeout: 'master_timeout',
|
||||||
flatSettings: 'flat_settings',
|
flatSettings: 'flat_settings',
|
||||||
|
waitForMetadataVersion: 'wait_for_metadata_version',
|
||||||
|
waitForTimeout: 'wait_for_timeout',
|
||||||
ignoreUnavailable: 'ignore_unavailable',
|
ignoreUnavailable: 'ignore_unavailable',
|
||||||
allowNoIndices: 'allow_no_indices',
|
allowNoIndices: 'allow_no_indices',
|
||||||
expandWildcards: 'expand_wildcards',
|
expandWildcards: 'expand_wildcards',
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildClusterStats (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-stats.html) request
|
* Perform a [cluster.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html) request
|
||||||
*
|
*
|
||||||
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
||||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,11 +26,12 @@ function buildCount (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-count.html) request
|
* Perform a [count](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of indices to restrict the results
|
* @param {list} index - A comma-separated list of indices to restrict the results
|
||||||
* @param {list} type - A comma-separated list of types to restrict the results
|
* @param {list} type - A comma-separated list of types to restrict the results
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
|
* @param {boolean} ignore_throttled - Whether specified concrete, expanded or aliased indices should be ignored when throttled
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||||
* @param {number} min_score - Include only documents with a specific `_score` value in the result
|
* @param {number} min_score - Include only documents with a specific `_score` value in the result
|
||||||
@ -33,6 +49,7 @@ function buildCount (opts) {
|
|||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
'ignore_unavailable',
|
'ignore_unavailable',
|
||||||
|
'ignore_throttled',
|
||||||
'allow_no_indices',
|
'allow_no_indices',
|
||||||
'expand_wildcards',
|
'expand_wildcards',
|
||||||
'min_score',
|
'min_score',
|
||||||
@ -54,6 +71,7 @@ function buildCount (opts) {
|
|||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
ignoreUnavailable: 'ignore_unavailable',
|
ignoreUnavailable: 'ignore_unavailable',
|
||||||
|
ignoreThrottled: 'ignore_throttled',
|
||||||
allowNoIndices: 'allow_no_indices',
|
allowNoIndices: 'allow_no_indices',
|
||||||
expandWildcards: 'expand_wildcards',
|
expandWildcards: 'expand_wildcards',
|
||||||
minScore: 'min_score',
|
minScore: 'min_score',
|
||||||
|
|||||||
@ -1,130 +0,0 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
||||||
// See the LICENSE file in the project root for more information
|
|
||||||
|
|
||||||
'use strict'
|
|
||||||
|
|
||||||
/* eslint camelcase: 0 */
|
|
||||||
/* eslint no-unused-vars: 0 */
|
|
||||||
|
|
||||||
function buildCountPercolate (opts) {
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
||||||
/**
|
|
||||||
* Perform a [count_percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-percolate.html) request
|
|
||||||
*
|
|
||||||
* @param {string} index - The index of the document being count percolated.
|
|
||||||
* @param {string} type - The type of the document being count percolated.
|
|
||||||
* @param {string} id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster.
|
|
||||||
* @param {list} routing - A comma-separated list of specific routing values
|
|
||||||
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
|
||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
|
||||||
* @param {string} percolate_index - The index to count percolate the document into. Defaults to index.
|
|
||||||
* @param {string} percolate_type - The type to count percolate document into. Defaults to type.
|
|
||||||
* @param {number} version - Explicit version number for concurrency control
|
|
||||||
* @param {enum} version_type - Specific version type
|
|
||||||
* @param {object} body - The count percolator request definition using the percolate DSL
|
|
||||||
*/
|
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
|
||||||
'routing',
|
|
||||||
'preference',
|
|
||||||
'ignore_unavailable',
|
|
||||||
'allow_no_indices',
|
|
||||||
'expand_wildcards',
|
|
||||||
'percolate_index',
|
|
||||||
'percolate_type',
|
|
||||||
'version',
|
|
||||||
'version_type',
|
|
||||||
'pretty',
|
|
||||||
'human',
|
|
||||||
'error_trace',
|
|
||||||
'source',
|
|
||||||
'filter_path'
|
|
||||||
]
|
|
||||||
|
|
||||||
const snakeCase = {
|
|
||||||
ignoreUnavailable: 'ignore_unavailable',
|
|
||||||
allowNoIndices: 'allow_no_indices',
|
|
||||||
expandWildcards: 'expand_wildcards',
|
|
||||||
percolateIndex: 'percolate_index',
|
|
||||||
percolateType: 'percolate_type',
|
|
||||||
versionType: 'version_type',
|
|
||||||
errorTrace: 'error_trace',
|
|
||||||
filterPath: 'filter_path'
|
|
||||||
}
|
|
||||||
|
|
||||||
return function countPercolate (params, options, callback) {
|
|
||||||
options = options || {}
|
|
||||||
if (typeof options === 'function') {
|
|
||||||
callback = options
|
|
||||||
options = {}
|
|
||||||
}
|
|
||||||
if (typeof params === 'function' || params == null) {
|
|
||||||
callback = params
|
|
||||||
params = {}
|
|
||||||
options = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
// check required parameters
|
|
||||||
if (params['index'] == null) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
if (params['type'] == null) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter: type')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: type, index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
} else if (params['type'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
var warnings = []
|
|
||||||
var { method, body, index, type, id, ...querystring } = params
|
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
||||||
|
|
||||||
if (method == null) {
|
|
||||||
method = body == null ? 'GET' : 'POST'
|
|
||||||
}
|
|
||||||
|
|
||||||
var ignore = options.ignore
|
|
||||||
if (typeof ignore === 'number') {
|
|
||||||
options.ignore = [ignore]
|
|
||||||
}
|
|
||||||
|
|
||||||
var path = ''
|
|
||||||
|
|
||||||
if ((index) != null && (type) != null && (id) != null) {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_percolate' + '/' + 'count'
|
|
||||||
} else {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_percolate' + '/' + 'count'
|
|
||||||
}
|
|
||||||
|
|
||||||
// build request object
|
|
||||||
const request = {
|
|
||||||
method,
|
|
||||||
path,
|
|
||||||
body: body || '',
|
|
||||||
querystring
|
|
||||||
}
|
|
||||||
|
|
||||||
options.warnings = warnings.length === 0 ? null : warnings
|
|
||||||
return makeRequest(request, options, callback)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = buildCountPercolate
|
|
||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildCreate (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-index_.html) request
|
* Perform a [create](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - Document ID
|
* @param {string} id - Document ID
|
||||||
* @param {string} index - The name of the index
|
* @param {string} index - The name of the index
|
||||||
@ -21,8 +36,6 @@ function buildCreate (opts) {
|
|||||||
* @param {enum} refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
* @param {enum} refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
||||||
* @param {string} routing - Specific routing value
|
* @param {string} routing - Specific routing value
|
||||||
* @param {time} timeout - Explicit operation timeout
|
* @param {time} timeout - Explicit operation timeout
|
||||||
* @param {time} timestamp - Explicit timestamp for the document
|
|
||||||
* @param {time} ttl - Expiration time for the document
|
|
||||||
* @param {number} version - Explicit version number for concurrency control
|
* @param {number} version - Explicit version number for concurrency control
|
||||||
* @param {enum} version_type - Specific version type
|
* @param {enum} version_type - Specific version type
|
||||||
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
|
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
|
||||||
@ -35,8 +48,6 @@ function buildCreate (opts) {
|
|||||||
'refresh',
|
'refresh',
|
||||||
'routing',
|
'routing',
|
||||||
'timeout',
|
'timeout',
|
||||||
'timestamp',
|
|
||||||
'ttl',
|
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
'pipeline',
|
'pipeline',
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildDelete (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-delete.html) request
|
* Perform a [delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - The document ID
|
* @param {string} id - The document ID
|
||||||
* @param {string} index - The name of the index
|
* @param {string} index - The name of the index
|
||||||
@ -21,6 +36,8 @@ function buildDelete (opts) {
|
|||||||
* @param {enum} refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
* @param {enum} refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
||||||
* @param {string} routing - Specific routing value
|
* @param {string} routing - Specific routing value
|
||||||
* @param {time} timeout - Explicit operation timeout
|
* @param {time} timeout - Explicit operation timeout
|
||||||
|
* @param {number} if_seq_no - only perform the delete operation if the last operation that has changed the document has the specified sequence number
|
||||||
|
* @param {number} if_primary_term - only perform the delete operation if the last operation that has changed the document has the specified primary term
|
||||||
* @param {number} version - Explicit version number for concurrency control
|
* @param {number} version - Explicit version number for concurrency control
|
||||||
* @param {enum} version_type - Specific version type
|
* @param {enum} version_type - Specific version type
|
||||||
*/
|
*/
|
||||||
@ -31,6 +48,8 @@ function buildDelete (opts) {
|
|||||||
'refresh',
|
'refresh',
|
||||||
'routing',
|
'routing',
|
||||||
'timeout',
|
'timeout',
|
||||||
|
'if_seq_no',
|
||||||
|
'if_primary_term',
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
'pretty',
|
'pretty',
|
||||||
@ -42,6 +61,8 @@ function buildDelete (opts) {
|
|||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
waitForActiveShards: 'wait_for_active_shards',
|
waitForActiveShards: 'wait_for_active_shards',
|
||||||
|
ifSeqNo: 'if_seq_no',
|
||||||
|
ifPrimaryTerm: 'if_primary_term',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildDeleteByQuery (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [delete_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-delete-by-query.html) request
|
* Perform a [delete_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
||||||
@ -22,7 +37,7 @@ function buildDeleteByQuery (opts) {
|
|||||||
* @param {number} from - Starting offset (default: 0)
|
* @param {number} from - Starting offset (default: 0)
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||||
* @param {enum} conflicts - What to do when the delete-by-query hits version conflicts?
|
* @param {enum} conflicts - What to do when the delete by query hits version conflicts?
|
||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||||
* @param {boolean} lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
* @param {boolean} lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
||||||
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
|
||||||
@ -34,8 +49,8 @@ function buildDeleteByQuery (opts) {
|
|||||||
* @param {number} size - Number of hits to return (default: 10)
|
* @param {number} size - Number of hits to return (default: 10)
|
||||||
* @param {list} sort - A comma-separated list of <field>:<direction> pairs
|
* @param {list} sort - A comma-separated list of <field>:<direction> pairs
|
||||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||||
* @param {list} _source_exclude - A list of fields to exclude from the returned _source field
|
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||||
* @param {list} _source_include - A list of fields to extract and return from the _source field
|
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||||
* @param {number} terminate_after - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
|
* @param {number} terminate_after - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
|
||||||
* @param {list} stats - Specific 'tag' of the request for logging and statistical purposes
|
* @param {list} stats - Specific 'tag' of the request for logging and statistical purposes
|
||||||
* @param {boolean} version - Specify whether to return document version as part of a hit
|
* @param {boolean} version - Specify whether to return document version as part of a hit
|
||||||
@ -43,8 +58,8 @@ function buildDeleteByQuery (opts) {
|
|||||||
* @param {boolean} refresh - Should the effected indexes be refreshed?
|
* @param {boolean} refresh - Should the effected indexes be refreshed?
|
||||||
* @param {time} timeout - Time each individual bulk request should wait for shards that are unavailable.
|
* @param {time} timeout - Time each individual bulk request should wait for shards that are unavailable.
|
||||||
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||||
* @param {number} scroll_size - Size on the scroll request powering the update_by_query
|
* @param {number} scroll_size - Size on the scroll request powering the delete by query
|
||||||
* @param {boolean} wait_for_completion - Should the request should block until the delete-by-query is complete.
|
* @param {boolean} wait_for_completion - Should the request should block until the delete by query is complete.
|
||||||
* @param {number} requests_per_second - The throttle for this request in sub-requests per second. -1 means no throttle.
|
* @param {number} requests_per_second - The throttle for this request in sub-requests per second. -1 means no throttle.
|
||||||
* @param {number} slices - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
|
* @param {number} slices - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
|
||||||
* @param {object} body - The search definition using the Query DSL
|
* @param {object} body - The search definition using the Query DSL
|
||||||
@ -70,8 +85,8 @@ function buildDeleteByQuery (opts) {
|
|||||||
'size',
|
'size',
|
||||||
'sort',
|
'sort',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_exclude',
|
'_source_excludes',
|
||||||
'_source_include',
|
'_source_includes',
|
||||||
'terminate_after',
|
'terminate_after',
|
||||||
'stats',
|
'stats',
|
||||||
'version',
|
'version',
|
||||||
@ -98,8 +113,8 @@ function buildDeleteByQuery (opts) {
|
|||||||
expandWildcards: 'expand_wildcards',
|
expandWildcards: 'expand_wildcards',
|
||||||
searchType: 'search_type',
|
searchType: 'search_type',
|
||||||
searchTimeout: 'search_timeout',
|
searchTimeout: 'search_timeout',
|
||||||
_sourceExclude: '_source_exclude',
|
_sourceExcludes: '_source_excludes',
|
||||||
_sourceInclude: '_source_include',
|
_sourceIncludes: '_source_includes',
|
||||||
terminateAfter: 'terminate_after',
|
terminateAfter: 'terminate_after',
|
||||||
requestCache: 'request_cache',
|
requestCache: 'request_cache',
|
||||||
waitForActiveShards: 'wait_for_active_shards',
|
waitForActiveShards: 'wait_for_active_shards',
|
||||||
|
|||||||
112
api/api/delete_by_query_rethrottle.js
Normal file
112
api/api/delete_by_query_rethrottle.js
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildDeleteByQueryRethrottle (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [delete_by_query_rethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html) request
|
||||||
|
*
|
||||||
|
* @param {string} task_id - The task id to rethrottle
|
||||||
|
* @param {number} requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
'requests_per_second',
|
||||||
|
'pretty',
|
||||||
|
'human',
|
||||||
|
'error_trace',
|
||||||
|
'source',
|
||||||
|
'filter_path'
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
requestsPerSecond: 'requests_per_second',
|
||||||
|
errorTrace: 'error_trace',
|
||||||
|
filterPath: 'filter_path'
|
||||||
|
}
|
||||||
|
|
||||||
|
return function deleteByQueryRethrottle (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['task_id'] == null && params['taskId'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: task_id or taskId')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
if (params.body != null) {
|
||||||
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, taskId, task_id, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildDeleteByQueryRethrottle
|
||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,10 +26,9 @@ function buildDeleteScript (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [delete_script](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-scripting.html) request
|
* Perform a [delete_script](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - Script ID
|
* @param {string} id - Script ID
|
||||||
* @param {string} lang - Script language
|
|
||||||
* @param {time} timeout - Explicit operation timeout
|
* @param {time} timeout - Explicit operation timeout
|
||||||
* @param {time} master_timeout - Specify timeout for connection to master
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
*/
|
*/
|
||||||
@ -52,21 +66,11 @@ function buildDeleteScript (opts) {
|
|||||||
const err = new ConfigurationError('Missing required parameter: id')
|
const err = new ConfigurationError('Missing required parameter: id')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
if (params['lang'] == null) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter: lang')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
if (params.body != null) {
|
if (params.body != null) {
|
||||||
const err = new ConfigurationError('This API does not require a body')
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['id'] != null && (params['lang'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: lang')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -74,7 +78,7 @@ function buildDeleteScript (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, id, lang, ...querystring } = params
|
var { method, body, id, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -88,11 +92,7 @@ function buildDeleteScript (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((lang) != null && (id) != null) {
|
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
|
||||||
path = '/' + '_scripts' + '/' + encodeURIComponent(lang) + '/' + encodeURIComponent(id)
|
|
||||||
} else {
|
|
||||||
path = '/' + '_scripts' + '/' + encodeURIComponent(lang)
|
|
||||||
}
|
|
||||||
|
|
||||||
// build request object
|
// build request object
|
||||||
const request = {
|
const request = {
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildExists (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-get.html) request
|
* Perform a [exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - The document ID
|
* @param {string} id - The document ID
|
||||||
* @param {string} index - The name of the index
|
* @param {string} index - The name of the index
|
||||||
@ -23,8 +38,8 @@ function buildExists (opts) {
|
|||||||
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
||||||
* @param {string} routing - Specific routing value
|
* @param {string} routing - Specific routing value
|
||||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||||
* @param {list} _source_exclude - A list of fields to exclude from the returned _source field
|
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||||
* @param {list} _source_include - A list of fields to extract and return from the _source field
|
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||||
* @param {number} version - Explicit version number for concurrency control
|
* @param {number} version - Explicit version number for concurrency control
|
||||||
* @param {enum} version_type - Specific version type
|
* @param {enum} version_type - Specific version type
|
||||||
*/
|
*/
|
||||||
@ -37,8 +52,8 @@ function buildExists (opts) {
|
|||||||
'refresh',
|
'refresh',
|
||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_exclude',
|
'_source_excludes',
|
||||||
'_source_include',
|
'_source_includes',
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
'pretty',
|
'pretty',
|
||||||
@ -50,8 +65,8 @@ function buildExists (opts) {
|
|||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
storedFields: 'stored_fields',
|
storedFields: 'stored_fields',
|
||||||
_sourceExclude: '_source_exclude',
|
_sourceExcludes: '_source_excludes',
|
||||||
_sourceInclude: '_source_include',
|
_sourceIncludes: '_source_includes',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -22,8 +37,8 @@ function buildExistsSource (opts) {
|
|||||||
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
||||||
* @param {string} routing - Specific routing value
|
* @param {string} routing - Specific routing value
|
||||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||||
* @param {list} _source_exclude - A list of fields to exclude from the returned _source field
|
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||||
* @param {list} _source_include - A list of fields to extract and return from the _source field
|
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||||
* @param {number} version - Explicit version number for concurrency control
|
* @param {number} version - Explicit version number for concurrency control
|
||||||
* @param {enum} version_type - Specific version type
|
* @param {enum} version_type - Specific version type
|
||||||
*/
|
*/
|
||||||
@ -35,8 +50,8 @@ function buildExistsSource (opts) {
|
|||||||
'refresh',
|
'refresh',
|
||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_exclude',
|
'_source_excludes',
|
||||||
'_source_include',
|
'_source_includes',
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
'pretty',
|
'pretty',
|
||||||
@ -47,8 +62,8 @@ function buildExistsSource (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
_sourceExclude: '_source_exclude',
|
_sourceExcludes: '_source_excludes',
|
||||||
_sourceInclude: '_source_include',
|
_sourceIncludes: '_source_includes',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildExplain (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-explain.html) request
|
* Perform a [explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - The document ID
|
* @param {string} id - The document ID
|
||||||
* @param {string} index - The name of the index
|
* @param {string} index - The name of the index
|
||||||
@ -27,8 +42,8 @@ function buildExplain (opts) {
|
|||||||
* @param {string} q - Query in the Lucene query string syntax
|
* @param {string} q - Query in the Lucene query string syntax
|
||||||
* @param {string} routing - Specific routing value
|
* @param {string} routing - Specific routing value
|
||||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||||
* @param {list} _source_exclude - A list of fields to exclude from the returned _source field
|
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||||
* @param {list} _source_include - A list of fields to extract and return from the _source field
|
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||||
* @param {object} body - The query definition using the Query DSL
|
* @param {object} body - The query definition using the Query DSL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -44,8 +59,8 @@ function buildExplain (opts) {
|
|||||||
'q',
|
'q',
|
||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_exclude',
|
'_source_excludes',
|
||||||
'_source_include',
|
'_source_includes',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
'error_trace',
|
'error_trace',
|
||||||
@ -57,8 +72,8 @@ function buildExplain (opts) {
|
|||||||
analyzeWildcard: 'analyze_wildcard',
|
analyzeWildcard: 'analyze_wildcard',
|
||||||
defaultOperator: 'default_operator',
|
defaultOperator: 'default_operator',
|
||||||
storedFields: 'stored_fields',
|
storedFields: 'stored_fields',
|
||||||
_sourceExclude: '_source_exclude',
|
_sourceExcludes: '_source_excludes',
|
||||||
_sourceInclude: '_source_include',
|
_sourceIncludes: '_source_includes',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildFieldCaps (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [field_caps](http://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-field-caps.html) request
|
* Perform a [field_caps](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {list} fields - A comma-separated list of field names
|
* @param {list} fields - A comma-separated list of field names
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildGet (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-get.html) request
|
* Perform a [get](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - The document ID
|
* @param {string} id - The document ID
|
||||||
* @param {string} index - The name of the index
|
* @param {string} index - The name of the index
|
||||||
@ -23,6 +38,8 @@ function buildGet (opts) {
|
|||||||
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
||||||
* @param {string} routing - Specific routing value
|
* @param {string} routing - Specific routing value
|
||||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||||
|
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||||
|
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||||
* @param {list} _source_exclude - A list of fields to exclude from the returned _source field
|
* @param {list} _source_exclude - A list of fields to exclude from the returned _source field
|
||||||
* @param {list} _source_include - A list of fields to extract and return from the _source field
|
* @param {list} _source_include - A list of fields to extract and return from the _source field
|
||||||
* @param {number} version - Explicit version number for concurrency control
|
* @param {number} version - Explicit version number for concurrency control
|
||||||
@ -37,6 +54,8 @@ function buildGet (opts) {
|
|||||||
'refresh',
|
'refresh',
|
||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
|
'_source_excludes',
|
||||||
|
'_source_includes',
|
||||||
'_source_exclude',
|
'_source_exclude',
|
||||||
'_source_include',
|
'_source_include',
|
||||||
'version',
|
'version',
|
||||||
@ -50,6 +69,8 @@ function buildGet (opts) {
|
|||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
storedFields: 'stored_fields',
|
storedFields: 'stored_fields',
|
||||||
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceIncludes: '_source_includes',
|
||||||
_sourceExclude: '_source_exclude',
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceInclude: '_source_include',
|
_sourceInclude: '_source_include',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,13 +26,14 @@ function buildGetScript (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [get_script](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-scripting.html) request
|
* Perform a [get_script](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - Script ID
|
* @param {string} id - Script ID
|
||||||
* @param {string} lang - Script language
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
|
'master_timeout',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
'error_trace',
|
'error_trace',
|
||||||
@ -26,6 +42,7 @@ function buildGetScript (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
|
masterTimeout: 'master_timeout',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
@ -47,21 +64,11 @@ function buildGetScript (opts) {
|
|||||||
const err = new ConfigurationError('Missing required parameter: id')
|
const err = new ConfigurationError('Missing required parameter: id')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
if (params['lang'] == null) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter: lang')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
if (params.body != null) {
|
if (params.body != null) {
|
||||||
const err = new ConfigurationError('This API does not require a body')
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['id'] != null && (params['lang'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: lang')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -69,7 +76,7 @@ function buildGetScript (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, id, lang, ...querystring } = params
|
var { method, body, id, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -83,11 +90,7 @@ function buildGetScript (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((lang) != null && (id) != null) {
|
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
|
||||||
path = '/' + '_scripts' + '/' + encodeURIComponent(lang) + '/' + encodeURIComponent(id)
|
|
||||||
} else {
|
|
||||||
path = '/' + '_scripts' + '/' + encodeURIComponent(lang)
|
|
||||||
}
|
|
||||||
|
|
||||||
// build request object
|
// build request object
|
||||||
const request = {
|
const request = {
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildGetSource (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [get_source](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-get.html) request
|
* Perform a [get_source](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - The document ID
|
* @param {string} id - The document ID
|
||||||
* @param {string} index - The name of the index
|
* @param {string} index - The name of the index
|
||||||
@ -22,8 +37,8 @@ function buildGetSource (opts) {
|
|||||||
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
* @param {boolean} refresh - Refresh the shard containing the document before performing the operation
|
||||||
* @param {string} routing - Specific routing value
|
* @param {string} routing - Specific routing value
|
||||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||||
* @param {list} _source_exclude - A list of fields to exclude from the returned _source field
|
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
|
||||||
* @param {list} _source_include - A list of fields to extract and return from the _source field
|
* @param {list} _source_includes - A list of fields to extract and return from the _source field
|
||||||
* @param {number} version - Explicit version number for concurrency control
|
* @param {number} version - Explicit version number for concurrency control
|
||||||
* @param {enum} version_type - Specific version type
|
* @param {enum} version_type - Specific version type
|
||||||
*/
|
*/
|
||||||
@ -35,8 +50,8 @@ function buildGetSource (opts) {
|
|||||||
'refresh',
|
'refresh',
|
||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_exclude',
|
'_source_excludes',
|
||||||
'_source_include',
|
'_source_includes',
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
'pretty',
|
'pretty',
|
||||||
@ -47,8 +62,8 @@ function buildGetSource (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
_sourceExclude: '_source_exclude',
|
_sourceExcludes: '_source_excludes',
|
||||||
_sourceInclude: '_source_include',
|
_sourceIncludes: '_source_includes',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
|
|||||||
96
api/api/ilm.delete_lifecycle.js
Normal file
96
api/api/ilm.delete_lifecycle.js
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmDeleteLifecycle (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.delete_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html) request
|
||||||
|
*
|
||||||
|
* @param {string} policy - The name of the index lifecycle policy
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmDeleteLifecycle (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params.body != null) {
|
||||||
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, policy, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'DELETE'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmDeleteLifecycle
|
||||||
97
api/api/ilm.explain_lifecycle.js
Normal file
97
api/api/ilm.explain_lifecycle.js
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmExplainLifecycle (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.explain_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html) request
|
||||||
|
*
|
||||||
|
* @param {string} index - The name of the index to explain
|
||||||
|
* @param {boolean} human - Return data such as dates in a human readable format
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
'human'
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmExplainLifecycle (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params.body != null) {
|
||||||
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'GET'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'explain'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: null,
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmExplainLifecycle
|
||||||
100
api/api/ilm.get_lifecycle.js
Normal file
100
api/api/ilm.get_lifecycle.js
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmGetLifecycle (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.get_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html) request
|
||||||
|
*
|
||||||
|
* @param {string} policy - The name of the index lifecycle policy
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmGetLifecycle (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params.body != null) {
|
||||||
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, policy, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'GET'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
if ((policy) != null) {
|
||||||
|
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
|
||||||
|
} else {
|
||||||
|
path = '/' + '_ilm' + '/' + 'policy'
|
||||||
|
}
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: null,
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmGetLifecycle
|
||||||
95
api/api/ilm.get_status.js
Normal file
95
api/api/ilm.get_status.js
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmGetStatus (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.get_status](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html) request
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmGetStatus (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params.body != null) {
|
||||||
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'GET'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_ilm' + '/' + 'status'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: null,
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmGetStatus
|
||||||
91
api/api/ilm.move_to_step.js
Normal file
91
api/api/ilm.move_to_step.js
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmMoveToStep (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.move_to_step](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html) request
|
||||||
|
*
|
||||||
|
* @param {string} index - The name of the index whose lifecycle step is to change
|
||||||
|
* @param {object} body - The new lifecycle step to move to
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmMoveToStep (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_ilm' + '/' + 'move' + '/' + encodeURIComponent(index)
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmMoveToStep
|
||||||
91
api/api/ilm.put_lifecycle.js
Normal file
91
api/api/ilm.put_lifecycle.js
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmPutLifecycle (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.put_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html) request
|
||||||
|
*
|
||||||
|
* @param {string} policy - The name of the index lifecycle policy
|
||||||
|
* @param {object} body - The lifecycle policy definition to register
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmPutLifecycle (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, policy, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'PUT'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: body || '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmPutLifecycle
|
||||||
96
api/api/ilm.remove_policy.js
Normal file
96
api/api/ilm.remove_policy.js
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmRemovePolicy (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.remove_policy](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html) request
|
||||||
|
*
|
||||||
|
* @param {string} index - The name of the index to remove policy on
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmRemovePolicy (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params.body != null) {
|
||||||
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'remove'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmRemovePolicy
|
||||||
96
api/api/ilm.retry.js
Normal file
96
api/api/ilm.retry.js
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmRetry (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.retry](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html) request
|
||||||
|
*
|
||||||
|
* @param {string} index - The name of the indices (comma-separated) whose failed lifecycle step is to be retry
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmRetry (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params.body != null) {
|
||||||
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, index, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'retry'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmRetry
|
||||||
95
api/api/ilm.start.js
Normal file
95
api/api/ilm.start.js
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmStart (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.start](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html) request
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmStart (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params.body != null) {
|
||||||
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_ilm' + '/' + 'start'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmStart
|
||||||
95
api/api/ilm.stop.js
Normal file
95
api/api/ilm.stop.js
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint camelcase: 0 */
|
||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
function buildIlmStop (opts) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
/**
|
||||||
|
* Perform a [ilm.stop](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html) request
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
const acceptedQuerystring = [
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
const snakeCase = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return function ilmStop (params, options, callback) {
|
||||||
|
options = options || {}
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
if (typeof params === 'function' || params == null) {
|
||||||
|
callback = params
|
||||||
|
params = {}
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params.body != null) {
|
||||||
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate headers object
|
||||||
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
var warnings = []
|
||||||
|
var { method, body, ...querystring } = params
|
||||||
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
|
if (method == null) {
|
||||||
|
method = 'POST'
|
||||||
|
}
|
||||||
|
|
||||||
|
var ignore = options.ignore
|
||||||
|
if (typeof ignore === 'number') {
|
||||||
|
options.ignore = [ignore]
|
||||||
|
}
|
||||||
|
|
||||||
|
var path = ''
|
||||||
|
|
||||||
|
path = '/' + '_ilm' + '/' + 'stop'
|
||||||
|
|
||||||
|
// build request object
|
||||||
|
const request = {
|
||||||
|
method,
|
||||||
|
path,
|
||||||
|
body: '',
|
||||||
|
querystring
|
||||||
|
}
|
||||||
|
|
||||||
|
options.warnings = warnings.length === 0 ? null : warnings
|
||||||
|
return makeRequest(request, options, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = buildIlmStop
|
||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndex (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-index_.html) request
|
* Perform a [index](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - Document ID
|
* @param {string} id - Document ID
|
||||||
* @param {string} index - The name of the index
|
* @param {string} index - The name of the index
|
||||||
@ -22,10 +37,10 @@ function buildIndex (opts) {
|
|||||||
* @param {enum} refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
* @param {enum} refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
||||||
* @param {string} routing - Specific routing value
|
* @param {string} routing - Specific routing value
|
||||||
* @param {time} timeout - Explicit operation timeout
|
* @param {time} timeout - Explicit operation timeout
|
||||||
* @param {time} timestamp - Explicit timestamp for the document
|
|
||||||
* @param {time} ttl - Expiration time for the document
|
|
||||||
* @param {number} version - Explicit version number for concurrency control
|
* @param {number} version - Explicit version number for concurrency control
|
||||||
* @param {enum} version_type - Specific version type
|
* @param {enum} version_type - Specific version type
|
||||||
|
* @param {number} if_seq_no - only perform the index operation if the last operation that has changed the document has the specified sequence number
|
||||||
|
* @param {number} if_primary_term - only perform the index operation if the last operation that has changed the document has the specified primary term
|
||||||
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
|
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
|
||||||
* @param {object} body - The document
|
* @param {object} body - The document
|
||||||
*/
|
*/
|
||||||
@ -37,10 +52,10 @@ function buildIndex (opts) {
|
|||||||
'refresh',
|
'refresh',
|
||||||
'routing',
|
'routing',
|
||||||
'timeout',
|
'timeout',
|
||||||
'timestamp',
|
|
||||||
'ttl',
|
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
|
'if_seq_no',
|
||||||
|
'if_primary_term',
|
||||||
'pipeline',
|
'pipeline',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
@ -53,6 +68,8 @@ function buildIndex (opts) {
|
|||||||
waitForActiveShards: 'wait_for_active_shards',
|
waitForActiveShards: 'wait_for_active_shards',
|
||||||
opType: 'op_type',
|
opType: 'op_type',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
|
ifSeqNo: 'if_seq_no',
|
||||||
|
ifPrimaryTerm: 'if_primary_term',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,35 +26,15 @@ function buildIndicesAnalyze (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-analyze.html) request
|
* Perform a [indices.analyze](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html) request
|
||||||
*
|
*
|
||||||
* @param {string} index - The name of the index to scope the operation
|
* @param {string} index - The name of the index to scope the operation
|
||||||
* @param {string} analyzer - The name of the analyzer to use
|
|
||||||
* @param {list} char_filter - A comma-separated list of character filters to use for the analysis
|
|
||||||
* @param {string} field - Use the analyzer configured for this field (instead of passing the analyzer name)
|
|
||||||
* @param {list} filter - A comma-separated list of filters to use for the analysis
|
|
||||||
* @param {string} index - The name of the index to scope the operation
|
* @param {string} index - The name of the index to scope the operation
|
||||||
* @param {boolean} prefer_local - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true)
|
* @param {object} body - Define analyzer/tokenizer parameters and the text on which the analysis should be performed
|
||||||
* @param {list} text - The text on which the analysis should be performed (when request body is not used)
|
|
||||||
* @param {string} tokenizer - The name of the tokenizer to use for the analysis
|
|
||||||
* @param {boolean} explain - With `true`, outputs more advanced details. (default: false)
|
|
||||||
* @param {list} attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true`
|
|
||||||
* @param {enum} format - Format of the output
|
|
||||||
* @param {object} body - The text on which the analysis should be performed
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
'analyzer',
|
|
||||||
'char_filter',
|
|
||||||
'field',
|
|
||||||
'filter',
|
|
||||||
'index',
|
'index',
|
||||||
'prefer_local',
|
|
||||||
'text',
|
|
||||||
'tokenizer',
|
|
||||||
'explain',
|
|
||||||
'attributes',
|
|
||||||
'format',
|
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
'error_trace',
|
'error_trace',
|
||||||
@ -48,8 +43,6 @@ function buildIndicesAnalyze (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
charFilter: 'char_filter',
|
|
||||||
preferLocal: 'prefer_local',
|
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,18 +26,17 @@ function buildIndicesClearCache (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.clear_cache](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-clearcache.html) request
|
* Perform a [indices.clear_cache](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index name to limit the operation
|
* @param {list} index - A comma-separated list of index name to limit the operation
|
||||||
* @param {boolean} field_data - Clear field data
|
* @param {boolean} field_data - Clear field data. This is deprecated. Prefer `fielddata`.
|
||||||
* @param {boolean} fielddata - Clear field data
|
* @param {boolean} fielddata - Clear field data
|
||||||
* @param {list} fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all)
|
* @param {list} fields - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)
|
||||||
* @param {boolean} query - Clear query caches
|
* @param {boolean} query - Clear query caches
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||||
* @param {list} index - A comma-separated list of index name to limit the operation
|
* @param {list} index - A comma-separated list of index name to limit the operation
|
||||||
* @param {boolean} recycler - Clear the recycler cache
|
|
||||||
* @param {boolean} request_cache - Clear request cache
|
* @param {boolean} request_cache - Clear request cache
|
||||||
* @param {boolean} request - Clear request cache
|
* @param {boolean} request - Clear request cache
|
||||||
*/
|
*/
|
||||||
@ -36,7 +50,6 @@ function buildIndicesClearCache (opts) {
|
|||||||
'allow_no_indices',
|
'allow_no_indices',
|
||||||
'expand_wildcards',
|
'expand_wildcards',
|
||||||
'index',
|
'index',
|
||||||
'recycler',
|
|
||||||
'request_cache',
|
'request_cache',
|
||||||
'request',
|
'request',
|
||||||
'pretty',
|
'pretty',
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesClose (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-open-close.html) request
|
* Perform a [indices.close](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma separated list of indices to close
|
* @param {list} index - A comma separated list of indices to close
|
||||||
* @param {time} timeout - Explicit operation timeout
|
* @param {time} timeout - Explicit operation timeout
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,9 +26,10 @@ function buildIndicesCreate (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-create-index.html) request
|
* Perform a [indices.create](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html) request
|
||||||
*
|
*
|
||||||
* @param {string} index - The name of the index
|
* @param {string} index - The name of the index
|
||||||
|
* @param {boolean} include_type_name - Whether a type should be expected in the body of the mappings.
|
||||||
* @param {string} wait_for_active_shards - Set the number of active shards to wait for before the operation returns.
|
* @param {string} wait_for_active_shards - Set the number of active shards to wait for before the operation returns.
|
||||||
* @param {time} timeout - Explicit operation timeout
|
* @param {time} timeout - Explicit operation timeout
|
||||||
* @param {time} master_timeout - Specify timeout for connection to master
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
@ -22,6 +38,7 @@ function buildIndicesCreate (opts) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
|
'include_type_name',
|
||||||
'wait_for_active_shards',
|
'wait_for_active_shards',
|
||||||
'timeout',
|
'timeout',
|
||||||
'master_timeout',
|
'master_timeout',
|
||||||
@ -34,6 +51,7 @@ function buildIndicesCreate (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
|
includeTypeName: 'include_type_name',
|
||||||
waitForActiveShards: 'wait_for_active_shards',
|
waitForActiveShards: 'wait_for_active_shards',
|
||||||
masterTimeout: 'master_timeout',
|
masterTimeout: 'master_timeout',
|
||||||
updateAllTypes: 'update_all_types',
|
updateAllTypes: 'update_all_types',
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,16 +26,22 @@ function buildIndicesDelete (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-delete-index.html) request
|
* Perform a [indices.delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices
|
* @param {list} index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices
|
||||||
* @param {time} timeout - Explicit operation timeout
|
* @param {time} timeout - Explicit operation timeout
|
||||||
* @param {time} master_timeout - Specify timeout for connection to master
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
|
* @param {boolean} ignore_unavailable - Ignore unavailable indexes (default: false)
|
||||||
|
* @param {boolean} allow_no_indices - Ignore if a wildcard expression resolves to no concrete indices (default: false)
|
||||||
|
* @param {enum} expand_wildcards - Whether wildcard expressions should get expanded to open or closed indices (default: open)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
'timeout',
|
'timeout',
|
||||||
'master_timeout',
|
'master_timeout',
|
||||||
|
'ignore_unavailable',
|
||||||
|
'allow_no_indices',
|
||||||
|
'expand_wildcards',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
'error_trace',
|
'error_trace',
|
||||||
@ -30,6 +51,9 @@ function buildIndicesDelete (opts) {
|
|||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
masterTimeout: 'master_timeout',
|
masterTimeout: 'master_timeout',
|
||||||
|
ignoreUnavailable: 'ignore_unavailable',
|
||||||
|
allowNoIndices: 'allow_no_indices',
|
||||||
|
expandWildcards: 'expand_wildcards',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesDeleteAlias (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.delete_alias](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-aliases.html) request
|
* Perform a [indices.delete_alias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names (supports wildcards); use `_all` for all indices
|
* @param {list} index - A comma-separated list of index names (supports wildcards); use `_all` for all indices
|
||||||
* @param {list} name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.
|
* @param {list} name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesDeleteTemplate (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.delete_template](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-templates.html) request
|
* Perform a [indices.delete_template](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request
|
||||||
*
|
*
|
||||||
* @param {string} name - The name of the template
|
* @param {string} name - The name of the template
|
||||||
* @param {time} timeout - Explicit operation timeout
|
* @param {time} timeout - Explicit operation timeout
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesExists (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.exists](http://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-exists.html) request
|
* Perform a [indices.exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names
|
* @param {list} index - A comma-separated list of index names
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesExistsAlias (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.exists_alias](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-aliases.html) request
|
* Perform a [indices.exists_alias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to filter aliases
|
* @param {list} index - A comma-separated list of index names to filter aliases
|
||||||
* @param {list} name - A comma-separated list of alias names to return
|
* @param {list} name - A comma-separated list of alias names to return
|
||||||
@ -54,6 +69,10 @@ function buildIndicesExistsAlias (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check required parameters
|
// check required parameters
|
||||||
|
if (params['name'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: name')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
if (params.body != null) {
|
if (params.body != null) {
|
||||||
const err = new ConfigurationError('This API does not require a body')
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesExistsTemplate (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.exists_template](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-templates.html) request
|
* Perform a [indices.exists_template](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request
|
||||||
*
|
*
|
||||||
* @param {list} name - The comma separated names of the index templates
|
* @param {list} name - The comma separated names of the index templates
|
||||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesExistsType (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.exists_type](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-types-exists.html) request
|
* Perform a [indices.exists_type](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names; use `_all` to check the types across all indices
|
* @param {list} index - A comma-separated list of index names; use `_all` to check the types across all indices
|
||||||
* @param {list} type - A comma-separated list of document types to check
|
* @param {list} type - A comma-separated list of document types to check
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesFlush (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-flush.html) request
|
* Perform a [indices.flush](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string for all indices
|
* @param {list} index - A comma-separated list of index names; use `_all` or empty string for all indices
|
||||||
* @param {boolean} force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)
|
* @param {boolean} force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesFlushSynced (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.flush_synced](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-synced-flush.html) request
|
* Perform a [indices.flush_synced](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string for all indices
|
* @param {list} index - A comma-separated list of index names; use `_all` or empty string for all indices
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesForcemerge (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-forcemerge.html) request
|
* Perform a [indices.forcemerge](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {boolean} flush - Specify whether the index should be flushed after performing the operation (default: true)
|
* @param {boolean} flush - Specify whether the index should be flushed after performing the operation (default: true)
|
||||||
@ -20,8 +35,6 @@ function buildIndicesForcemerge (opts) {
|
|||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||||
* @param {number} max_num_segments - The number of segments the index should be merged into (default: dynamic)
|
* @param {number} max_num_segments - The number of segments the index should be merged into (default: dynamic)
|
||||||
* @param {boolean} only_expunge_deletes - Specify whether the operation should only expunge deleted documents
|
* @param {boolean} only_expunge_deletes - Specify whether the operation should only expunge deleted documents
|
||||||
* @param {undefined} operation_threading - TODO: ?
|
|
||||||
* @param {boolean} wait_for_merge - Specify whether the request should block until the merge process is finished (default: true)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
@ -31,8 +44,6 @@ function buildIndicesForcemerge (opts) {
|
|||||||
'expand_wildcards',
|
'expand_wildcards',
|
||||||
'max_num_segments',
|
'max_num_segments',
|
||||||
'only_expunge_deletes',
|
'only_expunge_deletes',
|
||||||
'operation_threading',
|
|
||||||
'wait_for_merge',
|
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
'error_trace',
|
'error_trace',
|
||||||
@ -46,8 +57,6 @@ function buildIndicesForcemerge (opts) {
|
|||||||
expandWildcards: 'expand_wildcards',
|
expandWildcards: 'expand_wildcards',
|
||||||
maxNumSegments: 'max_num_segments',
|
maxNumSegments: 'max_num_segments',
|
||||||
onlyExpungeDeletes: 'only_expunge_deletes',
|
onlyExpungeDeletes: 'only_expunge_deletes',
|
||||||
operationThreading: 'operation_threading',
|
|
||||||
waitForMerge: 'wait_for_merge',
|
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,46 +1,60 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildMpercolate (opts) {
|
function buildIndicesFreeze (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-percolate.html) request
|
* Perform a [indices.freeze](https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html) request
|
||||||
*
|
*
|
||||||
* @param {string} index - The index of the document being count percolated to use as default
|
* @param {string} index - The name of the index to freeze
|
||||||
* @param {string} type - The type of the document being percolated to use as default.
|
* @param {time} timeout - Explicit operation timeout
|
||||||
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||||
* @param {object} body - The percolate request definitions (header & body pair), separated by newlines
|
* @param {string} wait_for_active_shards - Sets the number of active shards to wait for before the operation returns.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
|
'timeout',
|
||||||
|
'master_timeout',
|
||||||
'ignore_unavailable',
|
'ignore_unavailable',
|
||||||
'allow_no_indices',
|
'allow_no_indices',
|
||||||
'expand_wildcards',
|
'expand_wildcards',
|
||||||
'pretty',
|
'wait_for_active_shards'
|
||||||
'human',
|
|
||||||
'error_trace',
|
|
||||||
'source',
|
|
||||||
'filter_path'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
|
masterTimeout: 'master_timeout',
|
||||||
ignoreUnavailable: 'ignore_unavailable',
|
ignoreUnavailable: 'ignore_unavailable',
|
||||||
allowNoIndices: 'allow_no_indices',
|
allowNoIndices: 'allow_no_indices',
|
||||||
expandWildcards: 'expand_wildcards',
|
expandWildcards: 'expand_wildcards',
|
||||||
errorTrace: 'error_trace',
|
waitForActiveShards: 'wait_for_active_shards'
|
||||||
filterPath: 'filter_path'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function mpercolate (params, options, callback) {
|
return function indicesFreeze (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -53,14 +67,12 @@ function buildMpercolate (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check required parameters
|
// check required parameters
|
||||||
if (params['body'] == null) {
|
if (params['index'] == null) {
|
||||||
const err = new ConfigurationError('Missing required parameter: body')
|
const err = new ConfigurationError('Missing required parameter: index')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
if (params.body != null) {
|
||||||
// check required url components
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
if (params['type'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,11 +83,11 @@ function buildMpercolate (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, type, ...querystring } = params
|
var { method, body, index, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
method = body == null ? 'GET' : 'POST'
|
method = 'POST'
|
||||||
}
|
}
|
||||||
|
|
||||||
var ignore = options.ignore
|
var ignore = options.ignore
|
||||||
@ -85,19 +97,13 @@ function buildMpercolate (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((index) != null && (type) != null) {
|
path = '/' + encodeURIComponent(index) + '/' + '_freeze'
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mpercolate'
|
|
||||||
} else if ((index) != null) {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + '_mpercolate'
|
|
||||||
} else {
|
|
||||||
path = '/' + '_mpercolate'
|
|
||||||
}
|
|
||||||
|
|
||||||
// build request object
|
// build request object
|
||||||
const request = {
|
const request = {
|
||||||
method,
|
method,
|
||||||
path,
|
path,
|
||||||
body: body || '',
|
body: '',
|
||||||
querystring
|
querystring
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,4 +112,4 @@ function buildMpercolate (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildMpercolate
|
module.exports = buildIndicesFreeze
|
||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,25 +26,28 @@ function buildIndicesGet (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-get-index.html) request
|
* Perform a [indices.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names
|
* @param {list} index - A comma-separated list of index names
|
||||||
* @param {list} feature - A comma-separated list of features
|
* @param {boolean} include_type_name - Whether to add the type name to the response (default: true)
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
* @param {boolean} ignore_unavailable - Ignore unavailable indexes (default: false)
|
* @param {boolean} ignore_unavailable - Ignore unavailable indexes (default: false)
|
||||||
* @param {boolean} allow_no_indices - Ignore if a wildcard expression resolves to no concrete indices (default: false)
|
* @param {boolean} allow_no_indices - Ignore if a wildcard expression resolves to no concrete indices (default: false)
|
||||||
* @param {enum} expand_wildcards - Whether wildcard expressions should get expanded to open or closed indices (default: open)
|
* @param {enum} expand_wildcards - Whether wildcard expressions should get expanded to open or closed indices (default: open)
|
||||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||||
* @param {boolean} include_defaults - Whether to return all default setting for each of the indices.
|
* @param {boolean} include_defaults - Whether to return all default setting for each of the indices.
|
||||||
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
|
'include_type_name',
|
||||||
'local',
|
'local',
|
||||||
'ignore_unavailable',
|
'ignore_unavailable',
|
||||||
'allow_no_indices',
|
'allow_no_indices',
|
||||||
'expand_wildcards',
|
'expand_wildcards',
|
||||||
'flat_settings',
|
'flat_settings',
|
||||||
'include_defaults',
|
'include_defaults',
|
||||||
|
'master_timeout',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
'error_trace',
|
'error_trace',
|
||||||
@ -38,11 +56,13 @@ function buildIndicesGet (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
|
includeTypeName: 'include_type_name',
|
||||||
ignoreUnavailable: 'ignore_unavailable',
|
ignoreUnavailable: 'ignore_unavailable',
|
||||||
allowNoIndices: 'allow_no_indices',
|
allowNoIndices: 'allow_no_indices',
|
||||||
expandWildcards: 'expand_wildcards',
|
expandWildcards: 'expand_wildcards',
|
||||||
flatSettings: 'flat_settings',
|
flatSettings: 'flat_settings',
|
||||||
includeDefaults: 'include_defaults',
|
includeDefaults: 'include_defaults',
|
||||||
|
masterTimeout: 'master_timeout',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
@ -69,12 +89,6 @@ function buildIndicesGet (opts) {
|
|||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['feature'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -82,7 +96,7 @@ function buildIndicesGet (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, feature, ...querystring } = params
|
var { method, body, index, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -96,11 +110,7 @@ function buildIndicesGet (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((index) != null && (feature) != null) {
|
path = '/' + encodeURIComponent(index)
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(feature)
|
|
||||||
} else {
|
|
||||||
path = '/' + encodeURIComponent(index)
|
|
||||||
}
|
|
||||||
|
|
||||||
// build request object
|
// build request object
|
||||||
const request = {
|
const request = {
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesGetAlias (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.get_alias](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-aliases.html) request
|
* Perform a [indices.get_alias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to filter aliases
|
* @param {list} index - A comma-separated list of index names to filter aliases
|
||||||
* @param {list} name - A comma-separated list of alias names to return
|
* @param {list} name - A comma-separated list of alias names to return
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,11 +26,12 @@ function buildIndicesGetFieldMapping (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.get_field_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-get-field-mapping.html) request
|
* Perform a [indices.get_field_mapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names
|
* @param {list} index - A comma-separated list of index names
|
||||||
* @param {list} type - A comma-separated list of document types
|
* @param {list} type - A comma-separated list of document types
|
||||||
* @param {list} fields - A comma-separated list of fields
|
* @param {list} fields - A comma-separated list of fields
|
||||||
|
* @param {boolean} include_type_name - Whether a type should be returned in the body of the mappings.
|
||||||
* @param {boolean} include_defaults - Whether the default mapping values should be returned as well
|
* @param {boolean} include_defaults - Whether the default mapping values should be returned as well
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||||
@ -24,6 +40,7 @@ function buildIndicesGetFieldMapping (opts) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
|
'include_type_name',
|
||||||
'include_defaults',
|
'include_defaults',
|
||||||
'ignore_unavailable',
|
'ignore_unavailable',
|
||||||
'allow_no_indices',
|
'allow_no_indices',
|
||||||
@ -37,6 +54,7 @@ function buildIndicesGetFieldMapping (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
|
includeTypeName: 'include_type_name',
|
||||||
includeDefaults: 'include_defaults',
|
includeDefaults: 'include_defaults',
|
||||||
ignoreUnavailable: 'ignore_unavailable',
|
ignoreUnavailable: 'ignore_unavailable',
|
||||||
allowNoIndices: 'allow_no_indices',
|
allowNoIndices: 'allow_no_indices',
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,20 +26,24 @@ function buildIndicesGetMapping (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.get_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-get-mapping.html) request
|
* Perform a [indices.get_mapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names
|
* @param {list} index - A comma-separated list of index names
|
||||||
* @param {list} type - A comma-separated list of document types
|
* @param {list} type - A comma-separated list of document types
|
||||||
|
* @param {boolean} include_type_name - Whether to add the type name to the response.
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||||
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
|
'include_type_name',
|
||||||
'ignore_unavailable',
|
'ignore_unavailable',
|
||||||
'allow_no_indices',
|
'allow_no_indices',
|
||||||
'expand_wildcards',
|
'expand_wildcards',
|
||||||
|
'master_timeout',
|
||||||
'local',
|
'local',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
@ -34,9 +53,11 @@ function buildIndicesGetMapping (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
|
includeTypeName: 'include_type_name',
|
||||||
ignoreUnavailable: 'ignore_unavailable',
|
ignoreUnavailable: 'ignore_unavailable',
|
||||||
allowNoIndices: 'allow_no_indices',
|
allowNoIndices: 'allow_no_indices',
|
||||||
expandWildcards: 'expand_wildcards',
|
expandWildcards: 'expand_wildcards',
|
||||||
|
masterTimeout: 'master_timeout',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,10 +26,11 @@ function buildIndicesGetSettings (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.get_settings](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-get-settings.html) request
|
* Perform a [indices.get_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {list} name - The name of the settings that should be included
|
* @param {list} name - The name of the settings that should be included
|
||||||
|
* @param {time} master_timeout - Specify timeout for connection to master
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
||||||
@ -24,6 +40,7 @@ function buildIndicesGetSettings (opts) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
|
'master_timeout',
|
||||||
'ignore_unavailable',
|
'ignore_unavailable',
|
||||||
'allow_no_indices',
|
'allow_no_indices',
|
||||||
'expand_wildcards',
|
'expand_wildcards',
|
||||||
@ -38,6 +55,7 @@ function buildIndicesGetSettings (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
|
masterTimeout: 'master_timeout',
|
||||||
ignoreUnavailable: 'ignore_unavailable',
|
ignoreUnavailable: 'ignore_unavailable',
|
||||||
allowNoIndices: 'allow_no_indices',
|
allowNoIndices: 'allow_no_indices',
|
||||||
expandWildcards: 'expand_wildcards',
|
expandWildcards: 'expand_wildcards',
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,15 +26,17 @@ function buildIndicesGetTemplate (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.get_template](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-templates.html) request
|
* Perform a [indices.get_template](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request
|
||||||
*
|
*
|
||||||
* @param {list} name - The comma separated names of the index templates
|
* @param {list} name - The comma separated names of the index templates
|
||||||
|
* @param {boolean} include_type_name - Whether a type should be returned in the body of the mappings.
|
||||||
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
* @param {boolean} flat_settings - Return settings in flat format (default: false)
|
||||||
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
* @param {time} master_timeout - Explicit operation timeout for connection to master node
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
|
'include_type_name',
|
||||||
'flat_settings',
|
'flat_settings',
|
||||||
'master_timeout',
|
'master_timeout',
|
||||||
'local',
|
'local',
|
||||||
@ -31,6 +48,7 @@ function buildIndicesGetTemplate (opts) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
|
includeTypeName: 'include_type_name',
|
||||||
flatSettings: 'flat_settings',
|
flatSettings: 'flat_settings',
|
||||||
masterTimeout: 'master_timeout',
|
masterTimeout: 'master_timeout',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
|
|||||||
@ -1,6 +1,21 @@
|
|||||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
/*
|
||||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
// See the LICENSE file in the project root for more information
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -11,7 +26,7 @@ function buildIndicesGetUpgrade (opts) {
|
|||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [indices.get_upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-upgrade.html) request
|
* Perform a [indices.get_upgrade](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user