diff --git a/.ci/.dockerignore b/.ci/.dockerignore
new file mode 100644
index 000000000..93f136199
--- /dev/null
+++ b/.ci/.dockerignore
@@ -0,0 +1,2 @@
+node_modules
+npm-debug.log
diff --git a/.ci/Dockerfile b/.ci/Dockerfile
new file mode 100644
index 000000000..695addb3d
--- /dev/null
+++ b/.ci/Dockerfile
@@ -0,0 +1,13 @@
+ARG NODE_JS_VERSION=10
+FROM node:${NODE_JS_VERSION}
+
+# Create app directory
+WORKDIR /usr/src/app
+
+# Install app dependencies
+COPY package*.json ./
+RUN npm install
+
+COPY . .
+
+CMD [ "npm", "run", "ci" ]
diff --git a/.ci/certs/ca.crt b/.ci/certs/ca.crt
new file mode 100755
index 000000000..6402874d5
--- /dev/null
+++ b/.ci/certs/ca.crt
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDSTCCAjGgAwIBAgIUIwN+0zglsexRKwE1RGHvlCcmrdwwDQYJKoZIhvcNAQEL
+BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l
+cmF0ZWQgQ0EwHhcNMTkwMjEzMDcyMjQwWhcNMjIwMjEyMDcyMjQwWjA0MTIwMAYD
+VQQDEylFbGFzdGljIENlcnRpZmljYXRlIFRvb2wgQXV0b2dlbmVyYXRlZCBDQTCC
+ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANILs0JO0e7x29zeVx21qalK
+XKdX+AMlGJPH75wWO/Jq6YHtxt1wYIg762krOBXfG6JsFSOIwIv5VrzGGRGjSPt9
+OXQyXrDDiQvsBT3rpzLNdDs7KMl2tZswwv7w9ujgud0cYnS1MOpn81rfPc73DvMg
+xuhplofDx6fn3++PjVRU2FNiIVWyEoaxRjCeGPMBubKZYaYbQA6vYM4Z+ByG727B
+AyAER3t7xmvYti/EoO2hv2HQk5zgcj/Oq3AJKhnt8LH8fnfm3TnYNM1htvXqhN05
+vsvhvm2PHfnA5qLlSr/3W0aI/U/PqfsFDCgyRV097sMIaKkmavb0Ue7aQ7lgtp0C
+AwEAAaNTMFEwHQYDVR0OBBYEFDRKlCMowWR1rwxE0d1lTEQe5O71MB8GA1UdIwQY
+MBaAFDRKlCMowWR1rwxE0d1lTEQe5O71MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI
+hvcNAQELBQADggEBAKbCJ95EBpeuvF70KEt6QU70k/SH1NRvM9YzKryV0D975Jvu
+HOSm9HgSTULeAUFZIa4oYyf3QUfVoI+2T/aQrfXA3gfrJWsHURkyNmiHOFAbYHqi
+xA6i249G2GTEjc1+le/M2N2CcDKAmurW6vSGK4upXQbPd6KmnhHREX74zkWjnOa+
++tibbSSOCT4Tmja2DbBxAPuivU9IB1g/hIUmbYQqKffQrBJA0658tz6w63a/Q7xN
+pCvvbSgiMZ6qcVIcJkBT2IooYie+ax45pQECHthgIUcQAzfmIfqlU0Qfl8rDgAmn
+0c1o6HQjKGU2aVGgSRuaaiHaSZjbPIZVS51sOoI=
+-----END CERTIFICATE-----
diff --git a/.ci/certs/testnode.crt b/.ci/certs/testnode.crt
new file mode 100755
index 000000000..ff3bcb37f
--- /dev/null
+++ b/.ci/certs/testnode.crt
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDIjCCAgqgAwIBAgIUI4QU6jA1dYSCbdIA6oAb2TBEluowDQYJKoZIhvcNAQEL
+BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l
+cmF0ZWQgQ0EwHhcNMTkwMjEzMDcyMzEzWhcNMjIwMjEyMDcyMzEzWjATMREwDwYD
+VQQDEwhpbnN0YW5jZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJeT
+yOy6EAScZxrULKjHePciiz38grivCrhFFV+dThaRCcl3DhDzb9Eny5q5iEw3WvLQ
+Rqmf01jncNIhaocTt66VqveXaMubbE8O0LcG6e4kpFO+JtnVF8JTARTc+ux/1uD6
+hO1VG/HItM7WQrQxh4hfB2u1AX2YQtoqEtXXEC+UHWfl4QzuzXjBnKCkO/L9/6Tf
+yNFQWXxKnIiTs8Xm9sEhhSCBJPlLTQu+MX4vR2Uwj5XZmflDUr+ZTenl9qYxL6b3
+SWhh/qEl4GAj1+tS7ZZOxE0237mUh3IIFYSWSaMm8K2m/BYHkLNWL5B1dMic0lsv
+osSoYrQuCef4HQMCitsCAwEAAaNNMEswHQYDVR0OBBYEFFMg4l1GLW8lYbwASY+r
+YeWYRzIiMB8GA1UdIwQYMBaAFDRKlCMowWR1rwxE0d1lTEQe5O71MAkGA1UdEwQC
+MAAwDQYJKoZIhvcNAQELBQADggEBAEQrgh1xALpumQTzsjxFRGque/vlKTgRs5Kh
+xtgapr6wjIbdq7dagee+4yNOKzS5lGVXCgwrJlHESv9qY0uumT/33vK2uduJ7NAd
+fR2ZzyBnhMX+mkYhmGrGYCTUMUIwOIQYa4Evis4W+LHmCIDG03l7gLHfdIBe9VMO
+pDZum8f6ng0MM49s8/rXODNYKw8kFyUhnfChqMi/2yggb1uUIfKlJJIchkgYjE13
+zuC+fjo029Pq1jeMIdxugLf/7I/8NiW1Yj9aCXevUXG1qzHFEuKAinBXYOZO/vWS
+LaEqOhwrzNynwgGpYAr7Rfgv4AflltYIIav4PZT03P7fbyAAf8s=
+-----END CERTIFICATE-----
diff --git a/.ci/certs/testnode.key b/.ci/certs/testnode.key
new file mode 100755
index 000000000..c35b4bc83
--- /dev/null
+++ b/.ci/certs/testnode.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAl5PI7LoQBJxnGtQsqMd49yKLPfyCuK8KuEUVX51OFpEJyXcO
+EPNv0SfLmrmITDda8tBGqZ/TWOdw0iFqhxO3rpWq95doy5tsTw7Qtwbp7iSkU74m
+2dUXwlMBFNz67H/W4PqE7VUb8ci0ztZCtDGHiF8Ha7UBfZhC2ioS1dcQL5QdZ+Xh
+DO7NeMGcoKQ78v3/pN/I0VBZfEqciJOzxeb2wSGFIIEk+UtNC74xfi9HZTCPldmZ
++UNSv5lN6eX2pjEvpvdJaGH+oSXgYCPX61Ltlk7ETTbfuZSHcggVhJZJoybwrab8
+FgeQs1YvkHV0yJzSWy+ixKhitC4J5/gdAwKK2wIDAQABAoIBAQCRFTJna/xy/WUu
+59FLR4qAOj8++JgCwACpue4oU7/vl6nffSYokWoAr2+RzG4qTX2vFi3cpA8+dGCn
+sLZvTi8tWzKGxBTZdg2oakzaMzLr74SeZ052iCGyrZJGbvF6Ny7srr1XEXSq6+os
+ZCb6pMHOhO7saBdiKMAsY8MdjTl/33AduuE6ztqv+L92xTr2g4QlbT1KvWlEgppU
+k4Gy7zdETkPBTSH/17ZwyGJoJICIAhbL4IpmOM4dPIg8nFkVPPpy6p0z4uGjtgnK
+nreZ2EKMzCafBaHn7A77gpi0OrQdl6pe0fsGqv/323YjCJPbwwl5TsoNq44DzwiX
+3M7XiVJxAoGBAOCne56vdN4uZmCgLVGT2JSUNVPOu4bfjrxWH6cslzrPT2Zhp3lO
+M4axZ3gmcervV252YEZXntXDHHCSfrECllRN1WFD63XmyQ/CkhuvZkkeRHfzL1TE
+EdqHOTqs4sRETZ7+RITFC81DZQkWWOKeyXMjyPBqd7RnThQHijB1c8Y5AoGBAKy6
+CVKBx+zz5crVD0tz4UhOmz1wRNN0CL0l+FXRuFSgbzMIvwpfiqe25crgeLHe2M2/
+TogdWbjZ2nUZQTzoRsSkQ6cKHpj+G/gWurp/UcHHXFVwgLSPF7c3KHDtiYq7Vqw0
+bvmhM03LI6+ZIPRV7hLBr7WP7UmpAiREMF7tTnmzAoGBAIkx3w3WywFQxtblmyeB
+qbd7F2IaE23XoxyjX+tBEQ4qQqwcoSE0v8TXHIBEwjceeX+NLVhn9ClJYVniLRq+
+oL3VVqVyzB4RleJZCc98e3PV1yyFx/b1Uo3pHOsXX9lKeTjKwV9v0rhFGzPEgP3M
+yOvXA8TG0FnM6OLUg/D6GX0JAoGAMuHS4TVOGeV3ahr9mHKYiN5vKNgrzka+VEod
+L9rJ/FQOrfADpyCiDen5I5ygsXU+VM3oanyK88NpcVlxOGoMft0M+OYoQVWKE7lO
+ZKYhBX6fGqQ7pfUJPXXIOgwfmni5fZ0sm+j63g3bg10OsiumKGxaQJgXhL1+3gQg
+Y7ZwibUCgYEAlZoFFvkMLjpOSaHk1z5ZZnt19X0QUIultBwkumSqMPm+Ks7+uDrx
+thGUCoz4ecr/ci4bIUY7mB+zfAbqnBOMxreJqCRbAIuRypo1IlWkTp8DywoDOfMW
+NfzjVmzJ7EJu44nGmVAi1jw4Pbseivvi1ujMCoPgaE8I1uSh144bwN8=
+-----END RSA PRIVATE KEY-----
diff --git a/.ci/docker-compose.yml b/.ci/docker-compose.yml
new file mode 100644
index 000000000..ba8b0538e
--- /dev/null
+++ b/.ci/docker-compose.yml
@@ -0,0 +1,92 @@
+version: '3.2'
+services:
+ client-oss:
+ 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=http://elasticsearch-oss: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-oss
+ depends_on:
+ - elasticsearch-oss
+
+ elasticsearch-oss:
+ image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
+ - elasticsearch
+ volumes:
+ - esvol:/tmp
+ networks:
+ - esnet-oss
+ environment:
+ - path.repo=/tmp
+ - "repositories.url.allowed_urls=http://snapshot.*"
+ - node.attr.testattr=test
+ - bootstrap.memory_lock=false
+ - "discovery.type=single-node"
+ - "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
+
+ elasticsearch-platinum:
+ image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
+ 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:
+ # we need two networks otherwise the two ES instances will join each other
+ esnet-oss:
+ esnet-platinum:
+volumes:
+ esvol:
diff --git a/.ci/jobs/defaults.yml b/.ci/jobs/defaults.yml
new file mode 100644
index 000000000..3df606402
--- /dev/null
+++ b/.ci/jobs/defaults.yml
@@ -0,0 +1,64 @@
+---
+
+##### GLOBAL METADATA
+
+- meta:
+ cluster: clients-ci
+
+##### JOB DEFAULTS
+
+- job:
+ project-type: matrix
+ logrotate:
+ daysToKeep: 30
+ numToKeep: 100
+ properties:
+ - github:
+ url: https://github.com/elastic/elasticsearch-js/
+ - inject:
+ properties-content: HOME=$JENKINS_HOME
+ concurrent: true
+ node: flyweight
+ scm:
+ - git:
+ name: origin
+ credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
+ reference-repo: /var/lib/jenkins/.git-references/elasticsearch-js.git
+ branches:
+ - ${branch_specifier}
+ url: https://github.com/elastic/elasticsearch-js.git
+ wipe-workspace: 'True'
+ triggers:
+ - github
+ axes:
+ - axis:
+ type: slave
+ name: label
+ values:
+ - linux
+ - axis:
+ type: yaml
+ filename: .ci/test-matrix.yml
+ name: ELASTICSEARCH_VERSION
+ - axis:
+ type: yaml
+ filename: .ci/test-matrix.yml
+ name: NODE_JS_VERSION
+ yaml-strategy:
+ exclude-key: exclude
+ filename: .ci/test-matrix.yml
+ wrappers:
+ - ansicolor
+ - timeout:
+ type: absolute
+ timeout: 120
+ fail: true
+ - timestamps
+ - workspace-cleanup
+ builders:
+ - shell: |-
+ #!/usr/local/bin/runbld
+ .ci/run-tests
+ publishers:
+ - email:
+ recipients: infra-root+build@elastic.co
diff --git a/.ci/jobs/elastic+elasticsearch-js+master.yml b/.ci/jobs/elastic+elasticsearch-js+master.yml
new file mode 100644
index 000000000..284d30f55
--- /dev/null
+++ b/.ci/jobs/elastic+elasticsearch-js+master.yml
@@ -0,0 +1,14 @@
+---
+- job:
+ name: elastic+elasticsearch-js+master
+ display-name: 'elastic / elasticsearch-js # master'
+ description: Testing the elasticsearch-js master branch.
+ parameters:
+ - string:
+ name: branch_specifier
+ default: refs/heads/master
+ description: the Git branch specifier to build (<branchName>, <tagName>,
+ <commitId>, etc.)
+ triggers:
+ - github
+ - timed: '@daily'
diff --git a/.ci/jobs/elastic+elasticsearch-js+next.yml b/.ci/jobs/elastic+elasticsearch-js+next.yml
new file mode 100644
index 000000000..333102322
--- /dev/null
+++ b/.ci/jobs/elastic+elasticsearch-js+next.yml
@@ -0,0 +1,11 @@
+---
+- job:
+ name: elastic+elasticsearch-js+next
+ display-name: 'elastic / elasticsearch-js # next'
+ description: Testing the elasticsearch-js next branch.
+ parameters:
+ - string:
+ name: branch_specifier
+ default: refs/heads/next
+ description: the Git branch specifier to build (<branchName>, <tagName>,
+ <commitId>, etc.)
diff --git a/.ci/jobs/elastic+elasticsearch-js+pull-request.yml b/.ci/jobs/elastic+elasticsearch-js+pull-request.yml
new file mode 100644
index 000000000..78cde9ecc
--- /dev/null
+++ b/.ci/jobs/elastic+elasticsearch-js+pull-request.yml
@@ -0,0 +1,19 @@
+---
+- job:
+ name: elastic+elasticsearch-js+pull-request
+ display-name: 'elastic / elasticsearch-js # pull-request'
+ description: Testing of elasticsearch-js pull requests.
+ scm:
+ - git:
+ branches:
+ - ${ghprbActualCommit}
+ refspec: +refs/pull/*:refs/remotes/origin/pr/*
+ triggers:
+ - github-pull-request:
+ org-list:
+ - elastic
+ allow-whitelist-orgs-as-admins: true
+ github-hooks: true
+ status-context: clients-ci
+ cancel-builds-on-update: true
+ publishers: []
diff --git a/.ci/run-tests b/.ci/run-tests
new file mode 100755
index 000000000..cccda74c3
--- /dev/null
+++ b/.ci/run-tests
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+#
+# Runs the client tests via Docker with the expectation that the required
+# environment variables have already been exported before running this script.
+#
+# The required environment variables include:
+#
+# - $ELASTICSEARCH_VERSION
+# - $NODE_JS_VERSION
+#
+
+ELASTICSEARCH_VERSION=${ELASTICSEARCH_VERSION} NODE_JS_VERSION=${NODE_JS_VERSION} docker-compose -f .ci/docker-compose.yml run client-oss
+
+ELASTICSEARCH_VERSION=${ELASTICSEARCH_VERSION} NODE_JS_VERSION=${NODE_JS_VERSION} docker-compose -f .ci/docker-compose.yml run client-platinum
diff --git a/.ci/test-matrix.yml b/.ci/test-matrix.yml
new file mode 100644
index 000000000..a23cedf9e
--- /dev/null
+++ b/.ci/test-matrix.yml
@@ -0,0 +1,10 @@
+---
+ELASTICSEARCH_VERSION:
+- 7.0.0-beta1
+
+NODE_JS_VERSION:
+- 10
+- 8
+- 6
+
+exclude: ~
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..37e981426
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,54 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+
+# Runtime data
+pids
+*.pid
+*.seed
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (http://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules
+jspm_packages
+
+# Optional npm cache directory
+.npm
+
+# Optional REPL history
+.node_repl_history
+
+# mac files
+.DS_Store
+
+# vim swap files
+*.swp
+
+package-lock.json
+
+# elasticsearch repo or binary files
+elasticsearch*
+
+# Generated typings, we don't commit them
+# because we should copy them in the main .d.ts file
+api/generated.d.ts
+
+test/benchmarks/macro/fixtures/*
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 000000000..dfe6586dc
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,66 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+
+# Runtime data
+pids
+*.pid
+*.seed
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (http://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules
+jspm_packages
+
+# Optional npm cache directory
+.npm
+
+# Optional REPL history
+.node_repl_history
+
+# mac files
+.DS_Store
+
+# vim swap files
+*.swp
+
+package-lock.json
+
+# elasticsearch repo or binary files
+elasticsearch*
+
+# Generated typings, we don't commit them
+# because we should copy them in the main .d.ts file
+api/generated.d.ts
+
+# Ignore doc folder
+docs
+
+# Ignore test folder
+test
+
+# Ignore scripts folder
+scripts
+
+# ci configuration
+.ci
+.travis.yml
+certs
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..3eb76648b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,31 @@
+dist: trusty
+
+sudo: required
+
+language: node_js
+
+node_js:
+ - "10"
+ - "8"
+ - "6"
+
+env:
+ global:
+ - ELASTICSEARCH_VERSION=7.0.0-beta1
+ - QUIET=true
+
+before_install:
+ - wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}-linux-x86_64.tar.gz
+ - tar -xzf elasticsearch-${ELASTICSEARCH_VERSION}-linux-x86_64.tar.gz
+ - ./elasticsearch-${ELASTICSEARCH_VERSION}/bin/elasticsearch -Enode.attr.testattr=test -Epath.repo=/tmp -Erepositories.url.allowed_urls='http://snapshot.*' &> /dev/null &
+
+install:
+ - npm install
+
+script:
+ - npm run ci
+
+notifications:
+ email:
+ on_success: never
+ on_failure: always
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
diff --git a/README.md b/README.md
new file mode 100644
index 000000000..bea340fb2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,125 @@
+
+
+# @elastic/elasticsearch
+
+[](http://standardjs.com/) [](https://clients-ci.elastic.co/job/elastic+elasticsearch-js+master/) [](https://www.npmjs.com/package/@elastic/elasticsearch)
+
+The official Node.js client for Elasticsearch.
+
+## Features
+- One-to-one mapping with REST API.
+- Generalized, pluggable architecture.
+- Configurable, automatic discovery of cluster nodes.
+- Persistent, Keep-Alive connections.
+- Load balancing (with pluggable selection strategy) across all available nodes.
+- TypeScript support out of the box.
+
+## Install
+```
+npm install @elastic/elasticsearch
+```
+By default the latest version of the module will be installed, which is the same version of the current release of Elasticsearch.
+If you need to work with older versions of Elasticsearch, you should install the same version of the client as well.
+For example, if you are using Elasticsearch `v6.5.4`, you will need the client `v6`, and you can easily do that with `npm install @elastic/elasticsearch@6`.
+
+## Usage
+```js
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+// promise API
+const result = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+})
+
+// callback API
+client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, (err, result) => {
+ if (err) console.log(err)
+})
+```
+The returned value of **every** API call is formed as follows:
+```ts
+{
+ body: object | boolean
+ statusCode: number
+ headers: object
+ warnings: [string]
+}
+```
+### Client options
+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.
+```ts
+{
+ // the Elasticsearch endpoint to use
+ node: string | string[];
+ // alias of above
+ nodes: string | string[];
+ // custom connection class
+ Connection: typeof Connection;
+ // custom connection pool class
+ ConnectionPool: typeof ConnectionPool;
+ // custom transport class
+ Transport: typeof Transport;
+ // custom serializer class
+ Serializer: typeof Serializer;
+ // max number of retries for each request
+ maxRetries: number;
+ // max request timeout for each request
+ requestTimeout: number;
+ // max ping timeout for each request
+ pingTimeout: number;
+ // perform a sniff operation every `n` milliseconds
+ sniffInterval: number;
+ // perform a sniff once the client is started
+ sniffOnStart: boolean;
+ // custom sniff endpoint, defaults `_nodes/_all/http`
+ sniffEndpoint: string;
+ // perform a sniff on connection fault
+ sniffOnConnectionFault: boolean;
+ // configurethe node resurrection strategy, default `ping`
+ resurrectStrategy: 'ping' | 'optimistic' | 'none';
+ // adds `accept-encoding` header to every request
+ suggestCompression: boolean;
+ // enable gzip request body compression
+ compression: 'gzip';
+ // ssl configuraton
+ ssl: http.SecureContextOptions;
+ // http agent options
+ agent: http.AgentOptions;
+ // filters which node not to use for a request
+ nodeFilter: nodeFilterFn;
+ // custom selection strategy, defaults `round-robin`
+ nodeSelector: nodeSelectorFn | string;
+}
+```
+
+### Request specific options
+If needed you can pass request specific options in a second object:
+```js
+// promise API
+const result = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, {
+ ignore: [404],
+ maxRetries: 3
+})
+```
+The supported *request specific options* are:
+```ts
+{
+ ignore: [number], // default `null`
+ requestTimeout: number, // client default
+ maxRetries: number, // default `5`
+ asStream: boolean, // default `false`
+ headers: object // default `null`
+}
+```
+
+## License
+
+This software is licensed under the [Apache 2 license](./LICENSE).
diff --git a/api/api/bulk.js b/api/api/bulk.js
new file mode 100644
index 000000000..957f215e0
--- /dev/null
+++ b/api/api/bulk.js
@@ -0,0 +1,167 @@
+/*
+ * 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 buildBulk (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} type - Default document type for items which don't provide one
+ * @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the bulk 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 {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 {time} timeout - Explicit operation timeout
+ * @param {string} type - Default document type for items which don't provide one
+ * @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_excludes - Default list of fields to exclude from the returned _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 {object} body - The operation definition and data (action-data pairs), separated by newlines
+ */
+
+ const acceptedQuerystring = [
+ 'wait_for_active_shards',
+ 'refresh',
+ 'routing',
+ 'timeout',
+ 'type',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'pipeline',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ waitForActiveShards: 'wait_for_active_shards',
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function bulk (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_bulk'
+ } else {
+ path = '/' + '_bulk'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ bulkBody: body,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildBulk
diff --git a/api/api/cat.aliases.js b/api/api/cat.aliases.js
new file mode 100644
index 000000000..8627157db
--- /dev/null
+++ b/api/api/cat.aliases.js
@@ -0,0 +1,149 @@
+/*
+ * 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 buildCatAliases (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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 {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catAliases (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((name) != null) {
+ path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
+ } else {
+ path = '/' + '_cat' + '/' + 'aliases'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatAliases
diff --git a/api/api/cat.allocation.js b/api/api/cat.allocation.js
new file mode 100644
index 000000000..767854188
--- /dev/null
+++ b/api/api/cat.allocation.js
@@ -0,0 +1,151 @@
+/*
+ * 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 buildCatAllocation (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {string} format - a short version of the Accept header, e.g. json, yaml
+ * @param {enum} bytes - The unit in which to display byte values
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'bytes',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catAllocation (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, nodeId, node_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'nodeId', 'node_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((node_id || nodeId) != null) {
+ path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
+ } else {
+ path = '/' + '_cat' + '/' + 'allocation'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatAllocation
diff --git a/api/api/cat.count.js b/api/api/cat.count.js
new file mode 100644
index 000000000..6fa162c4a
--- /dev/null
+++ b/api/api/cat.count.js
@@ -0,0 +1,149 @@
+/*
+ * 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 buildCatCount (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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 {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catCount (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
+ } else {
+ path = '/' + '_cat' + '/' + 'count'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatCount
diff --git a/api/api/cat.fielddata.js b/api/api/cat.fielddata.js
new file mode 100644
index 000000000..22c9377a5
--- /dev/null
+++ b/api/api/cat.fielddata.js
@@ -0,0 +1,153 @@
+/*
+ * 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 buildCatFielddata (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {string} format - a short version of the Accept header, e.g. json, yaml
+ * @param {enum} bytes - The unit in which to display byte values
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ * @param {list} fields - A comma-separated list of fields to return in the output
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'bytes',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'fields',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catFielddata (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, fields } = params
+ var querystring = semicopy(params, ['method', 'body', 'fields'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((fields) != null) {
+ path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
+ } else {
+ path = '/' + '_cat' + '/' + 'fielddata'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatFielddata
diff --git a/api/api/cat.health.js b/api/api/cat.health.js
new file mode 100644
index 000000000..eb255cc9a
--- /dev/null
+++ b/api/api/cat.health.js
@@ -0,0 +1,146 @@
+/*
+ * 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 buildCatHealth (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} ts - Set to false to disable timestamping
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'ts',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catHealth (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cat' + '/' + 'health'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatHealth
diff --git a/api/api/cat.help.js b/api/api/cat.help.js
new file mode 100644
index 000000000..ebea416e1
--- /dev/null
+++ b/api/api/cat.help.js
@@ -0,0 +1,133 @@
+/*
+ * 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 buildCatHelp (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [cat.help](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request
+ *
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ */
+
+ const acceptedQuerystring = [
+ 'help',
+ 's',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catHelp (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cat'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatHelp
diff --git a/api/api/cat.indices.js b/api/api/cat.indices.js
new file mode 100644
index 000000000..2ff28920d
--- /dev/null
+++ b/api/api/cat.indices.js
@@ -0,0 +1,155 @@
+/*
+ * 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 buildCatIndices (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {string} format - a short version of the Accept header, e.g. json, yaml
+ * @param {enum} bytes - The unit in which to display byte values
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {enum} health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status
+ * @param {boolean} help - Return help information
+ * @param {boolean} pri - Set to true to return stats only for primary shards
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'bytes',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'health',
+ 'help',
+ 'pri',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catIndices (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
+ } else {
+ path = '/' + '_cat' + '/' + 'indices'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatIndices
diff --git a/api/api/cat.master.js b/api/api/cat.master.js
new file mode 100644
index 000000000..432dbd775
--- /dev/null
+++ b/api/api/cat.master.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildCatMaster (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catMaster (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cat' + '/' + 'master'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatMaster
diff --git a/api/api/cat.nodeattrs.js b/api/api/cat.nodeattrs.js
new file mode 100644
index 000000000..2cebea1d7
--- /dev/null
+++ b/api/api/cat.nodeattrs.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildCatNodeattrs (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catNodeattrs (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cat' + '/' + 'nodeattrs'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatNodeattrs
diff --git a/api/api/cat.nodes.js b/api/api/cat.nodes.js
new file mode 100644
index 000000000..dfa320a08
--- /dev/null
+++ b/api/api/cat.nodes.js
@@ -0,0 +1,147 @@
+/*
+ * 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 buildCatNodes (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} full_id - Return the full node ID instead of the shortened version (default: false)
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'full_id',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ fullId: 'full_id',
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catNodes (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cat' + '/' + 'nodes'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatNodes
diff --git a/api/api/cat.pending_tasks.js b/api/api/cat.pending_tasks.js
new file mode 100644
index 000000000..4205042ae
--- /dev/null
+++ b/api/api/cat.pending_tasks.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildCatPendingTasks (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catPendingTasks (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cat' + '/' + 'pending_tasks'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatPendingTasks
diff --git a/api/api/cat.plugins.js b/api/api/cat.plugins.js
new file mode 100644
index 000000000..6fa73552c
--- /dev/null
+++ b/api/api/cat.plugins.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildCatPlugins (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catPlugins (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cat' + '/' + 'plugins'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatPlugins
diff --git a/api/api/cat.recovery.js b/api/api/cat.recovery.js
new file mode 100644
index 000000000..985ed4902
--- /dev/null
+++ b/api/api/cat.recovery.js
@@ -0,0 +1,149 @@
+/*
+ * 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 buildCatRecovery (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {string} format - a short version of the Accept header, e.g. json, yaml
+ * @param {enum} bytes - The unit in which to display byte values
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'bytes',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catRecovery (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
+ } else {
+ path = '/' + '_cat' + '/' + 'recovery'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatRecovery
diff --git a/api/api/cat.repositories.js b/api/api/cat.repositories.js
new file mode 100644
index 000000000..742a2ce56
--- /dev/null
+++ b/api/api/cat.repositories.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildCatRepositories (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} local - Return local information, do not retrieve the state from master node
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catRepositories (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cat' + '/' + 'repositories'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatRepositories
diff --git a/api/api/cat.segments.js b/api/api/cat.segments.js
new file mode 100644
index 000000000..2e4e5f184
--- /dev/null
+++ b/api/api/cat.segments.js
@@ -0,0 +1,146 @@
+/*
+ * 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 buildCatSegments (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {string} format - a short version of the Accept header, e.g. json, yaml
+ * @param {enum} bytes - The unit in which to display byte values
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'bytes',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catSegments (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
+ } else {
+ path = '/' + '_cat' + '/' + 'segments'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatSegments
diff --git a/api/api/cat.shards.js b/api/api/cat.shards.js
new file mode 100644
index 000000000..482dd015f
--- /dev/null
+++ b/api/api/cat.shards.js
@@ -0,0 +1,151 @@
+/*
+ * 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 buildCatShards (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {string} format - a short version of the Accept header, e.g. json, yaml
+ * @param {enum} bytes - The unit in which to display byte values
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'bytes',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catShards (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
+ } else {
+ path = '/' + '_cat' + '/' + 'shards'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatShards
diff --git a/api/api/cat.snapshots.js b/api/api/cat.snapshots.js
new file mode 100644
index 000000000..eaded0a18
--- /dev/null
+++ b/api/api/cat.snapshots.js
@@ -0,0 +1,150 @@
+/*
+ * 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 buildCatSnapshots (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {string} format - a short version of the Accept header, e.g. json, yaml
+ * @param {boolean} ignore_unavailable - Set to true to ignore unavailable snapshots
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'ignore_unavailable',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catSnapshots (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((repository) != null) {
+ path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
+ } else {
+ path = '/' + '_cat' + '/' + 'snapshots'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatSnapshots
diff --git a/api/api/cat.tasks.js b/api/api/cat.tasks.js
new file mode 100644
index 000000000..720459a6f
--- /dev/null
+++ b/api/api/cat.tasks.js
@@ -0,0 +1,149 @@
+/*
+ * 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 buildCatTasks (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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 {boolean} detailed - Return detailed task information (default: false)
+ * @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 {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'node_id',
+ 'actions',
+ 'detailed',
+ 'parent_task',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ nodeId: 'node_id',
+ parentTask: 'parent_task',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catTasks (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cat' + '/' + 'tasks'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatTasks
diff --git a/api/api/cat.templates.js b/api/api/cat.templates.js
new file mode 100644
index 000000000..f3a4f11f7
--- /dev/null
+++ b/api/api/cat.templates.js
@@ -0,0 +1,149 @@
+/*
+ * 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 buildCatTemplates (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} 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 {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catTemplates (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((name) != null) {
+ path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
+ } else {
+ path = '/' + '_cat' + '/' + 'templates'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatTemplates
diff --git a/api/api/cat.thread_pool.js b/api/api/cat.thread_pool.js
new file mode 100644
index 000000000..44756ab39
--- /dev/null
+++ b/api/api/cat.thread_pool.js
@@ -0,0 +1,151 @@
+/*
+ * 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 buildCatThreadPool (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {string} format - a short version of the Accept header, e.g. json, yaml
+ * @param {enum} size - The multiplier in which to display values
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {list} h - Comma-separated list of column names to display
+ * @param {boolean} help - Return help information
+ * @param {list} s - Comma-separated list of column names or column aliases to sort by
+ * @param {boolean} v - Verbose mode. Display column headers
+ */
+
+ const acceptedQuerystring = [
+ 'format',
+ 'size',
+ 'local',
+ 'master_timeout',
+ 'h',
+ 'help',
+ 's',
+ 'v',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function catThreadPool (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, threadPoolPatterns, thread_pool_patterns } = params
+ var querystring = semicopy(params, ['method', 'body', 'threadPoolPatterns', 'thread_pool_patterns'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((thread_pool_patterns || threadPoolPatterns) != null) {
+ path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
+ } else {
+ path = '/' + '_cat' + '/' + 'thread_pool'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCatThreadPool
diff --git a/api/api/ccr.delete_auto_follow_pattern.js b/api/api/ccr.delete_auto_follow_pattern.js
new file mode 100644
index 000000000..04cfe48b5
--- /dev/null
+++ b/api/api/ccr.delete_auto_follow_pattern.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildCcrDeleteAutoFollowPattern (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = 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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrDeleteAutoFollowPattern
diff --git a/api/api/ccr.follow.js b/api/api/ccr.follow.js
new file mode 100644
index 000000000..6983bfea0
--- /dev/null
+++ b/api/api/ccr.follow.js
@@ -0,0 +1,133 @@
+/*
+ * 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, result } = 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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrFollow
diff --git a/api/api/ccr.follow_info.js b/api/api/ccr.follow_info.js
new file mode 100644
index 000000000..0a27de878
--- /dev/null
+++ b/api/api/ccr.follow_info.js
@@ -0,0 +1,117 @@
+/*
+ * 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, result } = 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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrFollowInfo
diff --git a/api/api/ccr.follow_stats.js b/api/api/ccr.follow_stats.js
new file mode 100644
index 000000000..c4f53e66c
--- /dev/null
+++ b/api/api/ccr.follow_stats.js
@@ -0,0 +1,117 @@
+/*
+ * 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, result } = 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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrFollowStats
diff --git a/api/api/ccr.get_auto_follow_pattern.js b/api/api/ccr.get_auto_follow_pattern.js
new file mode 100644
index 000000000..6e59191e1
--- /dev/null
+++ b/api/api/ccr.get_auto_follow_pattern.js
@@ -0,0 +1,121 @@
+/*
+ * 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, result } = 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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ 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
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrGetAutoFollowPattern
diff --git a/api/api/ccr.pause_follow.js b/api/api/ccr.pause_follow.js
new file mode 100644
index 000000000..2e15a0430
--- /dev/null
+++ b/api/api/ccr.pause_follow.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildCcrPauseFollow (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = 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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrPauseFollow
diff --git a/api/api/ccr.put_auto_follow_pattern.js b/api/api/ccr.put_auto_follow_pattern.js
new file mode 100644
index 000000000..d660fafc1
--- /dev/null
+++ b/api/api/ccr.put_auto_follow_pattern.js
@@ -0,0 +1,132 @@
+/*
+ * 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, result } = 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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrPutAutoFollowPattern
diff --git a/api/api/ccr.resume_follow.js b/api/api/ccr.resume_follow.js
new file mode 100644
index 000000000..e4fec5dc5
--- /dev/null
+++ b/api/api/ccr.resume_follow.js
@@ -0,0 +1,126 @@
+/*
+ * 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, result } = 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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrResumeFollow
diff --git a/api/api/ccr.stats.js b/api/api/ccr.stats.js
new file mode 100644
index 000000000..e127ae0ca
--- /dev/null
+++ b/api/api/ccr.stats.js
@@ -0,0 +1,116 @@
+/*
+ * 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, result } = 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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ccr' + '/' + 'stats'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrStats
diff --git a/api/api/ccr.unfollow.js b/api/api/ccr.unfollow.js
new file mode 100644
index 000000000..44af6a3a8
--- /dev/null
+++ b/api/api/ccr.unfollow.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildCcrUnfollow (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = 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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCcrUnfollow
diff --git a/api/api/clear_scroll.js b/api/api/clear_scroll.js
new file mode 100644
index 000000000..bcf7a5afc
--- /dev/null
+++ b/api/api/clear_scroll.js
@@ -0,0 +1,127 @@
+/*
+ * 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 buildClearScroll (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {object} body - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
+ */
+
+ const acceptedQuerystring = [
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clearScroll (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, scrollId, scroll_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'scrollId', 'scroll_id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((scroll_id || scrollId) != null) {
+ path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
+ } else {
+ path = '/' + '_search' + '/' + 'scroll'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClearScroll
diff --git a/api/api/cluster.allocation_explain.js b/api/api/cluster.allocation_explain.js
new file mode 100644
index 000000000..9463e1e90
--- /dev/null
+++ b/api/api/cluster.allocation_explain.js
@@ -0,0 +1,128 @@
+/*
+ * 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 buildClusterAllocationExplain (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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_disk_info - Return information about disk usage and shard sizes (default: false)
+ * @param {object} body - The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'
+ */
+
+ const acceptedQuerystring = [
+ 'include_yes_decisions',
+ 'include_disk_info',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ includeYesDecisions: 'include_yes_decisions',
+ includeDiskInfo: 'include_disk_info',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clusterAllocationExplain (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClusterAllocationExplain
diff --git a/api/api/cluster.get_settings.js b/api/api/cluster.get_settings.js
new file mode 100644
index 000000000..8f7f13c41
--- /dev/null
+++ b/api/api/cluster.get_settings.js
@@ -0,0 +1,140 @@
+/*
+ * 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 buildClusterGetSettings (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {time} timeout - Explicit operation timeout
+ * @param {boolean} include_defaults - Whether to return all default clusters setting.
+ */
+
+ const acceptedQuerystring = [
+ 'flat_settings',
+ 'master_timeout',
+ 'timeout',
+ 'include_defaults',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ flatSettings: 'flat_settings',
+ masterTimeout: 'master_timeout',
+ includeDefaults: 'include_defaults',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clusterGetSettings (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cluster' + '/' + 'settings'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClusterGetSettings
diff --git a/api/api/cluster.health.js b/api/api/cluster.health.js
new file mode 100644
index 000000000..6ff729d8a
--- /dev/null
+++ b/api/api/cluster.health.js
@@ -0,0 +1,161 @@
+/*
+ * 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 buildClusterHealth (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {enum} level - Specify the level of detail for returned information
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {time} timeout - Explicit operation timeout
+ * @param {string} wait_for_active_shards - Wait until the specified number of shards is active
+ * @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 {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
+ */
+
+ const acceptedQuerystring = [
+ 'level',
+ 'local',
+ 'master_timeout',
+ 'timeout',
+ 'wait_for_active_shards',
+ 'wait_for_nodes',
+ 'wait_for_events',
+ 'wait_for_no_relocating_shards',
+ 'wait_for_no_initializing_shards',
+ 'wait_for_status',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ waitForActiveShards: 'wait_for_active_shards',
+ waitForNodes: 'wait_for_nodes',
+ waitForEvents: 'wait_for_events',
+ waitForNoRelocatingShards: 'wait_for_no_relocating_shards',
+ waitForNoInitializingShards: 'wait_for_no_initializing_shards',
+ waitForStatus: 'wait_for_status',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clusterHealth (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
+ } else {
+ path = '/' + '_cluster' + '/' + 'health'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClusterHealth
diff --git a/api/api/cluster.pending_tasks.js b/api/api/cluster.pending_tasks.js
new file mode 100644
index 000000000..86023cb45
--- /dev/null
+++ b/api/api/cluster.pending_tasks.js
@@ -0,0 +1,134 @@
+/*
+ * 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 buildClusterPendingTasks (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {time} master_timeout - Specify timeout for connection to master
+ */
+
+ const acceptedQuerystring = [
+ 'local',
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clusterPendingTasks (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cluster' + '/' + 'pending_tasks'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClusterPendingTasks
diff --git a/api/api/cluster.put_settings.js b/api/api/cluster.put_settings.js
new file mode 100644
index 000000000..110a5bf21
--- /dev/null
+++ b/api/api/cluster.put_settings.js
@@ -0,0 +1,138 @@
+/*
+ * 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 buildClusterPutSettings (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {time} timeout - Explicit operation timeout
+ * @param {object} body - The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).
+ */
+
+ const acceptedQuerystring = [
+ 'flat_settings',
+ 'master_timeout',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ flatSettings: 'flat_settings',
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clusterPutSettings (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cluster' + '/' + 'settings'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClusterPutSettings
diff --git a/api/api/cluster.remote_info.js b/api/api/cluster.remote_info.js
new file mode 100644
index 000000000..93ba95308
--- /dev/null
+++ b/api/api/cluster.remote_info.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildClusterRemoteInfo (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [cluster.remote_info](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clusterRemoteInfo (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_remote' + '/' + 'info'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClusterRemoteInfo
diff --git a/api/api/cluster.reroute.js b/api/api/cluster.reroute.js
new file mode 100644
index 000000000..160b6b5b4
--- /dev/null
+++ b/api/api/cluster.reroute.js
@@ -0,0 +1,137 @@
+/*
+ * 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 buildClusterReroute (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} explain - Return an explanation of why the commands can or cannot be executed
+ * @param {boolean} retry_failed - Retries allocation of shards that are blocked due to too many subsequent allocation failures
+ * @param {list} metric - Limit the information returned to the specified metrics. Defaults to all but metadata
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {time} timeout - Explicit operation timeout
+ * @param {object} body - The definition of `commands` to perform (`move`, `cancel`, `allocate`)
+ */
+
+ const acceptedQuerystring = [
+ 'dry_run',
+ 'explain',
+ 'retry_failed',
+ 'metric',
+ 'master_timeout',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ dryRun: 'dry_run',
+ retryFailed: 'retry_failed',
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clusterReroute (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_cluster' + '/' + 'reroute'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClusterReroute
diff --git a/api/api/cluster.state.js b/api/api/cluster.state.js
new file mode 100644
index 000000000..91f68781c
--- /dev/null
+++ b/api/api/cluster.state.js
@@ -0,0 +1,168 @@
+/*
+ * 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 buildClusterState (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} 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 {time} master_timeout - Specify timeout for connection to master
+ * @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} 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.
+ */
+
+ const acceptedQuerystring = [
+ 'local',
+ 'master_timeout',
+ 'flat_settings',
+ 'wait_for_metadata_version',
+ 'wait_for_timeout',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ flatSettings: 'flat_settings',
+ waitForMetadataVersion: 'wait_for_metadata_version',
+ waitForTimeout: 'wait_for_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clusterState (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['index'] != null && (params['metric'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: metric'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, metric } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'metric'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((metric) != null && (index) != null) {
+ path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
+ } else if ((metric) != null) {
+ path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric)
+ } else {
+ path = '/' + '_cluster' + '/' + 'state'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClusterState
diff --git a/api/api/cluster.stats.js b/api/api/cluster.stats.js
new file mode 100644
index 000000000..a07b2a324
--- /dev/null
+++ b/api/api/cluster.stats.js
@@ -0,0 +1,139 @@
+/*
+ * 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 buildClusterStats (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} flat_settings - Return settings in flat format (default: false)
+ * @param {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'flat_settings',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ flatSettings: 'flat_settings',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function clusterStats (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, nodeId, node_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'nodeId', 'node_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((node_id || nodeId) != null) {
+ path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId)
+ } else {
+ path = '/' + '_cluster' + '/' + 'stats'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildClusterStats
diff --git a/api/api/count.js b/api/api/count.js
new file mode 100644
index 000000000..9dd09c294
--- /dev/null
+++ b/api/api/count.js
@@ -0,0 +1,174 @@
+/*
+ * 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 buildCount (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} 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_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 {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 {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {list} routing - A comma-separated list of specific routing values
+ * @param {string} q - Query in the Lucene query string syntax
+ * @param {string} analyzer - The analyzer to use for the query string
+ * @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
+ * @param {enum} default_operator - The default operator for query string query (AND or OR)
+ * @param {string} df - The field to use as default where no field prefix is given in the query string
+ * @param {boolean} lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+ * @param {number} terminate_after - The maximum count for each shard, upon reaching which the query execution will terminate early
+ * @param {object} body - A query to restrict the results specified with the Query DSL (optional)
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'ignore_throttled',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'min_score',
+ 'preference',
+ 'routing',
+ 'q',
+ 'analyzer',
+ 'analyze_wildcard',
+ 'default_operator',
+ 'df',
+ 'lenient',
+ 'terminate_after',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ ignoreThrottled: 'ignore_throttled',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ minScore: 'min_score',
+ analyzeWildcard: 'analyze_wildcard',
+ defaultOperator: 'default_operator',
+ terminateAfter: 'terminate_after',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function count (params, options, callback) {
+ options = options || {}
+ if (typeof options === 'function') {
+ callback = options
+ options = {}
+ }
+ if (typeof params === 'function' || params == null) {
+ callback = params
+ params = {}
+ options = {}
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count'
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_count'
+ } else {
+ path = '/' + '_count'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCount
diff --git a/api/api/create.js b/api/api/create.js
new file mode 100644
index 000000000..eb18d517b
--- /dev/null
+++ b/api/api/create.js
@@ -0,0 +1,167 @@
+/*
+ * 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 buildCreate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [create](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request
+ *
+ * @param {string} id - Document ID
+ * @param {string} index - The name of the index
+ * @param {string} type - The type of the document
+ * @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the index 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} parent - ID of the parent document
+ * @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 {time} timeout - Explicit operation timeout
+ * @param {number} version - Explicit version number for concurrency control
+ * @param {enum} version_type - Specific version type
+ * @param {string} pipeline - The pipeline id to preprocess incoming documents with
+ * @param {object} body - The document
+ */
+
+ const acceptedQuerystring = [
+ 'wait_for_active_shards',
+ 'parent',
+ 'refresh',
+ 'routing',
+ 'timeout',
+ 'version',
+ 'version_type',
+ 'pipeline',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ waitForActiveShards: 'wait_for_active_shards',
+ versionType: 'version_type',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function create (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['index'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'index', 'type'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildCreate
diff --git a/api/api/delete.js b/api/api/delete.js
new file mode 100644
index 000000000..db3e90b35
--- /dev/null
+++ b/api/api/delete.js
@@ -0,0 +1,178 @@
+/*
+ * 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 buildDelete (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html) request
+ *
+ * @param {string} id - The document ID
+ * @param {string} index - The name of the index
+ * @param {string} type - The type of the document
+ * @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the delete 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} parent - ID of parent document
+ * @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 {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 {enum} version_type - Specific version type
+ */
+
+ const acceptedQuerystring = [
+ 'wait_for_active_shards',
+ 'parent',
+ 'refresh',
+ 'routing',
+ 'timeout',
+ 'if_seq_no',
+ 'if_primary_term',
+ 'version',
+ 'version_type',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ waitForActiveShards: 'wait_for_active_shards',
+ ifSeqNo: 'if_seq_no',
+ ifPrimaryTerm: 'if_primary_term',
+ versionType: 'version_type',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function _delete (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['index'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['id'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'index', 'type'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildDelete
diff --git a/api/api/delete_by_query.js b/api/api/delete_by_query.js
new file mode 100644
index 000000000..559bcd201
--- /dev/null
+++ b/api/api/delete_by_query.js
@@ -0,0 +1,229 @@
+/*
+ * 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 buildDeleteByQuery (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
+ * @param {string} analyzer - The analyzer to use for the query string
+ * @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
+ * @param {enum} default_operator - The default operator for query string query (AND or OR)
+ * @param {string} df - The field to use as default where no field prefix is given in the query string
+ * @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} 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} 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 {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {string} q - Query in the Lucene query string syntax
+ * @param {list} routing - A comma-separated list of specific routing values
+ * @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
+ * @param {enum} search_type - Search operation type
+ * @param {time} search_timeout - Explicit timeout for each search request. Defaults to no timeout.
+ * @param {number} size - Number of hits to return (default: 10)
+ * @param {list} sort - A comma-separated list of : pairs
+ * @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 {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 {boolean} version - Specify whether to return document version as part of a hit
+ * @param {boolean} request_cache - Specify if request cache should be used for this request or not, defaults to index level setting
+ * @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 {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 delete by query
+ * @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} 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
+ */
+
+ const acceptedQuerystring = [
+ 'analyzer',
+ 'analyze_wildcard',
+ 'default_operator',
+ 'df',
+ 'from',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'conflicts',
+ 'expand_wildcards',
+ 'lenient',
+ 'preference',
+ 'q',
+ 'routing',
+ 'scroll',
+ 'search_type',
+ 'search_timeout',
+ 'size',
+ 'sort',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'terminate_after',
+ 'stats',
+ 'version',
+ 'request_cache',
+ 'refresh',
+ 'timeout',
+ 'wait_for_active_shards',
+ 'scroll_size',
+ 'wait_for_completion',
+ 'requests_per_second',
+ 'slices',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ analyzeWildcard: 'analyze_wildcard',
+ defaultOperator: 'default_operator',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ searchType: 'search_type',
+ searchTimeout: 'search_timeout',
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ terminateAfter: 'terminate_after',
+ requestCache: 'request_cache',
+ waitForActiveShards: 'wait_for_active_shards',
+ scrollSize: 'scroll_size',
+ waitForCompletion: 'wait_for_completion',
+ requestsPerSecond: 'requests_per_second',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function deleteByQuery (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildDeleteByQuery
diff --git a/api/api/delete_by_query_rethrottle.js b/api/api/delete_by_query_rethrottle.js
new file mode 100644
index 000000000..3d9cb752f
--- /dev/null
+++ b/api/api/delete_by_query_rethrottle.js
@@ -0,0 +1,145 @@
+/*
+ * 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, result } = 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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: task_id or taskId'),
+ result
+ )
+ }
+ if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, taskId, task_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'taskId', 'task_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildDeleteByQueryRethrottle
diff --git a/api/api/delete_script.js b/api/api/delete_script.js
new file mode 100644
index 000000000..fed63e09d
--- /dev/null
+++ b/api/api/delete_script.js
@@ -0,0 +1,141 @@
+/*
+ * 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 buildDeleteScript (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [delete_script](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request
+ *
+ * @param {string} id - Script ID
+ * @param {time} timeout - Explicit operation timeout
+ * @param {time} master_timeout - Specify timeout for connection to master
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function deleteScript (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_scripts' + '/' + encodeURIComponent(id)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildDeleteScript
diff --git a/api/api/exists.js b/api/api/exists.js
new file mode 100644
index 000000000..58dba35b1
--- /dev/null
+++ b/api/api/exists.js
@@ -0,0 +1,174 @@
+/*
+ * 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 buildExists (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
+ *
+ * @param {string} id - The document ID
+ * @param {string} index - The name of the index
+ * @param {string} type - The type of the document (use `_all` to fetch the first document matching the ID across all types)
+ * @param {list} stored_fields - A comma-separated list of stored fields to return in the response
+ * @param {string} parent - The ID of the parent document
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
+ * @param {boolean} refresh - Refresh the shard containing the document before performing the operation
+ * @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_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 {number} version - Explicit version number for concurrency control
+ * @param {enum} version_type - Specific version type
+ */
+
+ const acceptedQuerystring = [
+ 'stored_fields',
+ 'parent',
+ 'preference',
+ 'realtime',
+ 'refresh',
+ 'routing',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'version',
+ 'version_type',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ storedFields: 'stored_fields',
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ versionType: 'version_type',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function exists (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['index'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'index', 'type'])
+
+ if (method == null) {
+ method = 'HEAD'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildExists
diff --git a/api/api/exists_source.js b/api/api/exists_source.js
new file mode 100644
index 000000000..a4280b7eb
--- /dev/null
+++ b/api/api/exists_source.js
@@ -0,0 +1,184 @@
+/*
+ * 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 buildExistsSource (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [exists_source](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
+ *
+ * @param {string} id - The document ID
+ * @param {string} index - The name of the index
+ * @param {string} type - The type of the document; deprecated and optional starting with 7.0
+ * @param {string} parent - The ID of the parent document
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
+ * @param {boolean} refresh - Refresh the shard containing the document before performing the operation
+ * @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_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 {number} version - Explicit version number for concurrency control
+ * @param {enum} version_type - Specific version type
+ */
+
+ const acceptedQuerystring = [
+ 'parent',
+ 'preference',
+ 'realtime',
+ 'refresh',
+ 'routing',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'version',
+ 'version_type',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ versionType: 'version_type',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function existsSource (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['index'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: type, index'),
+ result
+ )
+ } else if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'index', 'type'])
+
+ if (method == null) {
+ method = 'HEAD'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildExistsSource
diff --git a/api/api/explain.js b/api/api/explain.js
new file mode 100644
index 000000000..cdba2dc5c
--- /dev/null
+++ b/api/api/explain.js
@@ -0,0 +1,174 @@
+/*
+ * 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 buildExplain (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html) request
+ *
+ * @param {string} id - The document ID
+ * @param {string} index - The name of the index
+ * @param {string} type - The type of the document
+ * @param {boolean} analyze_wildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)
+ * @param {string} analyzer - The analyzer for the query string query
+ * @param {enum} default_operator - The default operator for query string query (AND or OR)
+ * @param {string} df - The default field for query string query (default: _all)
+ * @param {list} stored_fields - A comma-separated list of stored fields to return in the response
+ * @param {boolean} lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+ * @param {string} parent - The ID of the parent document
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {string} q - Query in the Lucene query string syntax
+ * @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_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 {object} body - The query definition using the Query DSL
+ */
+
+ const acceptedQuerystring = [
+ 'analyze_wildcard',
+ 'analyzer',
+ 'default_operator',
+ 'df',
+ 'stored_fields',
+ 'lenient',
+ 'parent',
+ 'preference',
+ 'q',
+ 'routing',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ analyzeWildcard: 'analyze_wildcard',
+ defaultOperator: 'default_operator',
+ storedFields: 'stored_fields',
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function explain (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['index'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildExplain
diff --git a/api/api/field_caps.js b/api/api/field_caps.js
new file mode 100644
index 000000000..79f2ad7be
--- /dev/null
+++ b/api/api/field_caps.js
@@ -0,0 +1,145 @@
+/*
+ * 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 buildFieldCaps (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} fields - A comma-separated list of field names
+ * @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.
+ */
+
+ const acceptedQuerystring = [
+ 'fields',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function fieldCaps (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_field_caps'
+ } else {
+ path = '/' + '_field_caps'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildFieldCaps
diff --git a/api/api/get.js b/api/api/get.js
new file mode 100644
index 000000000..af04e37c5
--- /dev/null
+++ b/api/api/get.js
@@ -0,0 +1,180 @@
+/*
+ * 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 buildGet (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [get](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
+ *
+ * @param {string} id - The document ID
+ * @param {string} index - The name of the index
+ * @param {string} type - The type of the document (use `_all` to fetch the first document matching the ID across all types)
+ * @param {list} stored_fields - A comma-separated list of stored fields to return in the response
+ * @param {string} parent - The ID of the parent document
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
+ * @param {boolean} refresh - Refresh the shard containing the document before performing the operation
+ * @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_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_include - A list of fields to extract and return from the _source field
+ * @param {number} version - Explicit version number for concurrency control
+ * @param {enum} version_type - Specific version type
+ */
+
+ const acceptedQuerystring = [
+ 'stored_fields',
+ 'parent',
+ 'preference',
+ 'realtime',
+ 'refresh',
+ 'routing',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ '_source_exclude',
+ '_source_include',
+ 'version',
+ 'version_type',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ storedFields: 'stored_fields',
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ _sourceExclude: '_source_exclude',
+ _sourceInclude: '_source_include',
+ versionType: 'version_type',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function get (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['index'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'index', 'type'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildGet
diff --git a/api/api/get_script.js b/api/api/get_script.js
new file mode 100644
index 000000000..ef873a5ee
--- /dev/null
+++ b/api/api/get_script.js
@@ -0,0 +1,139 @@
+/*
+ * 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 buildGetScript (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [get_script](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request
+ *
+ * @param {string} id - Script ID
+ * @param {time} master_timeout - Specify timeout for connection to master
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function getScript (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_scripts' + '/' + encodeURIComponent(id)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildGetScript
diff --git a/api/api/get_source.js b/api/api/get_source.js
new file mode 100644
index 000000000..18ad2e4e6
--- /dev/null
+++ b/api/api/get_source.js
@@ -0,0 +1,171 @@
+/*
+ * 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 buildGetSource (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} index - The name of the index
+ * @param {string} type - The type of the document; deprecated and optional starting with 7.0
+ * @param {string} parent - The ID of the parent document
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
+ * @param {boolean} refresh - Refresh the shard containing the document before performing the operation
+ * @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_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 {number} version - Explicit version number for concurrency control
+ * @param {enum} version_type - Specific version type
+ */
+
+ const acceptedQuerystring = [
+ 'parent',
+ 'preference',
+ 'realtime',
+ 'refresh',
+ 'routing',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'version',
+ 'version_type',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ versionType: 'version_type',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function getSource (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['index'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'index', 'type'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildGetSource
diff --git a/api/api/ilm.delete_lifecycle.js b/api/api/ilm.delete_lifecycle.js
new file mode 100644
index 000000000..8d2c2b6b5
--- /dev/null
+++ b/api/api/ilm.delete_lifecycle.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildIlmDeleteLifecycle (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = 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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, policy } = params
+ var querystring = semicopy(params, ['method', 'body', 'policy'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmDeleteLifecycle
diff --git a/api/api/ilm.explain_lifecycle.js b/api/api/ilm.explain_lifecycle.js
new file mode 100644
index 000000000..377959873
--- /dev/null
+++ b/api/api/ilm.explain_lifecycle.js
@@ -0,0 +1,126 @@
+/*
+ * 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, result } = 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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'explain'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmExplainLifecycle
diff --git a/api/api/ilm.get_lifecycle.js b/api/api/ilm.get_lifecycle.js
new file mode 100644
index 000000000..d4aea2190
--- /dev/null
+++ b/api/api/ilm.get_lifecycle.js
@@ -0,0 +1,129 @@
+/*
+ * 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, result } = 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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, policy } = params
+ var querystring = semicopy(params, ['method', 'body', 'policy'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ 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
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmGetLifecycle
diff --git a/api/api/ilm.get_status.js b/api/api/ilm.get_status.js
new file mode 100644
index 000000000..38df25c38
--- /dev/null
+++ b/api/api/ilm.get_status.js
@@ -0,0 +1,124 @@
+/*
+ * 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, result } = 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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ilm' + '/' + 'status'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmGetStatus
diff --git a/api/api/ilm.move_to_step.js b/api/api/ilm.move_to_step.js
new file mode 100644
index 000000000..0f6b9274f
--- /dev/null
+++ b/api/api/ilm.move_to_step.js
@@ -0,0 +1,118 @@
+/*
+ * 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, result } = 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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ilm' + '/' + 'move' + '/' + encodeURIComponent(index)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmMoveToStep
diff --git a/api/api/ilm.put_lifecycle.js b/api/api/ilm.put_lifecycle.js
new file mode 100644
index 000000000..de148ad62
--- /dev/null
+++ b/api/api/ilm.put_lifecycle.js
@@ -0,0 +1,118 @@
+/*
+ * 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, result } = 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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, policy } = params
+ var querystring = semicopy(params, ['method', 'body', 'policy'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmPutLifecycle
diff --git a/api/api/ilm.remove_policy.js b/api/api/ilm.remove_policy.js
new file mode 100644
index 000000000..f0258c29c
--- /dev/null
+++ b/api/api/ilm.remove_policy.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildIlmRemovePolicy (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = 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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'remove'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmRemovePolicy
diff --git a/api/api/ilm.retry.js b/api/api/ilm.retry.js
new file mode 100644
index 000000000..6568a0a40
--- /dev/null
+++ b/api/api/ilm.retry.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildIlmRetry (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = 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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'retry'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmRetry
diff --git a/api/api/ilm.start.js b/api/api/ilm.start.js
new file mode 100644
index 000000000..840700141
--- /dev/null
+++ b/api/api/ilm.start.js
@@ -0,0 +1,124 @@
+/*
+ * 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, result } = 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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ilm' + '/' + 'start'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmStart
diff --git a/api/api/ilm.stop.js b/api/api/ilm.stop.js
new file mode 100644
index 000000000..166ed28b1
--- /dev/null
+++ b/api/api/ilm.stop.js
@@ -0,0 +1,124 @@
+/*
+ * 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, result } = 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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ilm' + '/' + 'stop'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIlmStop
diff --git a/api/api/index.js b/api/api/index.js
new file mode 100644
index 000000000..213b41ac5
--- /dev/null
+++ b/api/api/index.js
@@ -0,0 +1,182 @@
+/*
+ * 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 buildIndex (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [index](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request
+ *
+ * @param {string} id - Document ID
+ * @param {string} index - The name of the index
+ * @param {string} type - The type of the document
+ * @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the index 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 {enum} op_type - Explicit operation type
+ * @param {string} parent - ID of the parent document
+ * @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 {time} timeout - Explicit operation timeout
+ * @param {number} version - Explicit version number for concurrency control
+ * @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 {object} body - The document
+ */
+
+ const acceptedQuerystring = [
+ 'wait_for_active_shards',
+ 'op_type',
+ 'parent',
+ 'refresh',
+ 'routing',
+ 'timeout',
+ 'version',
+ 'version_type',
+ 'if_seq_no',
+ 'if_primary_term',
+ 'pipeline',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ waitForActiveShards: 'wait_for_active_shards',
+ opType: 'op_type',
+ versionType: 'version_type',
+ ifSeqNo: 'if_seq_no',
+ ifPrimaryTerm: 'if_primary_term',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function _index (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['id'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'index', 'type'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
+ } else if ((index) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
+ } else if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type)
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_doc'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndex
diff --git a/api/api/indices.analyze.js b/api/api/indices.analyze.js
new file mode 100644
index 000000000..b4d697bc8
--- /dev/null
+++ b/api/api/indices.analyze.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildIndicesAnalyze (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {object} body - Define analyzer/tokenizer parameters and the text on which the analysis should be performed
+ */
+
+ const acceptedQuerystring = [
+ 'index',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesAnalyze (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_analyze'
+ } else {
+ path = '/' + '_analyze'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesAnalyze
diff --git a/api/api/indices.clear_cache.js b/api/api/indices.clear_cache.js
new file mode 100644
index 000000000..2d6b3be6b
--- /dev/null
+++ b/api/api/indices.clear_cache.js
@@ -0,0 +1,153 @@
+/*
+ * 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 buildIndicesClearCache (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} fielddata - Clear field data
+ * @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} 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 {list} index - A comma-separated list of index name to limit the operation
+ * @param {boolean} request - Clear request cache
+ */
+
+ const acceptedQuerystring = [
+ 'fielddata',
+ 'fields',
+ 'query',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'index',
+ 'request',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesClearCache (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear'
+ } else {
+ path = '/' + '_cache' + '/' + 'clear'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesClearCache
diff --git a/api/api/indices.close.js b/api/api/indices.close.js
new file mode 100644
index 000000000..46a92f3a9
--- /dev/null
+++ b/api/api/indices.close.js
@@ -0,0 +1,150 @@
+/*
+ * 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 buildIndicesClose (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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} 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.
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesClose (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_close'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesClose
diff --git a/api/api/indices.create.js b/api/api/indices.create.js
new file mode 100644
index 000000000..fadcb4981
--- /dev/null
+++ b/api/api/indices.create.js
@@ -0,0 +1,142 @@
+/*
+ * 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 buildIndicesCreate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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 {time} timeout - Explicit operation timeout
+ * @param {time} master_timeout - Specify timeout for connection to master
+ * @param {object} body - The configuration for the index (`settings` and `mappings`)
+ */
+
+ const acceptedQuerystring = [
+ 'include_type_name',
+ 'wait_for_active_shards',
+ 'timeout',
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ includeTypeName: 'include_type_name',
+ waitForActiveShards: 'wait_for_active_shards',
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesCreate (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesCreate
diff --git a/api/api/indices.delete.js b/api/api/indices.delete.js
new file mode 100644
index 000000000..5a48c7794
--- /dev/null
+++ b/api/api/indices.delete.js
@@ -0,0 +1,150 @@
+/*
+ * 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 buildIndicesDelete (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {time} timeout - Explicit operation timeout
+ * @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 = [
+ 'timeout',
+ 'master_timeout',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesDelete (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesDelete
diff --git a/api/api/indices.delete_alias.js b/api/api/indices.delete_alias.js
new file mode 100644
index 000000000..5b57fbb63
--- /dev/null
+++ b/api/api/indices.delete_alias.js
@@ -0,0 +1,160 @@
+/*
+ * 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 buildIndicesDeleteAlias (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.
+ * @param {time} timeout - Explicit timestamp for the document
+ * @param {time} master_timeout - Specify timeout for connection to master
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesDeleteAlias (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['name'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['name'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'name'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (name) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesDeleteAlias
diff --git a/api/api/indices.delete_template.js b/api/api/indices.delete_template.js
new file mode 100644
index 000000000..a7fb0aca5
--- /dev/null
+++ b/api/api/indices.delete_template.js
@@ -0,0 +1,141 @@
+/*
+ * 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 buildIndicesDeleteTemplate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {time} timeout - Explicit operation timeout
+ * @param {time} master_timeout - Specify timeout for connection to master
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesDeleteTemplate (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_template' + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesDeleteTemplate
diff --git a/api/api/indices.exists.js b/api/api/indices.exists.js
new file mode 100644
index 000000000..a25cea993
--- /dev/null
+++ b/api/api/indices.exists.js
@@ -0,0 +1,153 @@
+/*
+ * 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 buildIndicesExists (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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} 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 {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.
+ */
+
+ const acceptedQuerystring = [
+ 'local',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'flat_settings',
+ 'include_defaults',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ flatSettings: 'flat_settings',
+ includeDefaults: 'include_defaults',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesExists (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'HEAD'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesExists
diff --git a/api/api/indices.exists_alias.js b/api/api/indices.exists_alias.js
new file mode 100644
index 000000000..9a5de4520
--- /dev/null
+++ b/api/api/indices.exists_alias.js
@@ -0,0 +1,152 @@
+/*
+ * 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 buildIndicesExistsAlias (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} name - A comma-separated list of alias names to return
+ * @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 {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'local',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesExistsAlias (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'name'])
+
+ if (method == null) {
+ method = 'HEAD'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (name) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
+ } else {
+ path = '/' + '_alias' + '/' + encodeURIComponent(name)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesExistsAlias
diff --git a/api/api/indices.exists_template.js b/api/api/indices.exists_template.js
new file mode 100644
index 000000000..52f0ab596
--- /dev/null
+++ b/api/api/indices.exists_template.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildIndicesExistsTemplate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} flat_settings - Return settings in flat format (default: false)
+ * @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)
+ */
+
+ const acceptedQuerystring = [
+ 'flat_settings',
+ 'master_timeout',
+ 'local',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ flatSettings: 'flat_settings',
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesExistsTemplate (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'HEAD'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_template' + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesExistsTemplate
diff --git a/api/api/indices.exists_type.js b/api/api/indices.exists_type.js
new file mode 100644
index 000000000..120f27f14
--- /dev/null
+++ b/api/api/indices.exists_type.js
@@ -0,0 +1,162 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildIndicesExistsType (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} type - A comma-separated list of document types to check
+ * @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 {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'local',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesExistsType (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['type'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: type'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = 'HEAD'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesExistsType
diff --git a/api/api/indices.flush.js b/api/api/indices.flush.js
new file mode 100644
index 000000000..854665f33
--- /dev/null
+++ b/api/api/indices.flush.js
@@ -0,0 +1,148 @@
+/*
+ * 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 buildIndicesFlush (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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} wait_if_ongoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running.
+ * @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.
+ */
+
+ const acceptedQuerystring = [
+ 'force',
+ 'wait_if_ongoing',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ waitIfOngoing: 'wait_if_ongoing',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesFlush (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_flush'
+ } else {
+ path = '/' + '_flush'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesFlush
diff --git a/api/api/indices.flush_synced.js b/api/api/indices.flush_synced.js
new file mode 100644
index 000000000..ca4fa36f6
--- /dev/null
+++ b/api/api/indices.flush_synced.js
@@ -0,0 +1,143 @@
+/*
+ * 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 buildIndicesFlushSynced (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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.
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesFlushSynced (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced'
+ } else {
+ path = '/' + '_flush' + '/' + 'synced'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesFlushSynced
diff --git a/api/api/indices.forcemerge.js b/api/api/indices.forcemerge.js
new file mode 100644
index 000000000..e4616ab7e
--- /dev/null
+++ b/api/api/indices.forcemerge.js
@@ -0,0 +1,151 @@
+/*
+ * 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 buildIndicesForcemerge (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} flush - Specify whether the index should be flushed after performing the operation (default: true)
+ * @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 {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
+ */
+
+ const acceptedQuerystring = [
+ 'flush',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'max_num_segments',
+ 'only_expunge_deletes',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ maxNumSegments: 'max_num_segments',
+ onlyExpungeDeletes: 'only_expunge_deletes',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesForcemerge (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_forcemerge'
+ } else {
+ path = '/' + '_forcemerge'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesForcemerge
diff --git a/api/api/indices.freeze.js b/api/api/indices.freeze.js
new file mode 100644
index 000000000..bc2745c56
--- /dev/null
+++ b/api/api/indices.freeze.js
@@ -0,0 +1,146 @@
+/*
+ * 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 buildIndicesFreeze (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.freeze](https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html) request
+ *
+ * @param {string} index - The name of the index to freeze
+ * @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} 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} wait_for_active_shards - Sets the number of active shards to wait for before the operation returns.
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'wait_for_active_shards'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ waitForActiveShards: 'wait_for_active_shards'
+ }
+
+ return function indicesFreeze (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_freeze'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesFreeze
diff --git a/api/api/indices.get.js b/api/api/indices.get.js
new file mode 100644
index 000000000..bfcefdf9b
--- /dev/null
+++ b/api/api/indices.get.js
@@ -0,0 +1,159 @@
+/*
+ * 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 buildIndicesGet (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {boolean} include_type_name - Whether to add the type name to the response (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} 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 {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 {time} master_timeout - Specify timeout for connection to master
+ */
+
+ const acceptedQuerystring = [
+ 'include_type_name',
+ 'local',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'flat_settings',
+ 'include_defaults',
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ includeTypeName: 'include_type_name',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ flatSettings: 'flat_settings',
+ includeDefaults: 'include_defaults',
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesGet (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesGet
diff --git a/api/api/indices.get_alias.js b/api/api/indices.get_alias.js
new file mode 100644
index 000000000..e0e06505d
--- /dev/null
+++ b/api/api/indices.get_alias.js
@@ -0,0 +1,150 @@
+/*
+ * 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 buildIndicesGetAlias (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} name - A comma-separated list of alias names to return
+ * @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 {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'local',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesGetAlias (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'name'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (name) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
+ } else if ((name) != null) {
+ path = '/' + '_alias' + '/' + encodeURIComponent(name)
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_alias'
+ } else {
+ path = '/' + '_alias'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesGetAlias
diff --git a/api/api/indices.get_field_mapping.js b/api/api/indices.get_field_mapping.js
new file mode 100644
index 000000000..f4b3e968c
--- /dev/null
+++ b/api/api/indices.get_field_mapping.js
@@ -0,0 +1,163 @@
+/*
+ * 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 buildIndicesGetFieldMapping (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} type - A comma-separated list of document types
+ * @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} 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 {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ */
+
+ const acceptedQuerystring = [
+ 'include_type_name',
+ 'include_defaults',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'local',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ includeTypeName: 'include_type_name',
+ includeDefaults: 'include_defaults',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesGetFieldMapping (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['fields'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: fields'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type, fields } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type', 'fields'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (fields) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
+ } else if ((index) != null && (fields) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
+ } else if ((type) != null && (fields) != null) {
+ path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
+ } else {
+ path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesGetFieldMapping
diff --git a/api/api/indices.get_mapping.js b/api/api/indices.get_mapping.js
new file mode 100644
index 000000000..1f2f2b5d9
--- /dev/null
+++ b/api/api/indices.get_mapping.js
@@ -0,0 +1,156 @@
+/*
+ * 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 buildIndicesGetMapping (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} type - A comma-separated list of document types
+ * @param {boolean} include_type_name - Whether to add the type name to the response (default: false)
+ * @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 {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)
+ */
+
+ const acceptedQuerystring = [
+ 'include_type_name',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'master_timeout',
+ 'local',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ includeTypeName: 'include_type_name',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesGetMapping (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping'
+ } else if ((type) != null) {
+ path = '/' + '_mapping' + '/' + encodeURIComponent(type)
+ } else {
+ path = '/' + '_mapping'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesGetMapping
diff --git a/api/api/indices.get_settings.js b/api/api/indices.get_settings.js
new file mode 100644
index 000000000..6e444f08e
--- /dev/null
+++ b/api/api/indices.get_settings.js
@@ -0,0 +1,159 @@
+/*
+ * 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 buildIndicesGetSettings (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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} 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} 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 {boolean} flat_settings - Return settings in flat format (default: false)
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @param {boolean} include_defaults - Whether to return all default setting for each of the indices.
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'flat_settings',
+ 'local',
+ 'include_defaults',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ flatSettings: 'flat_settings',
+ includeDefaults: 'include_defaults',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesGetSettings (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'name'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (name) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name)
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_settings'
+ } else if ((name) != null) {
+ path = '/' + '_settings' + '/' + encodeURIComponent(name)
+ } else {
+ path = '/' + '_settings'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesGetSettings
diff --git a/api/api/indices.get_template.js b/api/api/indices.get_template.js
new file mode 100644
index 000000000..58fb3d83a
--- /dev/null
+++ b/api/api/indices.get_template.js
@@ -0,0 +1,145 @@
+/*
+ * 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 buildIndicesGetTemplate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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 {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)
+ */
+
+ const acceptedQuerystring = [
+ 'include_type_name',
+ 'flat_settings',
+ 'master_timeout',
+ 'local',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ includeTypeName: 'include_type_name',
+ flatSettings: 'flat_settings',
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesGetTemplate (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((name) != null) {
+ path = '/' + '_template' + '/' + encodeURIComponent(name)
+ } else {
+ path = '/' + '_template'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesGetTemplate
diff --git a/api/api/indices.get_upgrade.js b/api/api/indices.get_upgrade.js
new file mode 100644
index 000000000..a2b34458b
--- /dev/null
+++ b/api/api/indices.get_upgrade.js
@@ -0,0 +1,143 @@
+/*
+ * 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 buildIndicesGetUpgrade (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * 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 {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.
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesGetUpgrade (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
+ } else {
+ path = '/' + '_upgrade'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesGetUpgrade
diff --git a/api/api/indices.open.js b/api/api/indices.open.js
new file mode 100644
index 000000000..b71427566
--- /dev/null
+++ b/api/api/indices.open.js
@@ -0,0 +1,153 @@
+/*
+ * 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 buildIndicesOpen (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.open](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request
+ *
+ * @param {list} index - A comma separated list of indices to open
+ * @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} 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} wait_for_active_shards - Sets the number of active shards to wait for before the operation returns.
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'wait_for_active_shards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ waitForActiveShards: 'wait_for_active_shards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesOpen (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_open'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesOpen
diff --git a/api/api/indices.put_alias.js b/api/api/indices.put_alias.js
new file mode 100644
index 000000000..7e5566d44
--- /dev/null
+++ b/api/api/indices.put_alias.js
@@ -0,0 +1,155 @@
+/*
+ * 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 buildIndicesPutAlias (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.put_alias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request
+ *
+ * @param {list} index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices.
+ * @param {string} name - The name of the alias to be created or updated
+ * @param {time} timeout - Explicit timestamp for the document
+ * @param {time} master_timeout - Specify timeout for connection to master
+ * @param {object} body - The settings for the alias, such as `routing` or `filter`
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesPutAlias (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['name'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['name'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'name'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (name) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesPutAlias
diff --git a/api/api/indices.put_mapping.js b/api/api/indices.put_mapping.js
new file mode 100644
index 000000000..da3c84df6
--- /dev/null
+++ b/api/api/indices.put_mapping.js
@@ -0,0 +1,165 @@
+/*
+ * 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 buildIndicesPutMapping (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.put_mapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html) request
+ *
+ * @param {list} index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices.
+ * @param {string} type - The name of the document type
+ * @param {boolean} include_type_name - Whether a type should be expected in the body of the mappings.
+ * @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} 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 {object} body - The mapping definition
+ */
+
+ const acceptedQuerystring = [
+ 'include_type_name',
+ 'timeout',
+ 'master_timeout',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ includeTypeName: 'include_type_name',
+ masterTimeout: 'master_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesPutMapping (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping'
+ } else if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
+ } else if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings'
+ } else if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type)
+ } else if ((type) != null) {
+ path = '/' + '_mapping' + '/' + encodeURIComponent(type)
+ } else if ((type) != null) {
+ path = '/' + '_mappings' + '/' + encodeURIComponent(type)
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_mappings'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesPutMapping
diff --git a/api/api/indices.put_settings.js b/api/api/indices.put_settings.js
new file mode 100644
index 000000000..6fa62c36e
--- /dev/null
+++ b/api/api/indices.put_settings.js
@@ -0,0 +1,155 @@
+/*
+ * 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 buildIndicesPutSettings (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.put_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-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 {time} master_timeout - Specify timeout for connection to master
+ * @param {time} timeout - Explicit operation timeout
+ * @param {boolean} preserve_existing - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`
+ * @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 {boolean} flat_settings - Return settings in flat format (default: false)
+ * @param {object} body - The index settings to be updated
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'timeout',
+ 'preserve_existing',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'flat_settings',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ preserveExisting: 'preserve_existing',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ flatSettings: 'flat_settings',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesPutSettings (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_settings'
+ } else {
+ path = '/' + '_settings'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesPutSettings
diff --git a/api/api/indices.put_template.js b/api/api/indices.put_template.js
new file mode 100644
index 000000000..55157756a
--- /dev/null
+++ b/api/api/indices.put_template.js
@@ -0,0 +1,152 @@
+/*
+ * 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 buildIndicesPutTemplate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.put_template](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request
+ *
+ * @param {string} name - The name of the template
+ * @param {boolean} include_type_name - Whether a type should be returned in the body of the mappings.
+ * @param {number} order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
+ * @param {boolean} create - Whether the index template should only be added if new or can also replace an existing one
+ * @param {time} timeout - Explicit operation timeout
+ * @param {time} master_timeout - Specify timeout for connection to master
+ * @param {boolean} flat_settings - Return settings in flat format (default: false)
+ * @param {object} body - The template definition
+ */
+
+ const acceptedQuerystring = [
+ 'include_type_name',
+ 'order',
+ 'create',
+ 'timeout',
+ 'master_timeout',
+ 'flat_settings',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ includeTypeName: 'include_type_name',
+ masterTimeout: 'master_timeout',
+ flatSettings: 'flat_settings',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesPutTemplate (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_template' + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesPutTemplate
diff --git a/api/api/indices.recovery.js b/api/api/indices.recovery.js
new file mode 100644
index 000000000..9fbb6c4ed
--- /dev/null
+++ b/api/api/indices.recovery.js
@@ -0,0 +1,139 @@
+/*
+ * 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 buildIndicesRecovery (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.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 {boolean} detailed - Whether to display detailed information about shard recovery
+ * @param {boolean} active_only - Display only those recoveries that are currently on-going
+ */
+
+ const acceptedQuerystring = [
+ 'detailed',
+ 'active_only',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ activeOnly: 'active_only',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesRecovery (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_recovery'
+ } else {
+ path = '/' + '_recovery'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesRecovery
diff --git a/api/api/indices.refresh.js b/api/api/indices.refresh.js
new file mode 100644
index 000000000..87cbb843d
--- /dev/null
+++ b/api/api/indices.refresh.js
@@ -0,0 +1,143 @@
+/*
+ * 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 buildIndicesRefresh (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.refresh](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.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 {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.
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesRefresh (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_refresh'
+ } else {
+ path = '/' + '_refresh'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesRefresh
diff --git a/api/api/indices.rollover.js b/api/api/indices.rollover.js
new file mode 100644
index 000000000..a2ad11201
--- /dev/null
+++ b/api/api/indices.rollover.js
@@ -0,0 +1,158 @@
+/*
+ * 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 buildIndicesRollover (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.rollover](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html) request
+ *
+ * @param {string} alias - The name of the alias to rollover
+ * @param {string} new_index - The name of the rollover index
+ * @param {boolean} include_type_name - Whether a type should be included in the body of the mappings.
+ * @param {time} timeout - Explicit operation timeout
+ * @param {boolean} dry_run - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false
+ * @param {time} master_timeout - Specify timeout for connection to master
+ * @param {string} wait_for_active_shards - Set the number of active shards to wait for on the newly created rollover index before the operation returns.
+ * @param {object} body - The conditions that needs to be met for executing rollover
+ */
+
+ const acceptedQuerystring = [
+ 'include_type_name',
+ 'timeout',
+ 'dry_run',
+ 'master_timeout',
+ 'wait_for_active_shards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ includeTypeName: 'include_type_name',
+ dryRun: 'dry_run',
+ masterTimeout: 'master_timeout',
+ waitForActiveShards: 'wait_for_active_shards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesRollover (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['alias'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: alias'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['new_index'] != null || params['newIndex'] != null) && (params['alias'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: alias'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, alias, newIndex, new_index } = params
+ var querystring = semicopy(params, ['method', 'body', 'alias', 'newIndex', 'new_index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((alias) != null && (new_index || newIndex) != null) {
+ path = '/' + encodeURIComponent(alias) + '/' + '_rollover' + '/' + encodeURIComponent(new_index || newIndex)
+ } else {
+ path = '/' + encodeURIComponent(alias) + '/' + '_rollover'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesRollover
diff --git a/api/api/indices.segments.js b/api/api/indices.segments.js
new file mode 100644
index 000000000..cc1be5728
--- /dev/null
+++ b/api/api/indices.segments.js
@@ -0,0 +1,145 @@
+/*
+ * 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 buildIndicesSegments (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.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 {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 {boolean} verbose - Includes detailed memory usage by Lucene.
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'verbose',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesSegments (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_segments'
+ } else {
+ path = '/' + '_segments'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesSegments
diff --git a/api/api/indices.shard_stores.js b/api/api/indices.shard_stores.js
new file mode 100644
index 000000000..8add1c770
--- /dev/null
+++ b/api/api/indices.shard_stores.js
@@ -0,0 +1,145 @@
+/*
+ * 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 buildIndicesShardStores (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.shard_stores](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.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} status - A comma-separated list of statuses used to filter on shards to get store information for
+ * @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.
+ */
+
+ const acceptedQuerystring = [
+ 'status',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesShardStores (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_shard_stores'
+ } else {
+ path = '/' + '_shard_stores'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesShardStores
diff --git a/api/api/indices.shrink.js b/api/api/indices.shrink.js
new file mode 100644
index 000000000..3693be4d1
--- /dev/null
+++ b/api/api/indices.shrink.js
@@ -0,0 +1,157 @@
+/*
+ * 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 buildIndicesShrink (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.shrink](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html) request
+ *
+ * @param {string} index - The name of the source index to shrink
+ * @param {string} target - The name of the target index to shrink into
+ * @param {boolean} copy_settings - whether or not to copy settings from the source index (defaults to false)
+ * @param {time} timeout - Explicit operation timeout
+ * @param {time} master_timeout - Specify timeout for connection to master
+ * @param {string} wait_for_active_shards - Set the number of active shards to wait for on the shrunken index before the operation returns.
+ * @param {object} body - The configuration for the target index (`settings` and `aliases`)
+ */
+
+ const acceptedQuerystring = [
+ 'copy_settings',
+ 'timeout',
+ 'master_timeout',
+ 'wait_for_active_shards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ copySettings: 'copy_settings',
+ masterTimeout: 'master_timeout',
+ waitForActiveShards: 'wait_for_active_shards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesShrink (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['target'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: target'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['target'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, target } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'target'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesShrink
diff --git a/api/api/indices.split.js b/api/api/indices.split.js
new file mode 100644
index 000000000..26b6cefd6
--- /dev/null
+++ b/api/api/indices.split.js
@@ -0,0 +1,157 @@
+/*
+ * 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 buildIndicesSplit (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.split](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html) request
+ *
+ * @param {string} index - The name of the source index to split
+ * @param {string} target - The name of the target index to split into
+ * @param {boolean} copy_settings - whether or not to copy settings from the source index (defaults to false)
+ * @param {time} timeout - Explicit operation timeout
+ * @param {time} master_timeout - Specify timeout for connection to master
+ * @param {string} wait_for_active_shards - Set the number of active shards to wait for on the shrunken index before the operation returns.
+ * @param {object} body - The configuration for the target index (`settings` and `aliases`)
+ */
+
+ const acceptedQuerystring = [
+ 'copy_settings',
+ 'timeout',
+ 'master_timeout',
+ 'wait_for_active_shards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ copySettings: 'copy_settings',
+ masterTimeout: 'master_timeout',
+ waitForActiveShards: 'wait_for_active_shards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesSplit (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['target'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: target'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['target'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, target } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'target'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesSplit
diff --git a/api/api/indices.stats.js b/api/api/indices.stats.js
new file mode 100644
index 000000000..3c0b0906f
--- /dev/null
+++ b/api/api/indices.stats.js
@@ -0,0 +1,156 @@
+/*
+ * 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 buildIndicesStats (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.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} metric - Limit the information returned the specific metrics.
+ * @param {list} completion_fields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
+ * @param {list} fielddata_fields - A comma-separated list of fields for `fielddata` index metric (supports wildcards)
+ * @param {list} fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
+ * @param {list} groups - A comma-separated list of search groups for `search` index metric
+ * @param {enum} level - Return stats aggregated at cluster, index or shard level
+ * @param {list} types - A comma-separated list of document types for the `indexing` index metric
+ * @param {boolean} include_segment_file_sizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
+ */
+
+ const acceptedQuerystring = [
+ 'completion_fields',
+ 'fielddata_fields',
+ 'fields',
+ 'groups',
+ 'level',
+ 'types',
+ 'include_segment_file_sizes',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ completionFields: 'completion_fields',
+ fielddataFields: 'fielddata_fields',
+ includeSegmentFileSizes: 'include_segment_file_sizes',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesStats (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, metric } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'metric'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (metric) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_stats' + '/' + encodeURIComponent(metric)
+ } else if ((metric) != null) {
+ path = '/' + '_stats' + '/' + encodeURIComponent(metric)
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_stats'
+ } else {
+ path = '/' + '_stats'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesStats
diff --git a/api/api/indices.unfreeze.js b/api/api/indices.unfreeze.js
new file mode 100644
index 000000000..7c40fb726
--- /dev/null
+++ b/api/api/indices.unfreeze.js
@@ -0,0 +1,146 @@
+/*
+ * 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 buildIndicesUnfreeze (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.unfreeze](https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html) request
+ *
+ * @param {string} index - The name of the index to unfreeze
+ * @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} 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} wait_for_active_shards - Sets the number of active shards to wait for before the operation returns.
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'wait_for_active_shards'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ waitForActiveShards: 'wait_for_active_shards'
+ }
+
+ return function indicesUnfreeze (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_unfreeze'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesUnfreeze
diff --git a/api/api/indices.update_aliases.js b/api/api/indices.update_aliases.js
new file mode 100644
index 000000000..2d9dd6f15
--- /dev/null
+++ b/api/api/indices.update_aliases.js
@@ -0,0 +1,135 @@
+/*
+ * 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 buildIndicesUpdateAliases (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.update_aliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request
+ *
+ * @param {time} timeout - Request timeout
+ * @param {time} master_timeout - Specify timeout for connection to master
+ * @param {object} body - The definition of `actions` to perform
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesUpdateAliases (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_aliases'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesUpdateAliases
diff --git a/api/api/indices.upgrade.js b/api/api/indices.upgrade.js
new file mode 100644
index 000000000..6a16b1691
--- /dev/null
+++ b/api/api/indices.upgrade.js
@@ -0,0 +1,149 @@
+/*
+ * 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 buildIndicesUpgrade (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.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 {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 {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+ * @param {boolean} wait_for_completion - Specify whether the request should block until the all segments are upgraded (default: false)
+ * @param {boolean} only_ancient_segments - If true, only ancient (an older Lucene major release) segments will be upgraded
+ */
+
+ const acceptedQuerystring = [
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'ignore_unavailable',
+ 'wait_for_completion',
+ 'only_ancient_segments',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ ignoreUnavailable: 'ignore_unavailable',
+ waitForCompletion: 'wait_for_completion',
+ onlyAncientSegments: 'only_ancient_segments',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesUpgrade (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
+ } else {
+ path = '/' + '_upgrade'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesUpgrade
diff --git a/api/api/indices.validate_query.js b/api/api/indices.validate_query.js
new file mode 100644
index 000000000..813358340
--- /dev/null
+++ b/api/api/indices.validate_query.js
@@ -0,0 +1,168 @@
+/*
+ * 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 buildIndicesValidateQuery (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [indices.validate_query](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html) request
+ *
+ * @param {list} index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices
+ * @param {list} type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types
+ * @param {boolean} explain - Return detailed information about the error
+ * @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} q - Query in the Lucene query string syntax
+ * @param {string} analyzer - The analyzer to use for the query string
+ * @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
+ * @param {enum} default_operator - The default operator for query string query (AND or OR)
+ * @param {string} df - The field to use as default where no field prefix is given in the query string
+ * @param {boolean} lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+ * @param {boolean} rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed.
+ * @param {boolean} all_shards - Execute validation on all shards instead of one random shard per index
+ * @param {object} body - The query definition specified with the Query DSL
+ */
+
+ const acceptedQuerystring = [
+ 'explain',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'q',
+ 'analyzer',
+ 'analyze_wildcard',
+ 'default_operator',
+ 'df',
+ 'lenient',
+ 'rewrite',
+ 'all_shards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ analyzeWildcard: 'analyze_wildcard',
+ defaultOperator: 'default_operator',
+ allShards: 'all_shards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function indicesValidateQuery (params, options, callback) {
+ options = options || {}
+ if (typeof options === 'function') {
+ callback = options
+ options = {}
+ }
+ if (typeof params === 'function' || params == null) {
+ callback = params
+ params = {}
+ options = {}
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_validate' + '/' + 'query'
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_validate' + '/' + 'query'
+ } else {
+ path = '/' + '_validate' + '/' + 'query'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIndicesValidateQuery
diff --git a/api/api/info.js b/api/api/info.js
new file mode 100644
index 000000000..95e6c55f7
--- /dev/null
+++ b/api/api/info.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildInfo (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [info](http://www.elastic.co/guide/) request
+ *
+ */
+
+ const acceptedQuerystring = [
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function info (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildInfo
diff --git a/api/api/ingest.delete_pipeline.js b/api/api/ingest.delete_pipeline.js
new file mode 100644
index 000000000..303c02ae1
--- /dev/null
+++ b/api/api/ingest.delete_pipeline.js
@@ -0,0 +1,141 @@
+/*
+ * 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 buildIngestDeletePipeline (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ingest.delete_pipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request
+ *
+ * @param {string} id - Pipeline ID
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function ingestDeletePipeline (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIngestDeletePipeline
diff --git a/api/api/ingest.get_pipeline.js b/api/api/ingest.get_pipeline.js
new file mode 100644
index 000000000..2a6aa3938
--- /dev/null
+++ b/api/api/ingest.get_pipeline.js
@@ -0,0 +1,137 @@
+/*
+ * 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 buildIngestGetPipeline (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ingest.get_pipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request
+ *
+ * @param {string} id - Comma separated list of pipeline ids. Wildcards supported
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function ingestGetPipeline (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((id) != null) {
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
+ } else {
+ path = '/' + '_ingest' + '/' + 'pipeline'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIngestGetPipeline
diff --git a/api/api/ingest.processor_grok.js b/api/api/ingest.processor_grok.js
new file mode 100644
index 000000000..d5b47b3d6
--- /dev/null
+++ b/api/api/ingest.processor_grok.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildIngestProcessorGrok (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ingest.processor_grok](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function ingestProcessorGrok (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ingest' + '/' + 'processor' + '/' + 'grok'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIngestProcessorGrok
diff --git a/api/api/ingest.put_pipeline.js b/api/api/ingest.put_pipeline.js
new file mode 100644
index 000000000..13dc50ff3
--- /dev/null
+++ b/api/api/ingest.put_pipeline.js
@@ -0,0 +1,142 @@
+/*
+ * 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 buildIngestPutPipeline (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ingest.put_pipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request
+ *
+ * @param {string} id - Pipeline ID
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {time} timeout - Explicit operation timeout
+ * @param {object} body - The ingest definition
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function ingestPutPipeline (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIngestPutPipeline
diff --git a/api/api/ingest.simulate.js b/api/api/ingest.simulate.js
new file mode 100644
index 000000000..4d8c299f3
--- /dev/null
+++ b/api/api/ingest.simulate.js
@@ -0,0 +1,137 @@
+/*
+ * 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 buildIngestSimulate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request
+ *
+ * @param {string} id - Pipeline ID
+ * @param {boolean} verbose - Verbose mode. Display data output for each processor in executed pipeline
+ * @param {object} body - The simulate definition
+ */
+
+ const acceptedQuerystring = [
+ 'verbose',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function ingestSimulate (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((id) != null) {
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) + '/' + '_simulate'
+ } else {
+ path = '/' + '_ingest' + '/' + 'pipeline' + '/' + '_simulate'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildIngestSimulate
diff --git a/api/api/mget.js b/api/api/mget.js
new file mode 100644
index 000000000..5857ca38c
--- /dev/null
+++ b/api/api/mget.js
@@ -0,0 +1,165 @@
+/*
+ * 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 buildMget (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [mget](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html) request
+ *
+ * @param {string} index - The name of the index
+ * @param {string} type - The type of the document
+ * @param {list} stored_fields - A comma-separated list of stored fields to return in the response
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
+ * @param {boolean} refresh - Refresh the shard containing the document before performing the operation
+ * @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_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 {object} body - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.
+ */
+
+ const acceptedQuerystring = [
+ 'stored_fields',
+ 'preference',
+ 'realtime',
+ 'refresh',
+ 'routing',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ storedFields: 'stored_fields',
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function mget (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget'
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_mget'
+ } else {
+ path = '/' + '_mget'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMget
diff --git a/api/api/ml.close_job.js b/api/api/ml.close_job.js
new file mode 100644
index 000000000..1b923f530
--- /dev/null
+++ b/api/api/ml.close_job.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlCloseJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.close_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html) request
+ *
+ * @param {string} job_id - The name of the job to close
+ * @param {boolean} allow_no_jobs - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
+ * @param {boolean} force - True if the job should be forcefully closed
+ * @param {time} timeout - Controls the time to wait until a job has closed. Default to 30 minutes
+ * @param {object} body - The URL params optionally sent in the body
+ */
+
+ const acceptedQuerystring = [
+ 'allow_no_jobs',
+ 'force',
+ 'timeout'
+ ]
+
+ const snakeCase = {
+ allowNoJobs: 'allow_no_jobs'
+
+ }
+
+ return function mlCloseJob (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_close'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlCloseJob
diff --git a/api/api/ml.delete_calendar.js b/api/api/ml.delete_calendar.js
new file mode 100644
index 000000000..2e270a081
--- /dev/null
+++ b/api/api/ml.delete_calendar.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildMlDeleteCalendar (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.delete_calendar](undefined) request
+ *
+ * @param {string} calendar_id - The ID of the calendar to delete
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlDeleteCalendar (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['calendar_id'] == null && params['calendarId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: calendar_id or calendarId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, calendarId, calendar_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'calendarId', 'calendar_id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlDeleteCalendar
diff --git a/api/api/ml.delete_calendar_event.js b/api/api/ml.delete_calendar_event.js
new file mode 100644
index 000000000..b08e2b8ff
--- /dev/null
+++ b/api/api/ml.delete_calendar_event.js
@@ -0,0 +1,146 @@
+/*
+ * 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 buildMlDeleteCalendarEvent (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.delete_calendar_event](undefined) request
+ *
+ * @param {string} calendar_id - The ID of the calendar to modify
+ * @param {string} event_id - The ID of the event to remove from the calendar
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlDeleteCalendarEvent (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['calendar_id'] == null && params['calendarId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: calendar_id or calendarId'),
+ result
+ )
+ }
+ if (params['event_id'] == null && params['eventId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: event_id or eventId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['event_id'] != null || params['eventId'] != null) && ((params['calendar_id'] == null && params['calendarId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: calendar_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, calendarId, calendar_id, eventId, event_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'calendarId', 'calendar_id', 'eventId', 'event_id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events' + '/' + encodeURIComponent(event_id || eventId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlDeleteCalendarEvent
diff --git a/api/api/ml.delete_calendar_job.js b/api/api/ml.delete_calendar_job.js
new file mode 100644
index 000000000..4db8a932a
--- /dev/null
+++ b/api/api/ml.delete_calendar_job.js
@@ -0,0 +1,146 @@
+/*
+ * 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 buildMlDeleteCalendarJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.delete_calendar_job](undefined) request
+ *
+ * @param {string} calendar_id - The ID of the calendar to modify
+ * @param {string} job_id - The ID of the job to remove from the calendar
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlDeleteCalendarJob (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['calendar_id'] == null && params['calendarId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: calendar_id or calendarId'),
+ result
+ )
+ }
+ if (params['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['job_id'] != null || params['jobId'] != null) && ((params['calendar_id'] == null && params['calendarId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: calendar_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, calendarId, calendar_id, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'calendarId', 'calendar_id', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlDeleteCalendarJob
diff --git a/api/api/ml.delete_datafeed.js b/api/api/ml.delete_datafeed.js
new file mode 100644
index 000000000..4e51efca3
--- /dev/null
+++ b/api/api/ml.delete_datafeed.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlDeleteDatafeed (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.delete_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html) request
+ *
+ * @param {string} datafeed_id - The ID of the datafeed to delete
+ * @param {boolean} force - True if the datafeed should be forcefully deleted
+ */
+
+ const acceptedQuerystring = [
+ 'force'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlDeleteDatafeed (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['datafeed_id'] == null && params['datafeedId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: datafeed_id or datafeedId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, datafeedId, datafeed_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'datafeedId', 'datafeed_id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlDeleteDatafeed
diff --git a/api/api/ml.delete_expired_data.js b/api/api/ml.delete_expired_data.js
new file mode 100644
index 000000000..30ca5cadd
--- /dev/null
+++ b/api/api/ml.delete_expired_data.js
@@ -0,0 +1,124 @@
+/*
+ * 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 buildMlDeleteExpiredData (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.delete_expired_data](undefined) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlDeleteExpiredData (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + '_delete_expired_data'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlDeleteExpiredData
diff --git a/api/api/ml.delete_filter.js b/api/api/ml.delete_filter.js
new file mode 100644
index 000000000..8a3218408
--- /dev/null
+++ b/api/api/ml.delete_filter.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildMlDeleteFilter (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.delete_filter](undefined) request
+ *
+ * @param {string} filter_id - The ID of the filter to delete
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlDeleteFilter (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['filter_id'] == null && params['filterId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: filter_id or filterId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, filterId, filter_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'filterId', 'filter_id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlDeleteFilter
diff --git a/api/api/ml.delete_forecast.js b/api/api/ml.delete_forecast.js
new file mode 100644
index 000000000..85c5d9d80
--- /dev/null
+++ b/api/api/ml.delete_forecast.js
@@ -0,0 +1,148 @@
+/*
+ * 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 buildMlDeleteForecast (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.delete_forecast](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html) request
+ *
+ * @param {string} job_id - The ID of the job from which to delete forecasts
+ * @param {string} forecast_id - The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all`
+ * @param {boolean} allow_no_forecasts - Whether to ignore if `_all` matches no forecasts
+ * @param {time} timeout - Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds
+ */
+
+ const acceptedQuerystring = [
+ 'allow_no_forecasts',
+ 'timeout'
+ ]
+
+ const snakeCase = {
+ allowNoForecasts: 'allow_no_forecasts'
+
+ }
+
+ return function mlDeleteForecast (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['forecast_id'] != null || params['forecastId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: job_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id, forecastId, forecast_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id', 'forecastId', 'forecast_id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((job_id || jobId) != null && (forecast_id || forecastId) != null) {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast' + '/' + encodeURIComponent(forecast_id || forecastId)
+ } else {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlDeleteForecast
diff --git a/api/api/ml.delete_job.js b/api/api/ml.delete_job.js
new file mode 100644
index 000000000..5b692d36b
--- /dev/null
+++ b/api/api/ml.delete_job.js
@@ -0,0 +1,134 @@
+/*
+ * 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 buildMlDeleteJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.delete_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html) request
+ *
+ * @param {string} job_id - The ID of the job to delete
+ * @param {boolean} force - True if the job should be forcefully deleted
+ * @param {boolean} wait_for_completion - Should this request wait until the operation has completed before returning
+ */
+
+ const acceptedQuerystring = [
+ 'force',
+ 'wait_for_completion'
+ ]
+
+ const snakeCase = {
+ waitForCompletion: 'wait_for_completion'
+ }
+
+ return function mlDeleteJob (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlDeleteJob
diff --git a/api/api/ml.delete_model_snapshot.js b/api/api/ml.delete_model_snapshot.js
new file mode 100644
index 000000000..3a13c967c
--- /dev/null
+++ b/api/api/ml.delete_model_snapshot.js
@@ -0,0 +1,146 @@
+/*
+ * 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 buildMlDeleteModelSnapshot (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.delete_model_snapshot](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html) request
+ *
+ * @param {string} job_id - The ID of the job to fetch
+ * @param {string} snapshot_id - The ID of the snapshot to delete
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlDeleteModelSnapshot (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params['snapshot_id'] == null && params['snapshotId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: snapshot_id or snapshotId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: job_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id, snapshotId, snapshot_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id', 'snapshotId', 'snapshot_id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlDeleteModelSnapshot
diff --git a/api/api/ml.find_file_structure.js b/api/api/ml.find_file_structure.js
new file mode 100644
index 000000000..c3cb5179f
--- /dev/null
+++ b/api/api/ml.find_file_structure.js
@@ -0,0 +1,157 @@
+/*
+ * 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 buildMlFindFileStructure (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.find_file_structure](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html) request
+ *
+ * @param {int} lines_to_sample - How many lines of the file should be included in the analysis
+ * @param {time} timeout - Timeout after which the analysis will be aborted
+ * @param {string} charset - Optional parameter to specify the character set of the file
+ * @param {enum} format - Optional parameter to specify the high level file format
+ * @param {boolean} has_header_row - Optional parameter to specify whether a delimited file includes the column names in its first row
+ * @param {list} column_names - Optional parameter containing a comma separated list of the column names for a delimited file
+ * @param {string} delimiter - Optional parameter to specify the delimiter character for a delimited file - must be a single character
+ * @param {string} quote - Optional parameter to specify the quote character for a delimited file - must be a single character
+ * @param {boolean} should_trim_fields - Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them
+ * @param {string} grok_pattern - Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file
+ * @param {string} timestamp_field - Optional parameter to specify the timestamp field in the file
+ * @param {string} timestamp_format - Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format
+ * @param {boolean} explain - Whether to include a commentary on how the structure was derived
+ * @param {object} body - The contents of the file to be analyzed
+ */
+
+ const acceptedQuerystring = [
+ 'lines_to_sample',
+ 'timeout',
+ 'charset',
+ 'format',
+ 'has_header_row',
+ 'column_names',
+ 'delimiter',
+ 'quote',
+ 'should_trim_fields',
+ 'grok_pattern',
+ 'timestamp_field',
+ 'timestamp_format',
+ 'explain'
+ ]
+
+ const snakeCase = {
+ linesToSample: 'lines_to_sample',
+ hasHeaderRow: 'has_header_row',
+ columnNames: 'column_names',
+ shouldTrimFields: 'should_trim_fields',
+ grokPattern: 'grok_pattern',
+ timestampField: 'timestamp_field',
+ timestampFormat: 'timestamp_format'
+
+ }
+
+ return function mlFindFileStructure (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'find_file_structure'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ bulkBody: body,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlFindFileStructure
diff --git a/api/api/ml.flush_job.js b/api/api/ml.flush_job.js
new file mode 100644
index 000000000..b72f9395c
--- /dev/null
+++ b/api/api/ml.flush_job.js
@@ -0,0 +1,137 @@
+/*
+ * 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 buildMlFlushJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.flush_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html) request
+ *
+ * @param {string} job_id - The name of the job to flush
+ * @param {boolean} calc_interim - Calculates interim results for the most recent bucket or all buckets within the latency period
+ * @param {string} start - When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results
+ * @param {string} end - When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results
+ * @param {string} advance_time - Advances time to the given value generating results and updating the model for the advanced interval
+ * @param {string} skip_time - Skips time to the given value without generating results or updating the model for the skipped interval
+ * @param {object} body - Flush parameters
+ */
+
+ const acceptedQuerystring = [
+ 'calc_interim',
+ 'start',
+ 'end',
+ 'advance_time',
+ 'skip_time'
+ ]
+
+ const snakeCase = {
+ calcInterim: 'calc_interim',
+ advanceTime: 'advance_time',
+ skipTime: 'skip_time'
+ }
+
+ return function mlFlushJob (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_flush'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlFlushJob
diff --git a/api/api/ml.forecast.js b/api/api/ml.forecast.js
new file mode 100644
index 000000000..65d03b5f8
--- /dev/null
+++ b/api/api/ml.forecast.js
@@ -0,0 +1,134 @@
+/*
+ * 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 buildMlForecast (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.forecast](undefined) request
+ *
+ * @param {string} job_id - The ID of the job to forecast for
+ * @param {time} duration - The duration of the forecast
+ * @param {time} expires_in - The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity.
+ */
+
+ const acceptedQuerystring = [
+ 'duration',
+ 'expires_in'
+ ]
+
+ const snakeCase = {
+ expiresIn: 'expires_in'
+ }
+
+ return function mlForecast (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlForecast
diff --git a/api/api/ml.get_buckets.js b/api/api/ml.get_buckets.js
new file mode 100644
index 000000000..4d70ccb5f
--- /dev/null
+++ b/api/api/ml.get_buckets.js
@@ -0,0 +1,158 @@
+/*
+ * 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 buildMlGetBuckets (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_buckets](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html) request
+ *
+ * @param {string} job_id - ID of the job to get bucket results from
+ * @param {string} timestamp - The timestamp of the desired single bucket result
+ * @param {boolean} expand - Include anomaly records
+ * @param {boolean} exclude_interim - Exclude interim results
+ * @param {int} from - skips a number of buckets
+ * @param {int} size - specifies a max number of buckets to get
+ * @param {string} start - Start time filter for buckets
+ * @param {string} end - End time filter for buckets
+ * @param {double} anomaly_score - Filter for the most anomalous buckets
+ * @param {string} sort - Sort buckets by a particular field
+ * @param {boolean} desc - Set the sort direction
+ * @param {object} body - Bucket selection details if not provided in URI
+ */
+
+ const acceptedQuerystring = [
+ 'expand',
+ 'exclude_interim',
+ 'from',
+ 'size',
+ 'start',
+ 'end',
+ 'anomaly_score',
+ 'sort',
+ 'desc'
+ ]
+
+ const snakeCase = {
+ excludeInterim: 'exclude_interim',
+ anomalyScore: 'anomaly_score'
+
+ }
+
+ return function mlGetBuckets (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['timestamp'] != null && ((params['job_id'] == null && params['jobId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: job_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id, timestamp } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id', 'timestamp'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((job_id || jobId) != null && (timestamp) != null) {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets' + '/' + encodeURIComponent(timestamp)
+ } else {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetBuckets
diff --git a/api/api/ml.get_calendar_events.js b/api/api/ml.get_calendar_events.js
new file mode 100644
index 000000000..bdc373d30
--- /dev/null
+++ b/api/api/ml.get_calendar_events.js
@@ -0,0 +1,141 @@
+/*
+ * 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 buildMlGetCalendarEvents (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_calendar_events](undefined) request
+ *
+ * @param {string} calendar_id - The ID of the calendar containing the events
+ * @param {string} job_id - Get events for the job. When this option is used calendar_id must be '_all'
+ * @param {string} start - Get events after this time
+ * @param {date} end - Get events before this time
+ * @param {int} from - Skips a number of events
+ * @param {int} size - Specifies a max number of events to get
+ */
+
+ const acceptedQuerystring = [
+ 'job_id',
+ 'start',
+ 'end',
+ 'from',
+ 'size'
+ ]
+
+ const snakeCase = {
+ jobId: 'job_id'
+
+ }
+
+ return function mlGetCalendarEvents (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['calendar_id'] == null && params['calendarId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: calendar_id or calendarId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, calendarId, calendar_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'calendarId', 'calendar_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetCalendarEvents
diff --git a/api/api/ml.get_calendars.js b/api/api/ml.get_calendars.js
new file mode 100644
index 000000000..810145c7f
--- /dev/null
+++ b/api/api/ml.get_calendars.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlGetCalendars (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_calendars](undefined) request
+ *
+ * @param {string} calendar_id - The ID of the calendar to fetch
+ * @param {int} from - skips a number of calendars
+ * @param {int} size - specifies a max number of calendars to get
+ */
+
+ const acceptedQuerystring = [
+ 'from',
+ 'size'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlGetCalendars (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, calendarId, calendar_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'calendarId', 'calendar_id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((calendar_id || calendarId) != null) {
+ path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
+ } else {
+ path = '/' + '_ml' + '/' + 'calendars'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetCalendars
diff --git a/api/api/ml.get_categories.js b/api/api/ml.get_categories.js
new file mode 100644
index 000000000..47c203b3e
--- /dev/null
+++ b/api/api/ml.get_categories.js
@@ -0,0 +1,134 @@
+/*
+ * 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 buildMlGetCategories (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_categories](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html) request
+ *
+ * @param {string} job_id - The name of the job
+ * @param {long} category_id - The identifier of the category definition of interest
+ * @param {int} from - skips a number of categories
+ * @param {int} size - specifies a max number of categories to get
+ * @param {object} body - Category selection details if not provided in URI
+ */
+
+ const acceptedQuerystring = [
+ 'from',
+ 'size'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlGetCategories (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id, categoryId, category_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id', 'categoryId', 'category_id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((job_id || jobId) != null && (category_id || categoryId) != null) {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories' + '/' + encodeURIComponent(category_id || categoryId)
+ } else {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetCategories
diff --git a/api/api/ml.get_datafeed_stats.js b/api/api/ml.get_datafeed_stats.js
new file mode 100644
index 000000000..97c8ea3c0
--- /dev/null
+++ b/api/api/ml.get_datafeed_stats.js
@@ -0,0 +1,130 @@
+/*
+ * 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 buildMlGetDatafeedStats (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_datafeed_stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html) request
+ *
+ * @param {string} datafeed_id - The ID of the datafeeds stats to fetch
+ * @param {boolean} allow_no_datafeeds - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
+ */
+
+ const acceptedQuerystring = [
+ 'allow_no_datafeeds'
+ ]
+
+ const snakeCase = {
+ allowNoDatafeeds: 'allow_no_datafeeds'
+ }
+
+ return function mlGetDatafeedStats (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, datafeedId, datafeed_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'datafeedId', 'datafeed_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((datafeed_id || datafeedId) != null) {
+ path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stats'
+ } else {
+ path = '/' + '_ml' + '/' + 'datafeeds' + '/' + '_stats'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetDatafeedStats
diff --git a/api/api/ml.get_datafeeds.js b/api/api/ml.get_datafeeds.js
new file mode 100644
index 000000000..ae88fb528
--- /dev/null
+++ b/api/api/ml.get_datafeeds.js
@@ -0,0 +1,130 @@
+/*
+ * 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 buildMlGetDatafeeds (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_datafeeds](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html) request
+ *
+ * @param {string} datafeed_id - The ID of the datafeeds to fetch
+ * @param {boolean} allow_no_datafeeds - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
+ */
+
+ const acceptedQuerystring = [
+ 'allow_no_datafeeds'
+ ]
+
+ const snakeCase = {
+ allowNoDatafeeds: 'allow_no_datafeeds'
+ }
+
+ return function mlGetDatafeeds (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, datafeedId, datafeed_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'datafeedId', 'datafeed_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((datafeed_id || datafeedId) != null) {
+ path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
+ } else {
+ path = '/' + '_ml' + '/' + 'datafeeds'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetDatafeeds
diff --git a/api/api/ml.get_filters.js b/api/api/ml.get_filters.js
new file mode 100644
index 000000000..5666cf902
--- /dev/null
+++ b/api/api/ml.get_filters.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlGetFilters (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_filters](undefined) request
+ *
+ * @param {string} filter_id - The ID of the filter to fetch
+ * @param {int} from - skips a number of filters
+ * @param {int} size - specifies a max number of filters to get
+ */
+
+ const acceptedQuerystring = [
+ 'from',
+ 'size'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlGetFilters (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, filterId, filter_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'filterId', 'filter_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((filter_id || filterId) != null) {
+ path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
+ } else {
+ path = '/' + '_ml' + '/' + 'filters'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetFilters
diff --git a/api/api/ml.get_influencers.js b/api/api/ml.get_influencers.js
new file mode 100644
index 000000000..498f13d20
--- /dev/null
+++ b/api/api/ml.get_influencers.js
@@ -0,0 +1,143 @@
+/*
+ * 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 buildMlGetInfluencers (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_influencers](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html) request
+ *
+ * @param {string} job_id -
+ * @param {boolean} exclude_interim - Exclude interim results
+ * @param {int} from - skips a number of influencers
+ * @param {int} size - specifies a max number of influencers to get
+ * @param {string} start - start timestamp for the requested influencers
+ * @param {string} end - end timestamp for the requested influencers
+ * @param {double} influencer_score - influencer score threshold for the requested influencers
+ * @param {string} sort - sort field for the requested influencers
+ * @param {boolean} desc - whether the results should be sorted in decending order
+ * @param {object} body - Influencer selection criteria
+ */
+
+ const acceptedQuerystring = [
+ 'exclude_interim',
+ 'from',
+ 'size',
+ 'start',
+ 'end',
+ 'influencer_score',
+ 'sort',
+ 'desc'
+ ]
+
+ const snakeCase = {
+ excludeInterim: 'exclude_interim',
+ influencerScore: 'influencer_score'
+
+ }
+
+ return function mlGetInfluencers (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'influencers'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetInfluencers
diff --git a/api/api/ml.get_job_stats.js b/api/api/ml.get_job_stats.js
new file mode 100644
index 000000000..7c8e8b653
--- /dev/null
+++ b/api/api/ml.get_job_stats.js
@@ -0,0 +1,130 @@
+/*
+ * 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 buildMlGetJobStats (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_job_stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html) request
+ *
+ * @param {string} job_id - The ID of the jobs stats to fetch
+ * @param {boolean} allow_no_jobs - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
+ */
+
+ const acceptedQuerystring = [
+ 'allow_no_jobs'
+ ]
+
+ const snakeCase = {
+ allowNoJobs: 'allow_no_jobs'
+ }
+
+ return function mlGetJobStats (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((job_id || jobId) != null) {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_stats'
+ } else {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_stats'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetJobStats
diff --git a/api/api/ml.get_jobs.js b/api/api/ml.get_jobs.js
new file mode 100644
index 000000000..fcb8734c7
--- /dev/null
+++ b/api/api/ml.get_jobs.js
@@ -0,0 +1,130 @@
+/*
+ * 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 buildMlGetJobs (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_jobs](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html) request
+ *
+ * @param {string} job_id - The ID of the jobs to fetch
+ * @param {boolean} allow_no_jobs - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
+ */
+
+ const acceptedQuerystring = [
+ 'allow_no_jobs'
+ ]
+
+ const snakeCase = {
+ allowNoJobs: 'allow_no_jobs'
+ }
+
+ return function mlGetJobs (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((job_id || jobId) != null) {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
+ } else {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetJobs
diff --git a/api/api/ml.get_model_snapshots.js b/api/api/ml.get_model_snapshots.js
new file mode 100644
index 000000000..f9b2aae7d
--- /dev/null
+++ b/api/api/ml.get_model_snapshots.js
@@ -0,0 +1,150 @@
+/*
+ * 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 buildMlGetModelSnapshots (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_model_snapshots](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html) request
+ *
+ * @param {string} job_id - The ID of the job to fetch
+ * @param {string} snapshot_id - The ID of the snapshot to fetch
+ * @param {int} from - Skips a number of documents
+ * @param {int} size - The default number of documents returned in queries as a string.
+ * @param {date} start - The filter 'start' query parameter
+ * @param {date} end - The filter 'end' query parameter
+ * @param {string} sort - Name of the field to sort on
+ * @param {boolean} desc - True if the results should be sorted in descending order
+ * @param {object} body - Model snapshot selection criteria
+ */
+
+ const acceptedQuerystring = [
+ 'from',
+ 'size',
+ 'start',
+ 'end',
+ 'sort',
+ 'desc'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlGetModelSnapshots (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: job_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id, snapshotId, snapshot_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id', 'snapshotId', 'snapshot_id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((job_id || jobId) != null && (snapshot_id || snapshotId) != null) {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId)
+ } else {
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetModelSnapshots
diff --git a/api/api/ml.get_overall_buckets.js b/api/api/ml.get_overall_buckets.js
new file mode 100644
index 000000000..d5e647590
--- /dev/null
+++ b/api/api/ml.get_overall_buckets.js
@@ -0,0 +1,143 @@
+/*
+ * 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 buildMlGetOverallBuckets (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_overall_buckets](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html) request
+ *
+ * @param {string} job_id - The job IDs for which to calculate overall bucket results
+ * @param {int} top_n - The number of top job bucket scores to be used in the overall_score calculation
+ * @param {string} bucket_span - The span of the overall buckets. Defaults to the longest job bucket_span
+ * @param {double} overall_score - Returns overall buckets with overall scores higher than this value
+ * @param {boolean} exclude_interim - If true overall buckets that include interim buckets will be excluded
+ * @param {string} start - Returns overall buckets with timestamps after this time
+ * @param {string} end - Returns overall buckets with timestamps earlier than this time
+ * @param {boolean} allow_no_jobs - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
+ * @param {object} body - Overall bucket selection details if not provided in URI
+ */
+
+ const acceptedQuerystring = [
+ 'top_n',
+ 'bucket_span',
+ 'overall_score',
+ 'exclude_interim',
+ 'start',
+ 'end',
+ 'allow_no_jobs'
+ ]
+
+ const snakeCase = {
+ topN: 'top_n',
+ bucketSpan: 'bucket_span',
+ overallScore: 'overall_score',
+ excludeInterim: 'exclude_interim',
+ allowNoJobs: 'allow_no_jobs'
+ }
+
+ return function mlGetOverallBuckets (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'overall_buckets'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetOverallBuckets
diff --git a/api/api/ml.get_records.js b/api/api/ml.get_records.js
new file mode 100644
index 000000000..e38213f0f
--- /dev/null
+++ b/api/api/ml.get_records.js
@@ -0,0 +1,143 @@
+/*
+ * 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 buildMlGetRecords (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.get_records](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html) request
+ *
+ * @param {string} job_id -
+ * @param {boolean} exclude_interim - Exclude interim results
+ * @param {int} from - skips a number of records
+ * @param {int} size - specifies a max number of records to get
+ * @param {string} start - Start time filter for records
+ * @param {string} end - End time filter for records
+ * @param {double} record_score -
+ * @param {string} sort - Sort records by a particular field
+ * @param {boolean} desc - Set the sort direction
+ * @param {object} body - Record selection criteria
+ */
+
+ const acceptedQuerystring = [
+ 'exclude_interim',
+ 'from',
+ 'size',
+ 'start',
+ 'end',
+ 'record_score',
+ 'sort',
+ 'desc'
+ ]
+
+ const snakeCase = {
+ excludeInterim: 'exclude_interim',
+ recordScore: 'record_score'
+
+ }
+
+ return function mlGetRecords (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'records'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlGetRecords
diff --git a/api/api/ml.info.js b/api/api/ml.info.js
new file mode 100644
index 000000000..55c7c9e0e
--- /dev/null
+++ b/api/api/ml.info.js
@@ -0,0 +1,116 @@
+/*
+ * 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 buildMlInfo (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.info](undefined) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlInfo (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'info'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlInfo
diff --git a/api/api/ml.open_job.js b/api/api/ml.open_job.js
new file mode 100644
index 000000000..81f92ae12
--- /dev/null
+++ b/api/api/ml.open_job.js
@@ -0,0 +1,133 @@
+/*
+ * 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 buildMlOpenJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.open_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html) request
+ *
+ * @param {string} job_id - The ID of the job to open
+ * @param {boolean} ignore_downtime - Controls if gaps in data are treated as anomalous or as a maintenance window after a job re-start
+ * @param {time} timeout - Controls the time to wait until a job has opened. Default to 30 minutes
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlOpenJob (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id, ignoreDowntime, ignore_downtime, timeout } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id', 'ignoreDowntime', 'ignore_downtime', 'timeout'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_open'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlOpenJob
diff --git a/api/api/ml.post_calendar_events.js b/api/api/ml.post_calendar_events.js
new file mode 100644
index 000000000..a99b009da
--- /dev/null
+++ b/api/api/ml.post_calendar_events.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlPostCalendarEvents (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.post_calendar_events](undefined) request
+ *
+ * @param {string} calendar_id - The ID of the calendar to modify
+ * @param {object} body - A list of events
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlPostCalendarEvents (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['calendar_id'] == null && params['calendarId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: calendar_id or calendarId'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, calendarId, calendar_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'calendarId', 'calendar_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlPostCalendarEvents
diff --git a/api/api/ml.post_data.js b/api/api/ml.post_data.js
new file mode 100644
index 000000000..702ad50a2
--- /dev/null
+++ b/api/api/ml.post_data.js
@@ -0,0 +1,136 @@
+/*
+ * 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 buildMlPostData (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.post_data](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html) request
+ *
+ * @param {string} job_id - The name of the job receiving the data
+ * @param {string} reset_start - Optional parameter to specify the start of the bucket resetting range
+ * @param {string} reset_end - Optional parameter to specify the end of the bucket resetting range
+ * @param {object} body - The data to process
+ */
+
+ const acceptedQuerystring = [
+ 'reset_start',
+ 'reset_end'
+ ]
+
+ const snakeCase = {
+ resetStart: 'reset_start',
+ resetEnd: 'reset_end'
+ }
+
+ return function mlPostData (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_data'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlPostData
diff --git a/api/api/ml.preview_datafeed.js b/api/api/ml.preview_datafeed.js
new file mode 100644
index 000000000..c7b68045c
--- /dev/null
+++ b/api/api/ml.preview_datafeed.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildMlPreviewDatafeed (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.preview_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html) request
+ *
+ * @param {string} datafeed_id - The ID of the datafeed to preview
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlPreviewDatafeed (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['datafeed_id'] == null && params['datafeedId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: datafeed_id or datafeedId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, datafeedId, datafeed_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'datafeedId', 'datafeed_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_preview'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlPreviewDatafeed
diff --git a/api/api/ml.put_calendar.js b/api/api/ml.put_calendar.js
new file mode 100644
index 000000000..a47f770ce
--- /dev/null
+++ b/api/api/ml.put_calendar.js
@@ -0,0 +1,126 @@
+/*
+ * 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 buildMlPutCalendar (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.put_calendar](undefined) request
+ *
+ * @param {string} calendar_id - The ID of the calendar to create
+ * @param {object} body - The calendar details
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlPutCalendar (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['calendar_id'] == null && params['calendarId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: calendar_id or calendarId'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, calendarId, calendar_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'calendarId', 'calendar_id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlPutCalendar
diff --git a/api/api/ml.put_calendar_job.js b/api/api/ml.put_calendar_job.js
new file mode 100644
index 000000000..7c23f126f
--- /dev/null
+++ b/api/api/ml.put_calendar_job.js
@@ -0,0 +1,146 @@
+/*
+ * 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 buildMlPutCalendarJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.put_calendar_job](undefined) request
+ *
+ * @param {string} calendar_id - The ID of the calendar to modify
+ * @param {string} job_id - The ID of the job to add to the calendar
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlPutCalendarJob (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['calendar_id'] == null && params['calendarId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: calendar_id or calendarId'),
+ result
+ )
+ }
+ if (params['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['job_id'] != null || params['jobId'] != null) && ((params['calendar_id'] == null && params['calendarId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: calendar_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, calendarId, calendar_id, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'calendarId', 'calendar_id', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlPutCalendarJob
diff --git a/api/api/ml.put_datafeed.js b/api/api/ml.put_datafeed.js
new file mode 100644
index 000000000..4a6856c83
--- /dev/null
+++ b/api/api/ml.put_datafeed.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlPutDatafeed (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.put_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html) request
+ *
+ * @param {string} datafeed_id - The ID of the datafeed to create
+ * @param {object} body - The datafeed config
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlPutDatafeed (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['datafeed_id'] == null && params['datafeedId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: datafeed_id or datafeedId'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, datafeedId, datafeed_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'datafeedId', 'datafeed_id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlPutDatafeed
diff --git a/api/api/ml.put_filter.js b/api/api/ml.put_filter.js
new file mode 100644
index 000000000..63d2b3ec9
--- /dev/null
+++ b/api/api/ml.put_filter.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlPutFilter (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.put_filter](undefined) request
+ *
+ * @param {string} filter_id - The ID of the filter to create
+ * @param {object} body - The filter details
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlPutFilter (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['filter_id'] == null && params['filterId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: filter_id or filterId'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, filterId, filter_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'filterId', 'filter_id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlPutFilter
diff --git a/api/api/ml.put_job.js b/api/api/ml.put_job.js
new file mode 100644
index 000000000..f5f363974
--- /dev/null
+++ b/api/api/ml.put_job.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlPutJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.put_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html) request
+ *
+ * @param {string} job_id - The ID of the job to create
+ * @param {object} body - The job
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlPutJob (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlPutJob
diff --git a/api/api/ml.revert_model_snapshot.js b/api/api/ml.revert_model_snapshot.js
new file mode 100644
index 000000000..81a70e0db
--- /dev/null
+++ b/api/api/ml.revert_model_snapshot.js
@@ -0,0 +1,142 @@
+/*
+ * 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 buildMlRevertModelSnapshot (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.revert_model_snapshot](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html) request
+ *
+ * @param {string} job_id - The ID of the job to fetch
+ * @param {string} snapshot_id - The ID of the snapshot to revert to
+ * @param {boolean} delete_intervening_results - Should we reset the results back to the time of the snapshot?
+ * @param {object} body - Reversion options
+ */
+
+ const acceptedQuerystring = [
+ 'delete_intervening_results'
+ ]
+
+ const snakeCase = {
+ deleteInterveningResults: 'delete_intervening_results'
+ }
+
+ return function mlRevertModelSnapshot (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params['snapshot_id'] == null && params['snapshotId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: snapshot_id or snapshotId'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: job_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id, snapshotId, snapshot_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id', 'snapshotId', 'snapshot_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_revert'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlRevertModelSnapshot
diff --git a/api/api/ml.set_upgrade_mode.js b/api/api/ml.set_upgrade_mode.js
new file mode 100644
index 000000000..cd95163a2
--- /dev/null
+++ b/api/api/ml.set_upgrade_mode.js
@@ -0,0 +1,127 @@
+/*
+ * 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 buildMlSetUpgradeMode (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.set_upgrade_mode](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html) request
+ *
+ * @param {boolean} enabled - Whether to enable upgrade_mode ML setting or not. Defaults to false.
+ * @param {time} timeout - Controls the time to wait before action times out. Defaults to 30 seconds
+ */
+
+ const acceptedQuerystring = [
+ 'enabled',
+ 'timeout'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlSetUpgradeMode (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'set_upgrade_mode'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlSetUpgradeMode
diff --git a/api/api/ml.start_datafeed.js b/api/api/ml.start_datafeed.js
new file mode 100644
index 000000000..1ca6a7362
--- /dev/null
+++ b/api/api/ml.start_datafeed.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildMlStartDatafeed (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.start_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html) request
+ *
+ * @param {string} datafeed_id - The ID of the datafeed to start
+ * @param {string} start - The start time from where the datafeed should begin
+ * @param {string} end - The end time when the datafeed should stop. When not set, the datafeed continues in real time
+ * @param {time} timeout - Controls the time to wait until a datafeed has started. Default to 20 seconds
+ * @param {object} body - The start datafeed parameters
+ */
+
+ const acceptedQuerystring = [
+ 'start',
+ 'end',
+ 'timeout'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlStartDatafeed (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['datafeed_id'] == null && params['datafeedId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: datafeed_id or datafeedId'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, datafeedId, datafeed_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'datafeedId', 'datafeed_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_start'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlStartDatafeed
diff --git a/api/api/ml.stop_datafeed.js b/api/api/ml.stop_datafeed.js
new file mode 100644
index 000000000..13515e966
--- /dev/null
+++ b/api/api/ml.stop_datafeed.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildMlStopDatafeed (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.stop_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html) request
+ *
+ * @param {string} datafeed_id - The ID of the datafeed to stop
+ * @param {boolean} allow_no_datafeeds - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
+ * @param {boolean} force - True if the datafeed should be forcefully stopped.
+ * @param {time} timeout - Controls the time to wait until a datafeed has stopped. Default to 20 seconds
+ */
+
+ const acceptedQuerystring = [
+ 'allow_no_datafeeds',
+ 'force',
+ 'timeout'
+ ]
+
+ const snakeCase = {
+ allowNoDatafeeds: 'allow_no_datafeeds'
+
+ }
+
+ return function mlStopDatafeed (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['datafeed_id'] == null && params['datafeedId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: datafeed_id or datafeedId'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, datafeedId, datafeed_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'datafeedId', 'datafeed_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stop'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlStopDatafeed
diff --git a/api/api/ml.update_datafeed.js b/api/api/ml.update_datafeed.js
new file mode 100644
index 000000000..e2e800fa2
--- /dev/null
+++ b/api/api/ml.update_datafeed.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlUpdateDatafeed (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.update_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html) request
+ *
+ * @param {string} datafeed_id - The ID of the datafeed to update
+ * @param {object} body - The datafeed update settings
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlUpdateDatafeed (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['datafeed_id'] == null && params['datafeedId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: datafeed_id or datafeedId'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, datafeedId, datafeed_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'datafeedId', 'datafeed_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_update'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlUpdateDatafeed
diff --git a/api/api/ml.update_filter.js b/api/api/ml.update_filter.js
new file mode 100644
index 000000000..b50f1cc3a
--- /dev/null
+++ b/api/api/ml.update_filter.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlUpdateFilter (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.update_filter](undefined) request
+ *
+ * @param {string} filter_id - The ID of the filter to update
+ * @param {object} body - The filter update
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlUpdateFilter (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['filter_id'] == null && params['filterId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: filter_id or filterId'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, filterId, filter_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'filterId', 'filter_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId) + '/' + '_update'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlUpdateFilter
diff --git a/api/api/ml.update_job.js b/api/api/ml.update_job.js
new file mode 100644
index 000000000..f315e41af
--- /dev/null
+++ b/api/api/ml.update_job.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildMlUpdateJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.update_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html) request
+ *
+ * @param {string} job_id - The ID of the job to create
+ * @param {object} body - The job update settings
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlUpdateJob (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_update'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlUpdateJob
diff --git a/api/api/ml.update_model_snapshot.js b/api/api/ml.update_model_snapshot.js
new file mode 100644
index 000000000..7d44400e5
--- /dev/null
+++ b/api/api/ml.update_model_snapshot.js
@@ -0,0 +1,147 @@
+/*
+ * 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 buildMlUpdateModelSnapshot (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.update_model_snapshot](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html) request
+ *
+ * @param {string} job_id - The ID of the job to fetch
+ * @param {string} snapshot_id - The ID of the snapshot to update
+ * @param {object} body - The model snapshot properties to update
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlUpdateModelSnapshot (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['job_id'] == null && params['jobId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: job_id or jobId'),
+ result
+ )
+ }
+ if (params['snapshot_id'] == null && params['snapshotId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: snapshot_id or snapshotId'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: job_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, jobId, job_id, snapshotId, snapshot_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'jobId', 'job_id', 'snapshotId', 'snapshot_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_update'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlUpdateModelSnapshot
diff --git a/api/api/ml.validate.js b/api/api/ml.validate.js
new file mode 100644
index 000000000..2f1401f3e
--- /dev/null
+++ b/api/api/ml.validate.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildMlValidate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.validate](undefined) request
+ *
+ * @param {object} body - The job config
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlValidate (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_validate'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlValidate
diff --git a/api/api/ml.validate_detector.js b/api/api/ml.validate_detector.js
new file mode 100644
index 000000000..07570ddc6
--- /dev/null
+++ b/api/api/ml.validate_detector.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildMlValidateDetector (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ml.validate_detector](undefined) request
+ *
+ * @param {object} body - The detector
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function mlValidateDetector (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_validate' + '/' + 'detector'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMlValidateDetector
diff --git a/api/api/monitoring.bulk.js b/api/api/monitoring.bulk.js
new file mode 100644
index 000000000..082c26acb
--- /dev/null
+++ b/api/api/monitoring.bulk.js
@@ -0,0 +1,137 @@
+/*
+ * 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 buildMonitoringBulk (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [monitoring.bulk](http://www.elastic.co/guide/en/monitoring/current/appendix-api-bulk.html) request
+ *
+ * @param {string} type - Default document type for items which don't provide one
+ * @param {string} system_id - Identifier of the monitored system
+ * @param {string} system_api_version - API Version of the monitored system
+ * @param {string} interval - Collection interval (e.g., '10s' or '10000ms') of the payload
+ * @param {object} body - The operation definition and data (action-data pairs), separated by newlines
+ */
+
+ const acceptedQuerystring = [
+ 'system_id',
+ 'system_api_version',
+ 'interval'
+ ]
+
+ const snakeCase = {
+ systemId: 'system_id',
+ systemApiVersion: 'system_api_version'
+
+ }
+
+ return function monitoringBulk (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'type'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((type) != null) {
+ path = '/' + '_monitoring' + '/' + encodeURIComponent(type) + '/' + 'bulk'
+ } else {
+ path = '/' + '_monitoring' + '/' + 'bulk'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ bulkBody: body,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMonitoringBulk
diff --git a/api/api/msearch.js b/api/api/msearch.js
new file mode 100644
index 000000000..a10558174
--- /dev/null
+++ b/api/api/msearch.js
@@ -0,0 +1,167 @@
+/*
+ * 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 buildMsearch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [msearch](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html) request
+ *
+ * @param {list} index - A comma-separated list of index names to use as default
+ * @param {list} type - A comma-separated list of document types to use as default
+ * @param {enum} search_type - Search operation type
+ * @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute
+ * @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ * @param {number} pre_filter_shard_size - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
+ * @param {number} max_concurrent_shard_requests - The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
+ * @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+ * @param {boolean} ccs_minimize_roundtrips - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
+ * @param {object} body - The request definitions (metadata-search request definition pairs), separated by newlines
+ */
+
+ const acceptedQuerystring = [
+ 'search_type',
+ 'max_concurrent_searches',
+ 'typed_keys',
+ 'pre_filter_shard_size',
+ 'max_concurrent_shard_requests',
+ 'rest_total_hits_as_int',
+ 'ccs_minimize_roundtrips',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ searchType: 'search_type',
+ maxConcurrentSearches: 'max_concurrent_searches',
+ typedKeys: 'typed_keys',
+ preFilterShardSize: 'pre_filter_shard_size',
+ maxConcurrentShardRequests: 'max_concurrent_shard_requests',
+ restTotalHitsAsInt: 'rest_total_hits_as_int',
+ ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function msearch (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch'
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_msearch'
+ } else {
+ path = '/' + '_msearch'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ bulkBody: body,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMsearch
diff --git a/api/api/msearch_template.js b/api/api/msearch_template.js
new file mode 100644
index 000000000..5fd848d92
--- /dev/null
+++ b/api/api/msearch_template.js
@@ -0,0 +1,161 @@
+/*
+ * 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 buildMsearchTemplate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [msearch_template](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html) request
+ *
+ * @param {list} index - A comma-separated list of index names to use as default
+ * @param {list} type - A comma-separated list of document types to use as default
+ * @param {enum} search_type - Search operation type
+ * @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ * @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute
+ * @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+ * @param {boolean} ccs_minimize_roundtrips - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
+ * @param {object} body - The request definitions (metadata-search request definition pairs), separated by newlines
+ */
+
+ const acceptedQuerystring = [
+ 'search_type',
+ 'typed_keys',
+ 'max_concurrent_searches',
+ 'rest_total_hits_as_int',
+ 'ccs_minimize_roundtrips',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ searchType: 'search_type',
+ typedKeys: 'typed_keys',
+ maxConcurrentSearches: 'max_concurrent_searches',
+ restTotalHitsAsInt: 'rest_total_hits_as_int',
+ ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function msearchTemplate (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template'
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template'
+ } else {
+ path = '/' + '_msearch' + '/' + 'template'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ bulkBody: body,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMsearchTemplate
diff --git a/api/api/mtermvectors.js b/api/api/mtermvectors.js
new file mode 100644
index 000000000..ceb3a089c
--- /dev/null
+++ b/api/api/mtermvectors.js
@@ -0,0 +1,167 @@
+/*
+ * 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 buildMtermvectors (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [mtermvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html) request
+ *
+ * @param {string} index - The index in which the document resides.
+ * @param {string} type - The type of the document.
+ * @param {list} ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
+ * @param {boolean} term_statistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+ * @param {boolean} field_statistics - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+ * @param {list} fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+ * @param {boolean} offsets - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+ * @param {boolean} positions - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+ * @param {boolean} payloads - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs".
+ * @param {string} routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+ * @param {string} parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+ * @param {boolean} realtime - Specifies if requests are real-time as opposed to near-real-time (default: true).
+ * @param {number} version - Explicit version number for concurrency control
+ * @param {enum} version_type - Specific version type
+ * @param {object} body - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.
+ */
+
+ const acceptedQuerystring = [
+ 'ids',
+ 'term_statistics',
+ 'field_statistics',
+ 'fields',
+ 'offsets',
+ 'positions',
+ 'payloads',
+ 'preference',
+ 'routing',
+ 'parent',
+ 'realtime',
+ 'version',
+ 'version_type',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ termStatistics: 'term_statistics',
+ fieldStatistics: 'field_statistics',
+ versionType: 'version_type',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function mtermvectors (params, options, callback) {
+ options = options || {}
+ if (typeof options === 'function') {
+ callback = options
+ options = {}
+ }
+ if (typeof params === 'function' || params == null) {
+ callback = params
+ params = {}
+ options = {}
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors'
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors'
+ } else {
+ path = '/' + '_mtermvectors'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildMtermvectors
diff --git a/api/api/nodes.hot_threads.js b/api/api/nodes.hot_threads.js
new file mode 100644
index 000000000..e78ea5213
--- /dev/null
+++ b/api/api/nodes.hot_threads.js
@@ -0,0 +1,153 @@
+/*
+ * 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 buildNodesHotThreads (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [nodes.hot_threads](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.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 {time} interval - The interval for the second sampling of threads
+ * @param {number} snapshots - Number of samples of thread stacktrace (default: 10)
+ * @param {number} threads - Specify the number of threads to provide information for (default: 3)
+ * @param {boolean} ignore_idle_threads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)
+ * @param {enum} type - The type to sample (default: cpu)
+ * @param {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'interval',
+ 'snapshots',
+ 'threads',
+ 'ignore_idle_threads',
+ 'type',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreIdleThreads: 'ignore_idle_threads',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function nodesHotThreads (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, nodeId, node_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'nodeId', 'node_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((node_id || nodeId) != null) {
+ path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
+ } else if ((node_id || nodeId) != null) {
+ path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
+ } else if ((node_id || nodeId) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
+ } else if ((node_id || nodeId) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
+ } else {
+ path = '/' + '_cluster' + '/' + 'nodes' + '/' + 'hotthreads'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildNodesHotThreads
diff --git a/api/api/nodes.info.js b/api/api/nodes.info.js
new file mode 100644
index 000000000..41cbd98ce
--- /dev/null
+++ b/api/api/nodes.info.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildNodesInfo (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [nodes.info](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.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} metric - A comma-separated list of metrics you wish returned. Leave empty to return all.
+ * @param {boolean} flat_settings - Return settings in flat format (default: false)
+ * @param {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'flat_settings',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ flatSettings: 'flat_settings',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function nodesInfo (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, nodeId, node_id, metric } = params
+ var querystring = semicopy(params, ['method', 'body', 'nodeId', 'node_id', 'metric'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((node_id || nodeId) != null && (metric) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + encodeURIComponent(metric)
+ } else if ((node_id || nodeId) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId)
+ } else if ((metric) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(metric)
+ } else {
+ path = '/' + '_nodes'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildNodesInfo
diff --git a/api/api/nodes.reload_secure_settings.js b/api/api/nodes.reload_secure_settings.js
new file mode 100644
index 000000000..a9fee39e7
--- /dev/null
+++ b/api/api/nodes.reload_secure_settings.js
@@ -0,0 +1,136 @@
+/*
+ * 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 buildNodesReloadSecureSettings (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [nodes.reload_secure_settings](https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings) request
+ *
+ * @param {list} node_id - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
+ * @param {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function nodesReloadSecureSettings (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, nodeId, node_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'nodeId', 'node_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((node_id || nodeId) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'reload_secure_settings'
+ } else {
+ path = '/' + '_nodes' + '/' + 'reload_secure_settings'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildNodesReloadSecureSettings
diff --git a/api/api/nodes.stats.js b/api/api/nodes.stats.js
new file mode 100644
index 000000000..f84e583de
--- /dev/null
+++ b/api/api/nodes.stats.js
@@ -0,0 +1,163 @@
+/*
+ * 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 buildNodesStats (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [nodes.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html) request
+ *
+ * @param {list} metric - Limit the information returned to the specified metrics
+ * @param {list} index_metric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified.
+ * @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} completion_fields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
+ * @param {list} fielddata_fields - A comma-separated list of fields for `fielddata` index metric (supports wildcards)
+ * @param {list} fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
+ * @param {boolean} groups - A comma-separated list of search groups for `search` index metric
+ * @param {enum} level - Return indices stats aggregated at index, node or shard level
+ * @param {list} types - A comma-separated list of document types for the `indexing` index metric
+ * @param {time} timeout - Explicit operation timeout
+ * @param {boolean} include_segment_file_sizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
+ */
+
+ const acceptedQuerystring = [
+ 'completion_fields',
+ 'fielddata_fields',
+ 'fields',
+ 'groups',
+ 'level',
+ 'types',
+ 'timeout',
+ 'include_segment_file_sizes',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ completionFields: 'completion_fields',
+ fielddataFields: 'fielddata_fields',
+ includeSegmentFileSizes: 'include_segment_file_sizes',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function nodesStats (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, metric, indexMetric, index_metric, nodeId, node_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'metric', 'indexMetric', 'index_metric', 'nodeId', 'node_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((node_id || nodeId) != null && (metric) != null && (index_metric || indexMetric) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index_metric || indexMetric)
+ } else if ((node_id || nodeId) != null && (metric) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats' + '/' + encodeURIComponent(metric)
+ } else if ((metric) != null && (index_metric || indexMetric) != null) {
+ path = '/' + '_nodes' + '/' + 'stats' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index_metric || indexMetric)
+ } else if ((node_id || nodeId) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats'
+ } else if ((metric) != null) {
+ path = '/' + '_nodes' + '/' + 'stats' + '/' + encodeURIComponent(metric)
+ } else {
+ path = '/' + '_nodes' + '/' + 'stats'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildNodesStats
diff --git a/api/api/nodes.usage.js b/api/api/nodes.usage.js
new file mode 100644
index 000000000..783066665
--- /dev/null
+++ b/api/api/nodes.usage.js
@@ -0,0 +1,141 @@
+/*
+ * 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 buildNodesUsage (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [nodes.usage](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html) request
+ *
+ * @param {list} metric - Limit the information returned to the specified metrics
+ * @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 {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function nodesUsage (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, metric, nodeId, node_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'metric', 'nodeId', 'node_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((node_id || nodeId) != null && (metric) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'usage' + '/' + encodeURIComponent(metric)
+ } else if ((node_id || nodeId) != null) {
+ path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'usage'
+ } else if ((metric) != null) {
+ path = '/' + '_nodes' + '/' + 'usage' + '/' + encodeURIComponent(metric)
+ } else {
+ path = '/' + '_nodes' + '/' + 'usage'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildNodesUsage
diff --git a/api/api/ping.js b/api/api/ping.js
new file mode 100644
index 000000000..e696c1568
--- /dev/null
+++ b/api/api/ping.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildPing (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ping](http://www.elastic.co/guide/) request
+ *
+ */
+
+ const acceptedQuerystring = [
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function ping (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'HEAD'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildPing
diff --git a/api/api/put_script.js b/api/api/put_script.js
new file mode 100644
index 000000000..993e2130e
--- /dev/null
+++ b/api/api/put_script.js
@@ -0,0 +1,157 @@
+/*
+ * 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 buildPutScript (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [put_script](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request
+ *
+ * @param {string} id - Script ID
+ * @param {string} context - Script context
+ * @param {time} timeout - Explicit operation timeout
+ * @param {time} master_timeout - Specify timeout for connection to master
+ * @param {string} context - Context name to compile script against
+ * @param {object} body - The document
+ */
+
+ const acceptedQuerystring = [
+ 'timeout',
+ 'master_timeout',
+ 'context',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function putScript (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['context'] != null && (params['id'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, context } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'context'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((id) != null && (context) != null) {
+ path = '/' + '_scripts' + '/' + encodeURIComponent(id) + '/' + encodeURIComponent(context)
+ } else {
+ path = '/' + '_scripts' + '/' + encodeURIComponent(id)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildPutScript
diff --git a/api/api/rank_eval.js b/api/api/rank_eval.js
new file mode 100644
index 000000000..e3c3f39dc
--- /dev/null
+++ b/api/api/rank_eval.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildRankEval (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [rank_eval](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.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 {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 {object} body - The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function rankEval (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_rank_eval'
+ } else {
+ path = '/' + '_rank_eval'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildRankEval
diff --git a/api/api/reindex.js b/api/api/reindex.js
new file mode 100644
index 000000000..535fc265e
--- /dev/null
+++ b/api/api/reindex.js
@@ -0,0 +1,145 @@
+/*
+ * 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 buildReindex (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request
+ *
+ * @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 {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the reindex 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 {boolean} wait_for_completion - Should the request should block until the reindex is complete.
+ * @param {number} requests_per_second - The throttle to set on 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 {object} body - The search definition using the Query DSL and the prototype for the index request.
+ */
+
+ const acceptedQuerystring = [
+ 'refresh',
+ 'timeout',
+ 'wait_for_active_shards',
+ 'wait_for_completion',
+ 'requests_per_second',
+ 'slices',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ waitForActiveShards: 'wait_for_active_shards',
+ waitForCompletion: 'wait_for_completion',
+ requestsPerSecond: 'requests_per_second',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function reindex (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_reindex'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildReindex
diff --git a/api/api/reindex_rethrottle.js b/api/api/reindex_rethrottle.js
new file mode 100644
index 000000000..4bdf99863
--- /dev/null
+++ b/api/api/reindex_rethrottle.js
@@ -0,0 +1,145 @@
+/*
+ * 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 buildReindexRethrottle (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [reindex_rethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.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 reindexRethrottle (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: task_id or taskId'),
+ result
+ )
+ }
+ if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, taskId, task_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'taskId', 'task_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_reindex' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildReindexRethrottle
diff --git a/api/api/render_search_template.js b/api/api/render_search_template.js
new file mode 100644
index 000000000..8936dc4f9
--- /dev/null
+++ b/api/api/render_search_template.js
@@ -0,0 +1,127 @@
+/*
+ * 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 buildRenderSearchTemplate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [render_search_template](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html) request
+ *
+ * @param {string} id - The id of the stored search template
+ * @param {object} body - The search definition template and its params
+ */
+
+ const acceptedQuerystring = [
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function renderSearchTemplate (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((id) != null) {
+ path = '/' + '_render' + '/' + 'template' + '/' + encodeURIComponent(id)
+ } else {
+ path = '/' + '_render' + '/' + 'template'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildRenderSearchTemplate
diff --git a/api/api/scripts_painless_execute.js b/api/api/scripts_painless_execute.js
new file mode 100644
index 000000000..0a0a8ae25
--- /dev/null
+++ b/api/api/scripts_painless_execute.js
@@ -0,0 +1,122 @@
+/*
+ * 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 buildScriptsPainlessExecute (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [scripts_painless_execute](https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html) request
+ *
+ * @param {object} body - The script to execute
+ */
+
+ const acceptedQuerystring = [
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function scriptsPainlessExecute (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_scripts' + '/' + 'painless' + '/' + '_execute'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildScriptsPainlessExecute
diff --git a/api/api/scroll.js b/api/api/scroll.js
new file mode 100644
index 000000000..beff548d2
--- /dev/null
+++ b/api/api/scroll.js
@@ -0,0 +1,135 @@
+/*
+ * 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 buildScroll (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request
+ *
+ * @param {string} scroll_id - The scroll ID
+ * @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
+ * @param {string} scroll_id - The scroll ID for scrolled search
+ * @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+ * @param {object} body - The scroll ID if not passed by URL or query parameter.
+ */
+
+ const acceptedQuerystring = [
+ 'scroll',
+ 'scroll_id',
+ 'rest_total_hits_as_int',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ scrollId: 'scroll_id',
+ restTotalHitsAsInt: 'rest_total_hits_as_int',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function scroll (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, scrollId, scroll_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'scrollId', 'scroll_id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((scroll_id || scrollId) != null) {
+ path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
+ } else {
+ path = '/' + '_search' + '/' + 'scroll'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildScroll
diff --git a/api/api/search.js b/api/api/search.js
new file mode 100644
index 000000000..e5b3cdfa9
--- /dev/null
+++ b/api/api/search.js
@@ -0,0 +1,249 @@
+/*
+ * 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 buildSearch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [search](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.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} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
+ * @param {string} analyzer - The analyzer to use for the query string
+ * @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
+ * @param {boolean} ccs_minimize_roundtrips - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
+ * @param {enum} default_operator - The default operator for query string query (AND or OR)
+ * @param {string} df - The field to use as default where no field prefix is given in the query string
+ * @param {boolean} explain - Specify whether to return detailed information about score computation as part of a hit
+ * @param {list} stored_fields - A comma-separated list of stored fields to return as part of a hit
+ * @param {list} docvalue_fields - A comma-separated list of fields to return as the docvalue representation of a field for each hit
+ * @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_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 {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 {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {string} q - Query in the Lucene query string syntax
+ * @param {list} routing - A comma-separated list of specific routing values
+ * @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
+ * @param {enum} search_type - Search operation type
+ * @param {number} size - Number of hits to return (default: 10)
+ * @param {list} sort - A comma-separated list of : pairs
+ * @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 {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 {string} suggest_field - Specify which field to use for suggestions
+ * @param {enum} suggest_mode - Specify suggest mode
+ * @param {number} suggest_size - How many suggestions to return in response
+ * @param {string} suggest_text - The source text for which the suggestions should be returned
+ * @param {time} timeout - Explicit operation timeout
+ * @param {boolean} track_scores - Whether to calculate and return scores even if they are not used for sorting
+ * @param {boolean} track_total_hits - Indicate if the number of documents that match the query should be tracked
+ * @param {boolean} allow_partial_search_results - Indicate if an error should be returned if there is a partial search failure or timeout
+ * @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ * @param {boolean} version - Specify whether to return document version as part of a hit
+ * @param {boolean} seq_no_primary_term - Specify whether to return sequence number and primary term of the last modification of each hit
+ * @param {boolean} request_cache - Specify if request cache should be used for this request or not, defaults to index level setting
+ * @param {number} batched_reduce_size - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
+ * @param {number} max_concurrent_shard_requests - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
+ * @param {number} pre_filter_shard_size - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
+ * @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+ * @param {object} body - The search definition using the Query DSL
+ */
+
+ const acceptedQuerystring = [
+ 'analyzer',
+ 'analyze_wildcard',
+ 'ccs_minimize_roundtrips',
+ 'default_operator',
+ 'df',
+ 'explain',
+ 'stored_fields',
+ 'docvalue_fields',
+ 'from',
+ 'ignore_unavailable',
+ 'ignore_throttled',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'lenient',
+ 'preference',
+ 'q',
+ 'routing',
+ 'scroll',
+ 'search_type',
+ 'size',
+ 'sort',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'terminate_after',
+ 'stats',
+ 'suggest_field',
+ 'suggest_mode',
+ 'suggest_size',
+ 'suggest_text',
+ 'timeout',
+ 'track_scores',
+ 'track_total_hits',
+ 'allow_partial_search_results',
+ 'typed_keys',
+ 'version',
+ 'seq_no_primary_term',
+ 'request_cache',
+ 'batched_reduce_size',
+ 'max_concurrent_shard_requests',
+ 'pre_filter_shard_size',
+ 'rest_total_hits_as_int',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ analyzeWildcard: 'analyze_wildcard',
+ ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
+ defaultOperator: 'default_operator',
+ storedFields: 'stored_fields',
+ docvalueFields: 'docvalue_fields',
+ ignoreUnavailable: 'ignore_unavailable',
+ ignoreThrottled: 'ignore_throttled',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ searchType: 'search_type',
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ terminateAfter: 'terminate_after',
+ suggestField: 'suggest_field',
+ suggestMode: 'suggest_mode',
+ suggestSize: 'suggest_size',
+ suggestText: 'suggest_text',
+ trackScores: 'track_scores',
+ trackTotalHits: 'track_total_hits',
+ allowPartialSearchResults: 'allow_partial_search_results',
+ typedKeys: 'typed_keys',
+ seqNoPrimaryTerm: 'seq_no_primary_term',
+ requestCache: 'request_cache',
+ batchedReduceSize: 'batched_reduce_size',
+ maxConcurrentShardRequests: 'max_concurrent_shard_requests',
+ preFilterShardSize: 'pre_filter_shard_size',
+ restTotalHitsAsInt: 'rest_total_hits_as_int',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function search (params, options, callback) {
+ options = options || {}
+ if (typeof options === 'function') {
+ callback = options
+ options = {}
+ }
+ if (typeof params === 'function' || params == null) {
+ callback = params
+ params = {}
+ options = {}
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search'
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_search'
+ } else {
+ path = '/' + '_search'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSearch
diff --git a/api/api/search_shards.js b/api/api/search_shards.js
new file mode 100644
index 000000000..4ae9034ad
--- /dev/null
+++ b/api/api/search_shards.js
@@ -0,0 +1,149 @@
+/*
+ * 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 buildSearchShards (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [search_shards](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.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 {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {string} routing - Specific routing value
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ * @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.
+ */
+
+ const acceptedQuerystring = [
+ 'preference',
+ 'routing',
+ 'local',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function searchShards (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_search_shards'
+ } else {
+ path = '/' + '_search_shards'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSearchShards
diff --git a/api/api/search_template.js b/api/api/search_template.js
new file mode 100644
index 000000000..466d669c1
--- /dev/null
+++ b/api/api/search_template.js
@@ -0,0 +1,180 @@
+/*
+ * 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 buildSearchTemplate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [search_template](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.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} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
+ * @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 {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {list} routing - A comma-separated list of specific routing values
+ * @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
+ * @param {enum} search_type - Search operation type
+ * @param {boolean} explain - Specify whether to return detailed information about score computation as part of a hit
+ * @param {boolean} profile - Specify whether to profile the query execution
+ * @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ * @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+ * @param {boolean} ccs_minimize_roundtrips - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
+ * @param {object} body - The search definition template and its params
+ */
+
+ const acceptedQuerystring = [
+ 'ignore_unavailable',
+ 'ignore_throttled',
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'preference',
+ 'routing',
+ 'scroll',
+ 'search_type',
+ 'explain',
+ 'profile',
+ 'typed_keys',
+ 'rest_total_hits_as_int',
+ 'ccs_minimize_roundtrips',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ ignoreUnavailable: 'ignore_unavailable',
+ ignoreThrottled: 'ignore_throttled',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ searchType: 'search_type',
+ typedKeys: 'typed_keys',
+ restTotalHitsAsInt: 'rest_total_hits_as_int',
+ ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function searchTemplate (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + '/' + 'template'
+ } else if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template'
+ } else {
+ path = '/' + '_search' + '/' + 'template'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSearchTemplate
diff --git a/api/api/security.authenticate.js b/api/api/security.authenticate.js
new file mode 100644
index 000000000..da504bdc4
--- /dev/null
+++ b/api/api/security.authenticate.js
@@ -0,0 +1,124 @@
+/*
+ * 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 buildSecurityAuthenticate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.authenticate](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityAuthenticate (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + '_authenticate'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityAuthenticate
diff --git a/api/api/security.change_password.js b/api/api/security.change_password.js
new file mode 100644
index 000000000..569dbf449
--- /dev/null
+++ b/api/api/security.change_password.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildSecurityChangePassword (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.change_password](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html) request
+ *
+ * @param {string} username - The username of the user to change the password for
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ * @param {object} body - the new password for the user
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityChangePassword (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, username } = params
+ var querystring = semicopy(params, ['method', 'body', 'username'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((username) != null) {
+ path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_password'
+ } else {
+ path = '/' + '_security' + '/' + 'user' + '/' + '_password'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityChangePassword
diff --git a/api/api/security.clear_cached_realms.js b/api/api/security.clear_cached_realms.js
new file mode 100644
index 000000000..97af5dcaf
--- /dev/null
+++ b/api/api/security.clear_cached_realms.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildSecurityClearCachedRealms (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.clear_cached_realms](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html) request
+ *
+ * @param {list} realms - Comma-separated list of realms to clear
+ * @param {list} usernames - Comma-separated list of usernames to clear from the cache
+ */
+
+ const acceptedQuerystring = [
+ 'usernames'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityClearCachedRealms (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['realms'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: realms'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, realms } = params
+ var querystring = semicopy(params, ['method', 'body', 'realms'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'realm' + '/' + encodeURIComponent(realms) + '/' + '_clear_cache'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityClearCachedRealms
diff --git a/api/api/security.clear_cached_roles.js b/api/api/security.clear_cached_roles.js
new file mode 100644
index 000000000..1741e5e1f
--- /dev/null
+++ b/api/api/security.clear_cached_roles.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildSecurityClearCachedRoles (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.clear_cached_roles](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html) request
+ *
+ * @param {list} name - Role name
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityClearCachedRoles (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name) + '/' + '_clear_cache'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityClearCachedRoles
diff --git a/api/api/security.create_api_key.js b/api/api/security.create_api_key.js
new file mode 100644
index 000000000..b5dd7e597
--- /dev/null
+++ b/api/api/security.create_api_key.js
@@ -0,0 +1,126 @@
+/*
+ * 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 buildSecurityCreateApiKey (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.create_api_key](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html) request
+ *
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ * @param {object} body - The api key request to create an API key
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityCreateApiKey (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'api_key'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityCreateApiKey
diff --git a/api/api/security.delete_privileges.js b/api/api/security.delete_privileges.js
new file mode 100644
index 000000000..fa54275d3
--- /dev/null
+++ b/api/api/security.delete_privileges.js
@@ -0,0 +1,147 @@
+/*
+ * 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 buildSecurityDeletePrivileges (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.delete_privileges](TODO) request
+ *
+ * @param {string} application - Application name
+ * @param {string} name - Privilege name
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityDeletePrivileges (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['application'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: application'),
+ result
+ )
+ }
+ if (params['name'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['name'] != null && (params['application'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: application'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, application, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'application', 'name'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityDeletePrivileges
diff --git a/api/api/security.delete_role.js b/api/api/security.delete_role.js
new file mode 100644
index 000000000..f8046d046
--- /dev/null
+++ b/api/api/security.delete_role.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildSecurityDeleteRole (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.delete_role](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html) request
+ *
+ * @param {string} name - Role name
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityDeleteRole (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityDeleteRole
diff --git a/api/api/security.delete_role_mapping.js b/api/api/security.delete_role_mapping.js
new file mode 100644
index 000000000..269c7a87d
--- /dev/null
+++ b/api/api/security.delete_role_mapping.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildSecurityDeleteRoleMapping (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.delete_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html) request
+ *
+ * @param {string} name - Role-mapping name
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityDeleteRoleMapping (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityDeleteRoleMapping
diff --git a/api/api/security.delete_user.js b/api/api/security.delete_user.js
new file mode 100644
index 000000000..f89bb0fb9
--- /dev/null
+++ b/api/api/security.delete_user.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildSecurityDeleteUser (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.delete_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html) request
+ *
+ * @param {string} username - username
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityDeleteUser (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['username'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: username'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, username } = params
+ var querystring = semicopy(params, ['method', 'body', 'username'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityDeleteUser
diff --git a/api/api/security.disable_user.js b/api/api/security.disable_user.js
new file mode 100644
index 000000000..e7f1bccde
--- /dev/null
+++ b/api/api/security.disable_user.js
@@ -0,0 +1,126 @@
+/*
+ * 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 buildSecurityDisableUser (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.disable_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html) request
+ *
+ * @param {string} username - The username of the user to disable
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityDisableUser (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, username } = params
+ var querystring = semicopy(params, ['method', 'body', 'username'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_disable'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityDisableUser
diff --git a/api/api/security.enable_user.js b/api/api/security.enable_user.js
new file mode 100644
index 000000000..58a49c9d6
--- /dev/null
+++ b/api/api/security.enable_user.js
@@ -0,0 +1,126 @@
+/*
+ * 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 buildSecurityEnableUser (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.enable_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html) request
+ *
+ * @param {string} username - The username of the user to enable
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityEnableUser (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, username } = params
+ var querystring = semicopy(params, ['method', 'body', 'username'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_enable'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityEnableUser
diff --git a/api/api/security.get_api_key.js b/api/api/security.get_api_key.js
new file mode 100644
index 000000000..4d3d97769
--- /dev/null
+++ b/api/api/security.get_api_key.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildSecurityGetApiKey (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.get_api_key](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html) request
+ *
+ * @param {string} id - API key id of the API key to be retrieved
+ * @param {string} name - API key name of the API key to be retrieved
+ * @param {string} username - user name of the user who created this API key to be retrieved
+ * @param {string} realm_name - realm name of the user who created this API key to be retrieved
+ */
+
+ const acceptedQuerystring = [
+ 'id',
+ 'name',
+ 'username',
+ 'realm_name'
+ ]
+
+ const snakeCase = {
+ realmName: 'realm_name'
+ }
+
+ return function securityGetApiKey (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'api_key'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityGetApiKey
diff --git a/api/api/security.get_privileges.js b/api/api/security.get_privileges.js
new file mode 100644
index 000000000..d285b6822
--- /dev/null
+++ b/api/api/security.get_privileges.js
@@ -0,0 +1,140 @@
+/*
+ * 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 buildSecurityGetPrivileges (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.get_privileges](TODO) request
+ *
+ * @param {string} application - Application name
+ * @param {string} name - Privilege name
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityGetPrivileges (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['name'] != null && (params['application'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: application'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, application, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'application', 'name'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if (application && name) {
+ path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
+ } else if (application) {
+ path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application)
+ } else {
+ path = '/' + '_security' + '/' + 'privilege'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityGetPrivileges
diff --git a/api/api/security.get_role.js b/api/api/security.get_role.js
new file mode 100644
index 000000000..24e2f384d
--- /dev/null
+++ b/api/api/security.get_role.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildSecurityGetRole (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.get_role](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html) request
+ *
+ * @param {string} name - Role name
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityGetRole (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((name) != null) {
+ path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
+ } else {
+ path = '/' + '_security' + '/' + 'role'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityGetRole
diff --git a/api/api/security.get_role_mapping.js b/api/api/security.get_role_mapping.js
new file mode 100644
index 000000000..c56e81f8b
--- /dev/null
+++ b/api/api/security.get_role_mapping.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildSecurityGetRoleMapping (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.get_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html) request
+ *
+ * @param {string} name - Role-Mapping name
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityGetRoleMapping (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((name) != null) {
+ path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
+ } else {
+ path = '/' + '_security' + '/' + 'role_mapping'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityGetRoleMapping
diff --git a/api/api/security.get_token.js b/api/api/security.get_token.js
new file mode 100644
index 000000000..32ea01902
--- /dev/null
+++ b/api/api/security.get_token.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildSecurityGetToken (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.get_token](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html) request
+ *
+ * @param {object} body - The token request to get
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityGetToken (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'oauth2' + '/' + 'token'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityGetToken
diff --git a/api/api/security.get_user.js b/api/api/security.get_user.js
new file mode 100644
index 000000000..6f29262a2
--- /dev/null
+++ b/api/api/security.get_user.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildSecurityGetUser (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.get_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html) request
+ *
+ * @param {list} username - A comma-separated list of usernames
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityGetUser (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, username } = params
+ var querystring = semicopy(params, ['method', 'body', 'username'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((username) != null) {
+ path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)
+ } else {
+ path = '/' + '_security' + '/' + 'user'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityGetUser
diff --git a/api/api/security.get_user_privileges.js b/api/api/security.get_user_privileges.js
new file mode 100644
index 000000000..7a79ef740
--- /dev/null
+++ b/api/api/security.get_user_privileges.js
@@ -0,0 +1,124 @@
+/*
+ * 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 buildSecurityGetUserPrivileges (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.get_user_privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityGetUserPrivileges (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'user' + '/' + '_privileges'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityGetUserPrivileges
diff --git a/api/api/security.has_privileges.js b/api/api/security.has_privileges.js
new file mode 100644
index 000000000..78987c6b8
--- /dev/null
+++ b/api/api/security.has_privileges.js
@@ -0,0 +1,130 @@
+/*
+ * 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 buildSecurityHasPrivileges (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.has_privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html) request
+ *
+ * @param {string} user - Username
+ * @param {object} body - The privileges to test
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityHasPrivileges (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, user } = params
+ var querystring = semicopy(params, ['method', 'body', 'user'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((user) != null) {
+ path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(user) + '/' + '_has_privileges'
+ } else {
+ path = '/' + '_security' + '/' + 'user' + '/' + '_has_privileges'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityHasPrivileges
diff --git a/api/api/security.invalidate_api_key.js b/api/api/security.invalidate_api_key.js
new file mode 100644
index 000000000..1d4a7f877
--- /dev/null
+++ b/api/api/security.invalidate_api_key.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildSecurityInvalidateApiKey (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.invalidate_api_key](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html) request
+ *
+ * @param {object} body - The api key request to invalidate API key(s)
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityInvalidateApiKey (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'api_key'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityInvalidateApiKey
diff --git a/api/api/security.invalidate_token.js b/api/api/security.invalidate_token.js
new file mode 100644
index 000000000..fa2043b2c
--- /dev/null
+++ b/api/api/security.invalidate_token.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildSecurityInvalidateToken (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.invalidate_token](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html) request
+ *
+ * @param {object} body - The token to invalidate
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityInvalidateToken (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'oauth2' + '/' + 'token'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityInvalidateToken
diff --git a/api/api/security.put_privileges.js b/api/api/security.put_privileges.js
new file mode 100644
index 000000000..c08e9aa01
--- /dev/null
+++ b/api/api/security.put_privileges.js
@@ -0,0 +1,126 @@
+/*
+ * 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 buildSecurityPutPrivileges (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.put_privileges](TODO) request
+ *
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ * @param {object} body - The privilege(s) to add
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityPutPrivileges (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'privilege'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityPutPrivileges
diff --git a/api/api/security.put_role.js b/api/api/security.put_role.js
new file mode 100644
index 000000000..6bd851141
--- /dev/null
+++ b/api/api/security.put_role.js
@@ -0,0 +1,133 @@
+/*
+ * 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 buildSecurityPutRole (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.put_role](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html) request
+ *
+ * @param {string} name - Role name
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ * @param {object} body - The role to add
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityPutRole (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityPutRole
diff --git a/api/api/security.put_role_mapping.js b/api/api/security.put_role_mapping.js
new file mode 100644
index 000000000..c6450d155
--- /dev/null
+++ b/api/api/security.put_role_mapping.js
@@ -0,0 +1,133 @@
+/*
+ * 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 buildSecurityPutRoleMapping (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.put_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html) request
+ *
+ * @param {string} name - Role-mapping name
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ * @param {object} body - The role to add
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityPutRoleMapping (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: name'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, name } = params
+ var querystring = semicopy(params, ['method', 'body', 'name'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityPutRoleMapping
diff --git a/api/api/security.put_user.js b/api/api/security.put_user.js
new file mode 100644
index 000000000..16fb9182d
--- /dev/null
+++ b/api/api/security.put_user.js
@@ -0,0 +1,133 @@
+/*
+ * 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 buildSecurityPutUser (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [security.put_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html) request
+ *
+ * @param {string} username - The username of the User
+ * @param {enum} refresh - If `true` (the default) 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` then do nothing with refreshes.
+ * @param {object} body - The user to add
+ */
+
+ const acceptedQuerystring = [
+ 'refresh'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function securityPutUser (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['username'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: username'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, username } = params
+ var querystring = semicopy(params, ['method', 'body', 'username'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSecurityPutUser
diff --git a/api/api/snapshot.create.js b/api/api/snapshot.create.js
new file mode 100644
index 000000000..016a9fee6
--- /dev/null
+++ b/api/api/snapshot.create.js
@@ -0,0 +1,152 @@
+/*
+ * 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 buildSnapshotCreate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [snapshot.create](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
+ *
+ * @param {string} repository - A repository name
+ * @param {string} snapshot - A snapshot name
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {boolean} wait_for_completion - Should this request wait until the operation has completed before returning
+ * @param {object} body - The snapshot definition
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'wait_for_completion',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ waitForCompletion: 'wait_for_completion',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function snapshotCreate (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['repository'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: repository'),
+ result
+ )
+ }
+ if (params['snapshot'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: snapshot'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['snapshot'] != null && (params['repository'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: repository'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository, snapshot } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository', 'snapshot'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSnapshotCreate
diff --git a/api/api/snapshot.create_repository.js b/api/api/snapshot.create_repository.js
new file mode 100644
index 000000000..284f1e821
--- /dev/null
+++ b/api/api/snapshot.create_repository.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildSnapshotCreateRepository (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [snapshot.create_repository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
+ *
+ * @param {string} repository - A repository name
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {time} timeout - Explicit operation timeout
+ * @param {boolean} verify - Whether to verify the repository after creation
+ * @param {object} body - The repository definition
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'timeout',
+ 'verify',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function snapshotCreateRepository (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['repository'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: repository'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSnapshotCreateRepository
diff --git a/api/api/snapshot.delete.js b/api/api/snapshot.delete.js
new file mode 100644
index 000000000..036535eb7
--- /dev/null
+++ b/api/api/snapshot.delete.js
@@ -0,0 +1,154 @@
+/*
+ * 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 buildSnapshotDelete (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [snapshot.delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
+ *
+ * @param {string} repository - A repository name
+ * @param {string} snapshot - A snapshot name
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function snapshotDelete (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['repository'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: repository'),
+ result
+ )
+ }
+ if (params['snapshot'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: snapshot'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['snapshot'] != null && (params['repository'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: repository'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository, snapshot } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository', 'snapshot'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSnapshotDelete
diff --git a/api/api/snapshot.delete_repository.js b/api/api/snapshot.delete_repository.js
new file mode 100644
index 000000000..b552268c8
--- /dev/null
+++ b/api/api/snapshot.delete_repository.js
@@ -0,0 +1,141 @@
+/*
+ * 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 buildSnapshotDeleteRepository (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [snapshot.delete_repository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
+ *
+ * @param {list} repository - A comma-separated list of repository names
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function snapshotDeleteRepository (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['repository'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: repository'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSnapshotDeleteRepository
diff --git a/api/api/snapshot.get.js b/api/api/snapshot.get.js
new file mode 100644
index 000000000..f05948fea
--- /dev/null
+++ b/api/api/snapshot.get.js
@@ -0,0 +1,159 @@
+/*
+ * 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 buildSnapshotGet (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [snapshot.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
+ *
+ * @param {string} repository - A repository name
+ * @param {list} snapshot - A comma-separated list of snapshot names
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {boolean} ignore_unavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
+ * @param {boolean} verbose - Whether to show verbose snapshot info or only show the basic info found in the repository index blob
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'ignore_unavailable',
+ 'verbose',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function snapshotGet (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['repository'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: repository'),
+ result
+ )
+ }
+ if (params['snapshot'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: snapshot'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['snapshot'] != null && (params['repository'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: repository'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository, snapshot } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository', 'snapshot'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSnapshotGet
diff --git a/api/api/snapshot.get_repository.js b/api/api/snapshot.get_repository.js
new file mode 100644
index 000000000..1b0b32129
--- /dev/null
+++ b/api/api/snapshot.get_repository.js
@@ -0,0 +1,139 @@
+/*
+ * 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 buildSnapshotGetRepository (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [snapshot.get_repository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
+ *
+ * @param {list} repository - A comma-separated list of repository names
+ * @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)
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'local',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function snapshotGetRepository (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((repository) != null) {
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
+ } else {
+ path = '/' + '_snapshot'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSnapshotGetRepository
diff --git a/api/api/snapshot.restore.js b/api/api/snapshot.restore.js
new file mode 100644
index 000000000..13865283f
--- /dev/null
+++ b/api/api/snapshot.restore.js
@@ -0,0 +1,152 @@
+/*
+ * 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 buildSnapshotRestore (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [snapshot.restore](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
+ *
+ * @param {string} repository - A repository name
+ * @param {string} snapshot - A snapshot name
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {boolean} wait_for_completion - Should this request wait until the operation has completed before returning
+ * @param {object} body - Details of what to restore
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'wait_for_completion',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ waitForCompletion: 'wait_for_completion',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function snapshotRestore (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['repository'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: repository'),
+ result
+ )
+ }
+ if (params['snapshot'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: snapshot'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['snapshot'] != null && (params['repository'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: repository'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository, snapshot } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository', 'snapshot'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_restore'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSnapshotRestore
diff --git a/api/api/snapshot.status.js b/api/api/snapshot.status.js
new file mode 100644
index 000000000..cb3536c40
--- /dev/null
+++ b/api/api/snapshot.status.js
@@ -0,0 +1,151 @@
+/*
+ * 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 buildSnapshotStatus (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [snapshot.status](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
+ *
+ * @param {string} repository - A repository name
+ * @param {list} snapshot - A comma-separated list of snapshot names
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {boolean} ignore_unavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'ignore_unavailable',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ ignoreUnavailable: 'ignore_unavailable',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function snapshotStatus (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['snapshot'] != null && (params['repository'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: repository'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository, snapshot } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository', 'snapshot'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((repository) != null && (snapshot) != null) {
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_status'
+ } else if ((repository) != null) {
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_status'
+ } else {
+ path = '/' + '_snapshot' + '/' + '_status'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSnapshotStatus
diff --git a/api/api/snapshot.verify_repository.js b/api/api/snapshot.verify_repository.js
new file mode 100644
index 000000000..12db7c034
--- /dev/null
+++ b/api/api/snapshot.verify_repository.js
@@ -0,0 +1,141 @@
+/*
+ * 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 buildSnapshotVerifyRepository (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [snapshot.verify_repository](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
+ *
+ * @param {string} repository - A repository name
+ * @param {time} master_timeout - Explicit operation timeout for connection to master node
+ * @param {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function snapshotVerifyRepository (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['repository'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: repository'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, repository } = params
+ var querystring = semicopy(params, ['method', 'body', 'repository'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_verify'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSnapshotVerifyRepository
diff --git a/api/api/ssl.certificates.js b/api/api/ssl.certificates.js
new file mode 100644
index 000000000..7e876c609
--- /dev/null
+++ b/api/api/ssl.certificates.js
@@ -0,0 +1,124 @@
+/*
+ * 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 buildSslCertificates (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [ssl.certificates](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function sslCertificates (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_ssl' + '/' + 'certificates'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildSslCertificates
diff --git a/api/api/tasks.cancel.js b/api/api/tasks.cancel.js
new file mode 100644
index 000000000..2d226efd9
--- /dev/null
+++ b/api/api/tasks.cancel.js
@@ -0,0 +1,141 @@
+/*
+ * 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 buildTasksCancel (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [tasks.cancel](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
+ *
+ * @param {string} task_id - Cancel the task with specified task id (node_id:task_number)
+ * @param {list} nodes - 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 cancelled. Leave empty to cancel all.
+ * @param {string} parent_task_id - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.
+ */
+
+ const acceptedQuerystring = [
+ 'nodes',
+ 'actions',
+ 'parent_task_id',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ parentTaskId: 'parent_task_id',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function tasksCancel (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, taskId, task_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'taskId', 'task_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((task_id || taskId) != null) {
+ path = '/' + '_tasks' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_cancel'
+ } else {
+ path = '/' + '_tasks' + '/' + '_cancel'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildTasksCancel
diff --git a/api/api/tasks.get.js b/api/api/tasks.get.js
new file mode 100644
index 000000000..032ca29a8
--- /dev/null
+++ b/api/api/tasks.get.js
@@ -0,0 +1,141 @@
+/*
+ * 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 buildTasksGet (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [tasks.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
+ *
+ * @param {string} task_id - Return the task with specified id (node_id:task_number)
+ * @param {boolean} wait_for_completion - Wait for the matching tasks to complete (default: false)
+ * @param {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'wait_for_completion',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ waitForCompletion: 'wait_for_completion',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function tasksGet (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: task_id or taskId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, taskId, task_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'taskId', 'task_id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_tasks' + '/' + encodeURIComponent(task_id || taskId)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildTasksGet
diff --git a/api/api/tasks.list.js b/api/api/tasks.list.js
new file mode 100644
index 000000000..2d9362434
--- /dev/null
+++ b/api/api/tasks.list.js
@@ -0,0 +1,146 @@
+/*
+ * 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 buildTasksList (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [tasks.list](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
+ *
+ * @param {list} nodes - 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 {boolean} detailed - Return detailed task information (default: false)
+ * @param {string} parent_task_id - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.
+ * @param {boolean} wait_for_completion - Wait for the matching tasks to complete (default: false)
+ * @param {enum} group_by - Group tasks by nodes or parent/child relationships
+ * @param {time} timeout - Explicit operation timeout
+ */
+
+ const acceptedQuerystring = [
+ 'nodes',
+ 'actions',
+ 'detailed',
+ 'parent_task_id',
+ 'wait_for_completion',
+ 'group_by',
+ 'timeout',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ parentTaskId: 'parent_task_id',
+ waitForCompletion: 'wait_for_completion',
+ groupBy: 'group_by',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function tasksList (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_tasks'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildTasksList
diff --git a/api/api/termvectors.js b/api/api/termvectors.js
new file mode 100644
index 000000000..cb8a10d3e
--- /dev/null
+++ b/api/api/termvectors.js
@@ -0,0 +1,168 @@
+/*
+ * 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 buildTermvectors (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [termvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html) request
+ *
+ * @param {string} index - The index in which the document resides.
+ * @param {string} type - The type of the document.
+ * @param {string} id - The id of the document, when not specified a doc param should be supplied.
+ * @param {boolean} term_statistics - Specifies if total term frequency and document frequency should be returned.
+ * @param {boolean} field_statistics - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.
+ * @param {list} fields - A comma-separated list of fields to return.
+ * @param {boolean} offsets - Specifies if term offsets should be returned.
+ * @param {boolean} positions - Specifies if term positions should be returned.
+ * @param {boolean} payloads - Specifies if term payloads should be returned.
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random).
+ * @param {string} routing - Specific routing value.
+ * @param {string} parent - Parent id of documents.
+ * @param {boolean} realtime - Specifies if request is real-time as opposed to near-real-time (default: true).
+ * @param {number} version - Explicit version number for concurrency control
+ * @param {enum} version_type - Specific version type
+ * @param {object} body - Define parameters and or supply a document to get termvectors for. See documentation.
+ */
+
+ const acceptedQuerystring = [
+ 'term_statistics',
+ 'field_statistics',
+ 'fields',
+ 'offsets',
+ 'positions',
+ 'payloads',
+ 'preference',
+ 'routing',
+ 'parent',
+ 'realtime',
+ 'version',
+ 'version_type',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ termStatistics: 'term_statistics',
+ fieldStatistics: 'field_statistics',
+ versionType: 'version_type',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function termvectors (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type', 'id'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors'
+ } else if ((index) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_termvectors' + '/' + encodeURIComponent(id)
+ } else if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_termvectors'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildTermvectors
diff --git a/api/api/update.js b/api/api/update.js
new file mode 100644
index 000000000..a1bbe0b54
--- /dev/null
+++ b/api/api/update.js
@@ -0,0 +1,179 @@
+/*
+ * 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 buildUpdate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [update](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html) request
+ *
+ * @param {string} id - Document ID
+ * @param {string} index - The name of the index
+ * @param {string} type - The type of the document
+ * @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the update 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 {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 {string} lang - The script language (default: painless)
+ * @param {string} parent - ID of the parent document. Is is only used for routing and when for the upsert request
+ * @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 {number} retry_on_conflict - Specify how many times should the operation be retried when a conflict occurs (default: 0)
+ * @param {string} routing - Specific routing value
+ * @param {time} timeout - Explicit operation timeout
+ * @param {number} if_seq_no - only perform the update operation if the last operation that has changed the document has the specified sequence number
+ * @param {number} if_primary_term - only perform the update operation if the last operation that has changed the document has the specified primary term
+ * @param {object} body - The request definition requires either `script` or partial `doc`
+ */
+
+ const acceptedQuerystring = [
+ 'wait_for_active_shards',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'lang',
+ 'parent',
+ 'refresh',
+ 'retry_on_conflict',
+ 'routing',
+ 'timeout',
+ 'if_seq_no',
+ 'if_primary_term',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ waitForActiveShards: 'wait_for_active_shards',
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ retryOnConflict: 'retry_on_conflict',
+ ifSeqNo: 'if_seq_no',
+ ifPrimaryTerm: 'if_primary_term',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function update (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['index'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'id', 'index', 'type'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null && (id) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_update'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_update' + '/' + encodeURIComponent(id)
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildUpdate
diff --git a/api/api/update_by_query.js b/api/api/update_by_query.js
new file mode 100644
index 000000000..a6455a813
--- /dev/null
+++ b/api/api/update_by_query.js
@@ -0,0 +1,228 @@
+/*
+ * 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 buildUpdateByQuery (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [update_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-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} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
+ * @param {string} analyzer - The analyzer to use for the query string
+ * @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
+ * @param {enum} default_operator - The default operator for query string query (AND or OR)
+ * @param {string} df - The field to use as default where no field prefix is given in the query string
+ * @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} 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 update by query hits version conflicts?
+ * @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 {string} pipeline - Ingest pipeline to set on index requests made by this action. (default: none)
+ * @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
+ * @param {string} q - Query in the Lucene query string syntax
+ * @param {list} routing - A comma-separated list of specific routing values
+ * @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
+ * @param {enum} search_type - Search operation type
+ * @param {time} search_timeout - Explicit timeout for each search request. Defaults to no timeout.
+ * @param {number} size - Number of hits to return (default: 10)
+ * @param {list} sort - A comma-separated list of : pairs
+ * @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 {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 {boolean} version - Specify whether to return document version as part of a hit
+ * @param {boolean} version_type - Should the document increment the version number (internal) on hit or not (reindex)
+ * @param {boolean} request_cache - Specify if request cache should be used for this request or not, defaults to index level setting
+ * @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 {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the update 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 {boolean} wait_for_completion - Should the request should block until the update by query operation is complete.
+ * @param {number} requests_per_second - The throttle to set on 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 {object} body - The search definition using the Query DSL
+ */
+
+ const acceptedQuerystring = [
+ 'analyzer',
+ 'analyze_wildcard',
+ 'default_operator',
+ 'df',
+ 'from',
+ 'ignore_unavailable',
+ 'allow_no_indices',
+ 'conflicts',
+ 'expand_wildcards',
+ 'lenient',
+ 'pipeline',
+ 'preference',
+ 'q',
+ 'routing',
+ 'scroll',
+ 'search_type',
+ 'search_timeout',
+ 'size',
+ 'sort',
+ '_source',
+ '_source_excludes',
+ '_source_includes',
+ 'terminate_after',
+ 'stats',
+ 'version',
+ 'version_type',
+ 'request_cache',
+ 'refresh',
+ 'timeout',
+ 'wait_for_active_shards',
+ 'scroll_size',
+ 'wait_for_completion',
+ 'requests_per_second',
+ 'slices',
+ 'pretty',
+ 'human',
+ 'error_trace',
+ 'source',
+ 'filter_path'
+ ]
+
+ const snakeCase = {
+ analyzeWildcard: 'analyze_wildcard',
+ defaultOperator: 'default_operator',
+ ignoreUnavailable: 'ignore_unavailable',
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ searchType: 'search_type',
+ searchTimeout: 'search_timeout',
+ _sourceExcludes: '_source_excludes',
+ _sourceIncludes: '_source_includes',
+ terminateAfter: 'terminate_after',
+ versionType: 'version_type',
+ requestCache: 'request_cache',
+ waitForActiveShards: 'wait_for_active_shards',
+ scrollSize: 'scroll_size',
+ waitForCompletion: 'wait_for_completion',
+ requestsPerSecond: 'requests_per_second',
+ errorTrace: 'error_trace',
+ filterPath: 'filter_path'
+ }
+
+ return function updateByQuery (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_update_by_query'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildUpdateByQuery
diff --git a/api/api/update_by_query_rethrottle.js b/api/api/update_by_query_rethrottle.js
new file mode 100644
index 000000000..b57d94b40
--- /dev/null
+++ b/api/api/update_by_query_rethrottle.js
@@ -0,0 +1,145 @@
+/*
+ * 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 buildUpdateByQueryRethrottle (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [update_by_query_rethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-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 updateByQueryRethrottle (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: task_id or taskId'),
+ result
+ )
+ }
+ if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, taskId, task_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'taskId', 'task_id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_update_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildUpdateByQueryRethrottle
diff --git a/api/api/xpack.graph.explore.js b/api/api/xpack.graph.explore.js
new file mode 100644
index 000000000..c991bc53e
--- /dev/null
+++ b/api/api/xpack.graph.explore.js
@@ -0,0 +1,134 @@
+/*
+ * 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 buildXpackGraphExplore (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.graph.explore](https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.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} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
+ * @param {string} routing - Specific routing value
+ * @param {time} timeout - Explicit operation timeout
+ * @param {object} body - Graph Query DSL
+ */
+
+ const acceptedQuerystring = [
+ 'routing',
+ 'timeout'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackGraphExplore (params, options, callback) {
+ options = options || {}
+ if (typeof options === 'function') {
+ callback = options
+ options = {}
+ }
+ if (typeof params === 'function' || params == null) {
+ callback = params
+ params = {}
+ options = {}
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackGraphExplore
diff --git a/api/api/xpack.info.js b/api/api/xpack.info.js
new file mode 100644
index 000000000..6881278e2
--- /dev/null
+++ b/api/api/xpack.info.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildXpackInfo (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.info](https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html) request
+ *
+ * @param {list} categories - Comma-separated list of info categories. Can be any of: build, license, features
+ */
+
+ const acceptedQuerystring = [
+ 'categories'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackInfo (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_xpack'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackInfo
diff --git a/api/api/xpack.license.delete.js b/api/api/xpack.license.delete.js
new file mode 100644
index 000000000..0ba866644
--- /dev/null
+++ b/api/api/xpack.license.delete.js
@@ -0,0 +1,124 @@
+/*
+ * 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 buildXpackLicenseDelete (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.license.delete](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackLicenseDelete (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_license'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackLicenseDelete
diff --git a/api/api/xpack.license.get.js b/api/api/xpack.license.get.js
new file mode 100644
index 000000000..fe2c0a32c
--- /dev/null
+++ b/api/api/xpack.license.get.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildXpackLicenseGet (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.license.get](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
+ *
+ * @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
+ */
+
+ const acceptedQuerystring = [
+ 'local'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackLicenseGet (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_license'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackLicenseGet
diff --git a/api/api/xpack.license.get_basic_status.js b/api/api/xpack.license.get_basic_status.js
new file mode 100644
index 000000000..0ec25ff6d
--- /dev/null
+++ b/api/api/xpack.license.get_basic_status.js
@@ -0,0 +1,124 @@
+/*
+ * 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 buildXpackLicenseGetBasicStatus (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.license.get_basic_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackLicenseGetBasicStatus (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_license' + '/' + 'basic_status'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackLicenseGetBasicStatus
diff --git a/api/api/xpack.license.get_trial_status.js b/api/api/xpack.license.get_trial_status.js
new file mode 100644
index 000000000..09660966b
--- /dev/null
+++ b/api/api/xpack.license.get_trial_status.js
@@ -0,0 +1,124 @@
+/*
+ * 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 buildXpackLicenseGetTrialStatus (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.license.get_trial_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackLicenseGetTrialStatus (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_license' + '/' + 'trial_status'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackLicenseGetTrialStatus
diff --git a/api/api/xpack.license.post.js b/api/api/xpack.license.post.js
new file mode 100644
index 000000000..ebbd77e2d
--- /dev/null
+++ b/api/api/xpack.license.post.js
@@ -0,0 +1,118 @@
+/*
+ * 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 buildXpackLicensePost (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.license.post](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
+ *
+ * @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
+ * @param {object} body - licenses to be installed
+ */
+
+ const acceptedQuerystring = [
+ 'acknowledge'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackLicensePost (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_license'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackLicensePost
diff --git a/api/api/xpack.license.post_start_basic.js b/api/api/xpack.license.post_start_basic.js
new file mode 100644
index 000000000..9e9a6faae
--- /dev/null
+++ b/api/api/xpack.license.post_start_basic.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildXpackLicensePostStartBasic (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.license.post_start_basic](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
+ *
+ * @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
+ */
+
+ const acceptedQuerystring = [
+ 'acknowledge'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackLicensePostStartBasic (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_license' + '/' + 'start_basic'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackLicensePostStartBasic
diff --git a/api/api/xpack.license.post_start_trial.js b/api/api/xpack.license.post_start_trial.js
new file mode 100644
index 000000000..ac2c11f3a
--- /dev/null
+++ b/api/api/xpack.license.post_start_trial.js
@@ -0,0 +1,127 @@
+/*
+ * 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 buildXpackLicensePostStartTrial (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.license.post_start_trial](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
+ *
+ * @param {string} type - The type of trial license to generate (default: "trial")
+ * @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
+ */
+
+ const acceptedQuerystring = [
+ 'type',
+ 'acknowledge'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackLicensePostStartTrial (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_license' + '/' + 'start_trial'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackLicensePostStartTrial
diff --git a/api/api/xpack.migration.deprecations.js b/api/api/xpack.migration.deprecations.js
new file mode 100644
index 000000000..e5fbad087
--- /dev/null
+++ b/api/api/xpack.migration.deprecations.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildXpackMigrationDeprecations (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.migration.deprecations](http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html) request
+ *
+ * @param {string} index - Index pattern
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackMigrationDeprecations (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + '_migration' + '/' + 'deprecations'
+ } else {
+ path = '/' + '_migration' + '/' + 'deprecations'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackMigrationDeprecations
diff --git a/api/api/xpack.migration.get_assistance.js b/api/api/xpack.migration.get_assistance.js
new file mode 100644
index 000000000..1840cdd9b
--- /dev/null
+++ b/api/api/xpack.migration.get_assistance.js
@@ -0,0 +1,128 @@
+/*
+ * 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 buildXpackMigrationGetAssistance (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.migration.get_assistance](https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.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 {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 {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+ */
+
+ const acceptedQuerystring = [
+ 'allow_no_indices',
+ 'expand_wildcards',
+ 'ignore_unavailable'
+ ]
+
+ const snakeCase = {
+ allowNoIndices: 'allow_no_indices',
+ expandWildcards: 'expand_wildcards',
+ ignoreUnavailable: 'ignore_unavailable'
+ }
+
+ return function xpackMigrationGetAssistance (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null) {
+ path = '/' + '_migration' + '/' + 'assistance' + '/' + encodeURIComponent(index)
+ } else {
+ path = '/' + '_migration' + '/' + 'assistance'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackMigrationGetAssistance
diff --git a/api/api/xpack.migration.upgrade.js b/api/api/xpack.migration.upgrade.js
new file mode 100644
index 000000000..305428a6c
--- /dev/null
+++ b/api/api/xpack.migration.upgrade.js
@@ -0,0 +1,126 @@
+/*
+ * 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 buildXpackMigrationUpgrade (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.migration.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html) request
+ *
+ * @param {string} index - The name of the index
+ * @param {boolean} wait_for_completion - Should the request block until the upgrade operation is completed
+ */
+
+ const acceptedQuerystring = [
+ 'wait_for_completion'
+ ]
+
+ const snakeCase = {
+ waitForCompletion: 'wait_for_completion'
+ }
+
+ return function xpackMigrationUpgrade (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_migration' + '/' + 'upgrade' + '/' + encodeURIComponent(index)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackMigrationUpgrade
diff --git a/api/api/xpack.rollup.delete_job.js b/api/api/xpack.rollup.delete_job.js
new file mode 100644
index 000000000..7dc7a4903
--- /dev/null
+++ b/api/api/xpack.rollup.delete_job.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildXpackRollupDeleteJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.rollup.delete_job]() request
+ *
+ * @param {string} id - The ID of the job to delete
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackRollupDeleteJob (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackRollupDeleteJob
diff --git a/api/api/xpack.rollup.get_jobs.js b/api/api/xpack.rollup.get_jobs.js
new file mode 100644
index 000000000..cdb7b666a
--- /dev/null
+++ b/api/api/xpack.rollup.get_jobs.js
@@ -0,0 +1,121 @@
+/*
+ * 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 buildXpackRollupGetJobs (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.rollup.get_jobs]() request
+ *
+ * @param {string} id - The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackRollupGetJobs (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((id) != null) {
+ path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
+ } else {
+ path = '/' + '_rollup' + '/' + 'job'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackRollupGetJobs
diff --git a/api/api/xpack.rollup.get_rollup_caps.js b/api/api/xpack.rollup.get_rollup_caps.js
new file mode 100644
index 000000000..cb18eee62
--- /dev/null
+++ b/api/api/xpack.rollup.get_rollup_caps.js
@@ -0,0 +1,121 @@
+/*
+ * 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 buildXpackRollupGetRollupCaps (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.rollup.get_rollup_caps]() request
+ *
+ * @param {string} id - The ID of the index to check rollup capabilities on, or left blank for all jobs
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackRollupGetRollupCaps (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((id) != null) {
+ path = '/' + '_rollup' + '/' + 'data' + '/' + encodeURIComponent(id)
+ } else {
+ path = '/' + '_rollup' + '/' + 'data'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackRollupGetRollupCaps
diff --git a/api/api/xpack.rollup.get_rollup_index_caps.js b/api/api/xpack.rollup.get_rollup_index_caps.js
new file mode 100644
index 000000000..de4191264
--- /dev/null
+++ b/api/api/xpack.rollup.get_rollup_index_caps.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildXpackRollupGetRollupIndexCaps (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.rollup.get_rollup_index_caps]() request
+ *
+ * @param {string} index - The rollup index or index pattern to obtain rollup capabilities from.
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackRollupGetRollupIndexCaps (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index } = params
+ var querystring = semicopy(params, ['method', 'body', 'index'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + 'data'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackRollupGetRollupIndexCaps
diff --git a/api/api/xpack.rollup.put_job.js b/api/api/xpack.rollup.put_job.js
new file mode 100644
index 000000000..37de0684b
--- /dev/null
+++ b/api/api/xpack.rollup.put_job.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildXpackRollupPutJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.rollup.put_job]() request
+ *
+ * @param {string} id - The ID of the job to create
+ * @param {object} body - The job configuration
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackRollupPutJob (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackRollupPutJob
diff --git a/api/api/xpack.rollup.rollup_search.js b/api/api/xpack.rollup.rollup_search.js
new file mode 100644
index 000000000..e8bc75395
--- /dev/null
+++ b/api/api/xpack.rollup.rollup_search.js
@@ -0,0 +1,149 @@
+/*
+ * 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 buildXpackRollupRollupSearch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.rollup.rollup_search]() request
+ *
+ * @param {string} index - The index or index-pattern (containing rollup or regular data) that should be searched
+ * @param {string} type - The doc type inside the index
+ * @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ * @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+ * @param {object} body - The search request body
+ */
+
+ const acceptedQuerystring = [
+ 'typed_keys',
+ 'rest_total_hits_as_int'
+ ]
+
+ const snakeCase = {
+ typedKeys: 'typed_keys',
+ restTotalHitsAsInt: 'rest_total_hits_as_int'
+ }
+
+ return function xpackRollupRollupSearch (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: index'),
+ result
+ )
+ }
+ if (params['body'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // check required url components
+ if (params['type'] != null && (params['index'] == null)) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: index'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, index, type } = params
+ var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((index) != null && (type) != null) {
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_rollup_search'
+ } else {
+ path = '/' + encodeURIComponent(index) + '/' + '_rollup_search'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackRollupRollupSearch
diff --git a/api/api/xpack.rollup.start_job.js b/api/api/xpack.rollup.start_job.js
new file mode 100644
index 000000000..33c3ac5fd
--- /dev/null
+++ b/api/api/xpack.rollup.start_job.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildXpackRollupStartJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.rollup.start_job]() request
+ *
+ * @param {string} id - The ID of the job to start
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackRollupStartJob (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_start'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackRollupStartJob
diff --git a/api/api/xpack.rollup.stop_job.js b/api/api/xpack.rollup.stop_job.js
new file mode 100644
index 000000000..5bcf1373e
--- /dev/null
+++ b/api/api/xpack.rollup.stop_job.js
@@ -0,0 +1,129 @@
+/*
+ * 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 buildXpackRollupStopJob (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.rollup.stop_job]() request
+ *
+ * @param {string} id - The ID of the job to stop
+ * @param {boolean} wait_for_completion - True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false.
+ * @param {time} timeout - Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s.
+ */
+
+ const acceptedQuerystring = [
+ 'wait_for_completion',
+ 'timeout'
+ ]
+
+ const snakeCase = {
+ waitForCompletion: 'wait_for_completion'
+
+ }
+
+ return function xpackRollupStopJob (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_stop'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackRollupStopJob
diff --git a/api/api/xpack.sql.clear_cursor.js b/api/api/xpack.sql.clear_cursor.js
new file mode 100644
index 000000000..f35f3e363
--- /dev/null
+++ b/api/api/xpack.sql.clear_cursor.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildXpackSqlClearCursor (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.sql.clear_cursor](Clear SQL cursor) request
+ *
+ * @param {object} body - Specify the cursor value in the `cursor` element to clean the cursor.
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackSqlClearCursor (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_sql' + '/' + 'close'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackSqlClearCursor
diff --git a/api/api/xpack.sql.query.js b/api/api/xpack.sql.query.js
new file mode 100644
index 000000000..125c577f6
--- /dev/null
+++ b/api/api/xpack.sql.query.js
@@ -0,0 +1,126 @@
+/*
+ * 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 buildXpackSqlQuery (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.sql.query](Execute SQL) request
+ *
+ * @param {string} format - a short version of the Accept header, e.g. json, yaml
+ * @param {object} body - Use the `query` element to start a query. Use the `cursor` element to continue a query.
+ */
+
+ const acceptedQuerystring = [
+ 'format'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackSqlQuery (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_sql'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackSqlQuery
diff --git a/api/api/xpack.sql.translate.js b/api/api/xpack.sql.translate.js
new file mode 100644
index 000000000..c8df293e7
--- /dev/null
+++ b/api/api/xpack.sql.translate.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildXpackSqlTranslate (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.sql.translate](Translate SQL into Elasticsearch queries) request
+ *
+ * @param {object} body - Specify the query in the `query` element.
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackSqlTranslate (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) {
+ return callback(
+ new ConfigurationError('Missing required parameter: body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = body == null ? 'GET' : 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_sql' + '/' + 'translate'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackSqlTranslate
diff --git a/api/api/xpack.usage.js b/api/api/xpack.usage.js
new file mode 100644
index 000000000..dd85627f1
--- /dev/null
+++ b/api/api/xpack.usage.js
@@ -0,0 +1,125 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+'use strict'
+
+/* eslint camelcase: 0 */
+/* eslint no-unused-vars: 0 */
+
+function buildXpackUsage (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.usage](Retrieve information about xpack features usage) request
+ *
+ * @param {time} master_timeout - Specify timeout for watch write operation
+ */
+
+ const acceptedQuerystring = [
+ 'master_timeout'
+ ]
+
+ const snakeCase = {
+ masterTimeout: 'master_timeout'
+ }
+
+ return function xpackUsage (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_xpack' + '/' + 'usage'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackUsage
diff --git a/api/api/xpack.watcher.ack_watch.js b/api/api/xpack.watcher.ack_watch.js
new file mode 100644
index 000000000..9a8a450c4
--- /dev/null
+++ b/api/api/xpack.watcher.ack_watch.js
@@ -0,0 +1,144 @@
+/*
+ * 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 buildXpackWatcherAckWatch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.ack_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html) request
+ *
+ * @param {string} watch_id - Watch ID
+ * @param {list} action_id - A comma-separated list of the action ids to be acked
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackWatcherAckWatch (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['watch_id'] == null && params['watchId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: watch_id or watchId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // check required url components
+ if ((params['action_id'] != null || params['actionId'] != null) && ((params['watch_id'] == null && params['watchId'] == null))) {
+ return callback(
+ new ConfigurationError('Missing required parameter of the url: watch_id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, watchId, watch_id, actionId, action_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'watchId', 'watch_id', 'actionId', 'action_id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((watch_id || watchId) != null && (action_id || actionId) != null) {
+ path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_ack' + '/' + encodeURIComponent(action_id || actionId)
+ } else {
+ path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_ack'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherAckWatch
diff --git a/api/api/xpack.watcher.activate_watch.js b/api/api/xpack.watcher.activate_watch.js
new file mode 100644
index 000000000..1d114b189
--- /dev/null
+++ b/api/api/xpack.watcher.activate_watch.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildXpackWatcherActivateWatch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.activate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html) request
+ *
+ * @param {string} watch_id - Watch ID
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackWatcherActivateWatch (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['watch_id'] == null && params['watchId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: watch_id or watchId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, watchId, watch_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'watchId', 'watch_id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_activate'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherActivateWatch
diff --git a/api/api/xpack.watcher.deactivate_watch.js b/api/api/xpack.watcher.deactivate_watch.js
new file mode 100644
index 000000000..1e7fe35ac
--- /dev/null
+++ b/api/api/xpack.watcher.deactivate_watch.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildXpackWatcherDeactivateWatch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.deactivate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html) request
+ *
+ * @param {string} watch_id - Watch ID
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackWatcherDeactivateWatch (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['watch_id'] == null && params['watchId'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: watch_id or watchId'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, watchId, watch_id } = params
+ var querystring = semicopy(params, ['method', 'body', 'watchId', 'watch_id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_deactivate'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherDeactivateWatch
diff --git a/api/api/xpack.watcher.delete_watch.js b/api/api/xpack.watcher.delete_watch.js
new file mode 100644
index 000000000..063788115
--- /dev/null
+++ b/api/api/xpack.watcher.delete_watch.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildXpackWatcherDeleteWatch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.delete_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html) request
+ *
+ * @param {string} id - Watch ID
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackWatcherDeleteWatch (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'DELETE'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherDeleteWatch
diff --git a/api/api/xpack.watcher.execute_watch.js b/api/api/xpack.watcher.execute_watch.js
new file mode 100644
index 000000000..8e14f3475
--- /dev/null
+++ b/api/api/xpack.watcher.execute_watch.js
@@ -0,0 +1,123 @@
+/*
+ * 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 buildXpackWatcherExecuteWatch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.execute_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html) request
+ *
+ * @param {string} id - Watch ID
+ * @param {boolean} debug - indicates whether the watch should execute in debug mode
+ * @param {object} body - Execution control
+ */
+
+ const acceptedQuerystring = [
+ 'debug'
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackWatcherExecuteWatch (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') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((id) != null) {
+ path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id) + '/' + '_execute'
+ } else {
+ path = '/' + '_watcher' + '/' + 'watch' + '/' + '_execute'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherExecuteWatch
diff --git a/api/api/xpack.watcher.get_watch.js b/api/api/xpack.watcher.get_watch.js
new file mode 100644
index 000000000..f18fcb992
--- /dev/null
+++ b/api/api/xpack.watcher.get_watch.js
@@ -0,0 +1,131 @@
+/*
+ * 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 buildXpackWatcherGetWatch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.get_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html) request
+ *
+ * @param {string} id - Watch ID
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackWatcherGetWatch (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+ if (params.body != null) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherGetWatch
diff --git a/api/api/xpack.watcher.put_watch.js b/api/api/xpack.watcher.put_watch.js
new file mode 100644
index 000000000..269e58d5a
--- /dev/null
+++ b/api/api/xpack.watcher.put_watch.js
@@ -0,0 +1,134 @@
+/*
+ * 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 buildXpackWatcherPutWatch (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.put_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html) request
+ *
+ * @param {string} id - Watch ID
+ * @param {boolean} active - Specify whether the watch is in/active by default
+ * @param {number} version - Explicit version number for concurrency control
+ * @param {number} if_seq_no - only update the watch if the last operation that has changed the watch has the specified sequence number
+ * @param {number} if_primary_term - only update the watch if the last operation that has changed the watch has the specified primary term
+ * @param {object} body - The watch
+ */
+
+ const acceptedQuerystring = [
+ 'active',
+ 'version',
+ 'if_seq_no',
+ 'if_primary_term'
+ ]
+
+ const snakeCase = {
+ ifSeqNo: 'if_seq_no',
+ ifPrimaryTerm: 'if_primary_term'
+ }
+
+ return function xpackWatcherPutWatch (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['id'] == null) {
+ return callback(
+ new ConfigurationError('Missing required parameter: id'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, id } = params
+ var querystring = semicopy(params, ['method', 'body', 'id'])
+
+ if (method == null) {
+ method = 'PUT'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: body || '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherPutWatch
diff --git a/api/api/xpack.watcher.start.js b/api/api/xpack.watcher.start.js
new file mode 100644
index 000000000..e16a81eda
--- /dev/null
+++ b/api/api/xpack.watcher.start.js
@@ -0,0 +1,124 @@
+/*
+ * 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 buildXpackWatcherStart (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.start](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackWatcherStart (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_watcher' + '/' + '_start'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherStart
diff --git a/api/api/xpack.watcher.stats.js b/api/api/xpack.watcher.stats.js
new file mode 100644
index 000000000..6991ec20a
--- /dev/null
+++ b/api/api/xpack.watcher.stats.js
@@ -0,0 +1,132 @@
+/*
+ * 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 buildXpackWatcherStats (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html) request
+ *
+ * @param {enum} metric - Controls what additional stat metrics should be include in the response
+ * @param {enum} metric - Controls what additional stat metrics should be include in the response
+ * @param {boolean} emit_stacktraces - Emits stack traces of currently running watches
+ */
+
+ const acceptedQuerystring = [
+ 'metric',
+ 'emit_stacktraces'
+ ]
+
+ const snakeCase = {
+ emitStacktraces: 'emit_stacktraces'
+ }
+
+ return function xpackWatcherStats (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body, metric } = params
+ var querystring = semicopy(params, ['method', 'body', 'metric'])
+
+ if (method == null) {
+ method = 'GET'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ if ((metric) != null) {
+ path = '/' + '_watcher' + '/' + 'stats' + '/' + encodeURIComponent(metric)
+ } else {
+ path = '/' + '_watcher' + '/' + 'stats'
+ }
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: null,
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherStats
diff --git a/api/api/xpack.watcher.stop.js b/api/api/xpack.watcher.stop.js
new file mode 100644
index 000000000..17f5c33a3
--- /dev/null
+++ b/api/api/xpack.watcher.stop.js
@@ -0,0 +1,124 @@
+/*
+ * 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 buildXpackWatcherStop (opts) {
+ // eslint-disable-next-line no-unused-vars
+ const { makeRequest, ConfigurationError, result } = opts
+ /**
+ * Perform a [xpack.watcher.stop](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html) request
+ *
+ */
+
+ const acceptedQuerystring = [
+
+ ]
+
+ const snakeCase = {
+
+ }
+
+ return function xpackWatcherStop (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) {
+ return callback(
+ new ConfigurationError('This API does not require a body'),
+ result
+ )
+ }
+
+ // validate headers object
+ if (options.headers != null && typeof options.headers !== 'object') {
+ return callback(
+ new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
+ result
+ )
+ }
+
+ var warnings = null
+ var { method, body } = params
+ var querystring = semicopy(params, ['method', 'body'])
+
+ if (method == null) {
+ method = 'POST'
+ }
+
+ var ignore = options.ignore || null
+ if (typeof ignore === 'number') {
+ ignore = [ignore]
+ }
+
+ var path = ''
+
+ path = '/' + '_watcher' + '/' + '_stop'
+
+ // build request object
+ const request = {
+ method,
+ path,
+ body: '',
+ querystring
+ }
+
+ const requestOptions = {
+ ignore,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null,
+ compression: options.compression || false,
+ warnings
+ }
+
+ return makeRequest(request, requestOptions, callback)
+
+ function semicopy (obj, exclude) {
+ var target = {}
+ var keys = Object.keys(obj)
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i]
+ if (exclude.indexOf(key) === -1) {
+ target[snakeCase[key] || key] = obj[key]
+ if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
+ warnings = warnings || []
+ warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
+ }
+ }
+ }
+ return target
+ }
+ }
+}
+
+module.exports = buildXpackWatcherStop
diff --git a/api/index.js b/api/index.js
new file mode 100644
index 000000000..ca997bffa
--- /dev/null
+++ b/api/index.js
@@ -0,0 +1,502 @@
+/*
+ * 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'
+
+const assert = require('assert')
+
+function ESAPI (opts) {
+ assert(opts.makeRequest, 'Missing makeRequest function')
+ assert(opts.ConfigurationError, 'Missing ConfigurationError class')
+ assert(opts.result, 'Missing default result object')
+
+ const apis = {
+ bulk: lazyLoad('./api/bulk.js', opts),
+ cat: {
+ aliases: lazyLoad('./api/cat.aliases.js', opts),
+ allocation: lazyLoad('./api/cat.allocation.js', opts),
+ count: lazyLoad('./api/cat.count.js', opts),
+ fielddata: lazyLoad('./api/cat.fielddata.js', opts),
+ health: lazyLoad('./api/cat.health.js', opts),
+ help: lazyLoad('./api/cat.help.js', opts),
+ indices: lazyLoad('./api/cat.indices.js', opts),
+ master: lazyLoad('./api/cat.master.js', opts),
+ nodeattrs: lazyLoad('./api/cat.nodeattrs.js', opts),
+ nodes: lazyLoad('./api/cat.nodes.js', opts),
+ pending_tasks: lazyLoad('./api/cat.pending_tasks.js', opts),
+ pendingTasks: lazyLoad('./api/cat.pending_tasks.js', opts),
+ plugins: lazyLoad('./api/cat.plugins.js', opts),
+ recovery: lazyLoad('./api/cat.recovery.js', opts),
+ repositories: lazyLoad('./api/cat.repositories.js', opts),
+ segments: lazyLoad('./api/cat.segments.js', opts),
+ shards: lazyLoad('./api/cat.shards.js', opts),
+ snapshots: lazyLoad('./api/cat.snapshots.js', opts),
+ tasks: lazyLoad('./api/cat.tasks.js', opts),
+ templates: lazyLoad('./api/cat.templates.js', opts),
+ thread_pool: lazyLoad('./api/cat.thread_pool.js', opts),
+ threadPool: lazyLoad('./api/cat.thread_pool.js', opts)
+ },
+ ccr: {
+ delete_auto_follow_pattern: lazyLoad('./api/ccr.delete_auto_follow_pattern.js', opts),
+ deleteAutoFollowPattern: lazyLoad('./api/ccr.delete_auto_follow_pattern.js', opts),
+ follow: lazyLoad('./api/ccr.follow.js', opts),
+ follow_info: lazyLoad('./api/ccr.follow_info.js', opts),
+ followInfo: lazyLoad('./api/ccr.follow_info.js', opts),
+ follow_stats: lazyLoad('./api/ccr.follow_stats.js', opts),
+ followStats: lazyLoad('./api/ccr.follow_stats.js', opts),
+ get_auto_follow_pattern: lazyLoad('./api/ccr.get_auto_follow_pattern.js', opts),
+ getAutoFollowPattern: lazyLoad('./api/ccr.get_auto_follow_pattern.js', opts),
+ pause_follow: lazyLoad('./api/ccr.pause_follow.js', opts),
+ pauseFollow: lazyLoad('./api/ccr.pause_follow.js', opts),
+ put_auto_follow_pattern: lazyLoad('./api/ccr.put_auto_follow_pattern.js', opts),
+ putAutoFollowPattern: lazyLoad('./api/ccr.put_auto_follow_pattern.js', opts),
+ resume_follow: lazyLoad('./api/ccr.resume_follow.js', opts),
+ resumeFollow: lazyLoad('./api/ccr.resume_follow.js', opts),
+ stats: lazyLoad('./api/ccr.stats.js', opts),
+ unfollow: lazyLoad('./api/ccr.unfollow.js', opts)
+ },
+ clear_scroll: lazyLoad('./api/clear_scroll.js', opts),
+ clearScroll: lazyLoad('./api/clear_scroll.js', opts),
+ cluster: {
+ allocation_explain: lazyLoad('./api/cluster.allocation_explain.js', opts),
+ allocationExplain: lazyLoad('./api/cluster.allocation_explain.js', opts),
+ get_settings: lazyLoad('./api/cluster.get_settings.js', opts),
+ getSettings: lazyLoad('./api/cluster.get_settings.js', opts),
+ health: lazyLoad('./api/cluster.health.js', opts),
+ pending_tasks: lazyLoad('./api/cluster.pending_tasks.js', opts),
+ pendingTasks: lazyLoad('./api/cluster.pending_tasks.js', opts),
+ put_settings: lazyLoad('./api/cluster.put_settings.js', opts),
+ putSettings: lazyLoad('./api/cluster.put_settings.js', opts),
+ remote_info: lazyLoad('./api/cluster.remote_info.js', opts),
+ remoteInfo: lazyLoad('./api/cluster.remote_info.js', opts),
+ reroute: lazyLoad('./api/cluster.reroute.js', opts),
+ state: lazyLoad('./api/cluster.state.js', opts),
+ stats: lazyLoad('./api/cluster.stats.js', opts)
+ },
+ count: lazyLoad('./api/count.js', opts),
+ create: lazyLoad('./api/create.js', opts),
+ delete: lazyLoad('./api/delete.js', opts),
+ delete_by_query: lazyLoad('./api/delete_by_query.js', opts),
+ deleteByQuery: lazyLoad('./api/delete_by_query.js', opts),
+ delete_by_query_rethrottle: lazyLoad('./api/delete_by_query_rethrottle.js', opts),
+ deleteByQueryRethrottle: lazyLoad('./api/delete_by_query_rethrottle.js', opts),
+ delete_script: lazyLoad('./api/delete_script.js', opts),
+ deleteScript: lazyLoad('./api/delete_script.js', opts),
+ exists: lazyLoad('./api/exists.js', opts),
+ exists_source: lazyLoad('./api/exists_source.js', opts),
+ existsSource: lazyLoad('./api/exists_source.js', opts),
+ explain: lazyLoad('./api/explain.js', opts),
+ field_caps: lazyLoad('./api/field_caps.js', opts),
+ fieldCaps: lazyLoad('./api/field_caps.js', opts),
+ get: lazyLoad('./api/get.js', opts),
+ get_script: lazyLoad('./api/get_script.js', opts),
+ getScript: lazyLoad('./api/get_script.js', opts),
+ get_source: lazyLoad('./api/get_source.js', opts),
+ getSource: lazyLoad('./api/get_source.js', opts),
+ ilm: {
+ delete_lifecycle: lazyLoad('./api/ilm.delete_lifecycle.js', opts),
+ deleteLifecycle: lazyLoad('./api/ilm.delete_lifecycle.js', opts),
+ explain_lifecycle: lazyLoad('./api/ilm.explain_lifecycle.js', opts),
+ explainLifecycle: lazyLoad('./api/ilm.explain_lifecycle.js', opts),
+ get_lifecycle: lazyLoad('./api/ilm.get_lifecycle.js', opts),
+ getLifecycle: lazyLoad('./api/ilm.get_lifecycle.js', opts),
+ get_status: lazyLoad('./api/ilm.get_status.js', opts),
+ getStatus: lazyLoad('./api/ilm.get_status.js', opts),
+ move_to_step: lazyLoad('./api/ilm.move_to_step.js', opts),
+ moveToStep: lazyLoad('./api/ilm.move_to_step.js', opts),
+ put_lifecycle: lazyLoad('./api/ilm.put_lifecycle.js', opts),
+ putLifecycle: lazyLoad('./api/ilm.put_lifecycle.js', opts),
+ remove_policy: lazyLoad('./api/ilm.remove_policy.js', opts),
+ removePolicy: lazyLoad('./api/ilm.remove_policy.js', opts),
+ retry: lazyLoad('./api/ilm.retry.js', opts),
+ start: lazyLoad('./api/ilm.start.js', opts),
+ stop: lazyLoad('./api/ilm.stop.js', opts)
+ },
+ index: lazyLoad('./api/index.js', opts),
+ indices: {
+ analyze: lazyLoad('./api/indices.analyze.js', opts),
+ clear_cache: lazyLoad('./api/indices.clear_cache.js', opts),
+ clearCache: lazyLoad('./api/indices.clear_cache.js', opts),
+ close: lazyLoad('./api/indices.close.js', opts),
+ create: lazyLoad('./api/indices.create.js', opts),
+ delete: lazyLoad('./api/indices.delete.js', opts),
+ delete_alias: lazyLoad('./api/indices.delete_alias.js', opts),
+ deleteAlias: lazyLoad('./api/indices.delete_alias.js', opts),
+ delete_template: lazyLoad('./api/indices.delete_template.js', opts),
+ deleteTemplate: lazyLoad('./api/indices.delete_template.js', opts),
+ exists: lazyLoad('./api/indices.exists.js', opts),
+ exists_alias: lazyLoad('./api/indices.exists_alias.js', opts),
+ existsAlias: lazyLoad('./api/indices.exists_alias.js', opts),
+ exists_template: lazyLoad('./api/indices.exists_template.js', opts),
+ existsTemplate: lazyLoad('./api/indices.exists_template.js', opts),
+ exists_type: lazyLoad('./api/indices.exists_type.js', opts),
+ existsType: lazyLoad('./api/indices.exists_type.js', opts),
+ flush: lazyLoad('./api/indices.flush.js', opts),
+ flush_synced: lazyLoad('./api/indices.flush_synced.js', opts),
+ flushSynced: lazyLoad('./api/indices.flush_synced.js', opts),
+ forcemerge: lazyLoad('./api/indices.forcemerge.js', opts),
+ freeze: lazyLoad('./api/indices.freeze.js', opts),
+ get: lazyLoad('./api/indices.get.js', opts),
+ get_alias: lazyLoad('./api/indices.get_alias.js', opts),
+ getAlias: lazyLoad('./api/indices.get_alias.js', opts),
+ get_field_mapping: lazyLoad('./api/indices.get_field_mapping.js', opts),
+ getFieldMapping: lazyLoad('./api/indices.get_field_mapping.js', opts),
+ get_mapping: lazyLoad('./api/indices.get_mapping.js', opts),
+ getMapping: lazyLoad('./api/indices.get_mapping.js', opts),
+ get_settings: lazyLoad('./api/indices.get_settings.js', opts),
+ getSettings: lazyLoad('./api/indices.get_settings.js', opts),
+ get_template: lazyLoad('./api/indices.get_template.js', opts),
+ getTemplate: lazyLoad('./api/indices.get_template.js', opts),
+ get_upgrade: lazyLoad('./api/indices.get_upgrade.js', opts),
+ getUpgrade: lazyLoad('./api/indices.get_upgrade.js', opts),
+ open: lazyLoad('./api/indices.open.js', opts),
+ put_alias: lazyLoad('./api/indices.put_alias.js', opts),
+ putAlias: lazyLoad('./api/indices.put_alias.js', opts),
+ put_mapping: lazyLoad('./api/indices.put_mapping.js', opts),
+ putMapping: lazyLoad('./api/indices.put_mapping.js', opts),
+ put_settings: lazyLoad('./api/indices.put_settings.js', opts),
+ putSettings: lazyLoad('./api/indices.put_settings.js', opts),
+ put_template: lazyLoad('./api/indices.put_template.js', opts),
+ putTemplate: lazyLoad('./api/indices.put_template.js', opts),
+ recovery: lazyLoad('./api/indices.recovery.js', opts),
+ refresh: lazyLoad('./api/indices.refresh.js', opts),
+ rollover: lazyLoad('./api/indices.rollover.js', opts),
+ segments: lazyLoad('./api/indices.segments.js', opts),
+ shard_stores: lazyLoad('./api/indices.shard_stores.js', opts),
+ shardStores: lazyLoad('./api/indices.shard_stores.js', opts),
+ shrink: lazyLoad('./api/indices.shrink.js', opts),
+ split: lazyLoad('./api/indices.split.js', opts),
+ stats: lazyLoad('./api/indices.stats.js', opts),
+ unfreeze: lazyLoad('./api/indices.unfreeze.js', opts),
+ update_aliases: lazyLoad('./api/indices.update_aliases.js', opts),
+ updateAliases: lazyLoad('./api/indices.update_aliases.js', opts),
+ upgrade: lazyLoad('./api/indices.upgrade.js', opts),
+ validate_query: lazyLoad('./api/indices.validate_query.js', opts),
+ validateQuery: lazyLoad('./api/indices.validate_query.js', opts)
+ },
+ info: lazyLoad('./api/info.js', opts),
+ ingest: {
+ delete_pipeline: lazyLoad('./api/ingest.delete_pipeline.js', opts),
+ deletePipeline: lazyLoad('./api/ingest.delete_pipeline.js', opts),
+ get_pipeline: lazyLoad('./api/ingest.get_pipeline.js', opts),
+ getPipeline: lazyLoad('./api/ingest.get_pipeline.js', opts),
+ processor_grok: lazyLoad('./api/ingest.processor_grok.js', opts),
+ processorGrok: lazyLoad('./api/ingest.processor_grok.js', opts),
+ put_pipeline: lazyLoad('./api/ingest.put_pipeline.js', opts),
+ putPipeline: lazyLoad('./api/ingest.put_pipeline.js', opts),
+ simulate: lazyLoad('./api/ingest.simulate.js', opts)
+ },
+ mget: lazyLoad('./api/mget.js', opts),
+ ml: {
+ close_job: lazyLoad('./api/ml.close_job.js', opts),
+ closeJob: lazyLoad('./api/ml.close_job.js', opts),
+ delete_calendar: lazyLoad('./api/ml.delete_calendar.js', opts),
+ deleteCalendar: lazyLoad('./api/ml.delete_calendar.js', opts),
+ delete_calendar_event: lazyLoad('./api/ml.delete_calendar_event.js', opts),
+ deleteCalendarEvent: lazyLoad('./api/ml.delete_calendar_event.js', opts),
+ delete_calendar_job: lazyLoad('./api/ml.delete_calendar_job.js', opts),
+ deleteCalendarJob: lazyLoad('./api/ml.delete_calendar_job.js', opts),
+ delete_datafeed: lazyLoad('./api/ml.delete_datafeed.js', opts),
+ deleteDatafeed: lazyLoad('./api/ml.delete_datafeed.js', opts),
+ delete_expired_data: lazyLoad('./api/ml.delete_expired_data.js', opts),
+ deleteExpiredData: lazyLoad('./api/ml.delete_expired_data.js', opts),
+ delete_filter: lazyLoad('./api/ml.delete_filter.js', opts),
+ deleteFilter: lazyLoad('./api/ml.delete_filter.js', opts),
+ delete_forecast: lazyLoad('./api/ml.delete_forecast.js', opts),
+ deleteForecast: lazyLoad('./api/ml.delete_forecast.js', opts),
+ delete_job: lazyLoad('./api/ml.delete_job.js', opts),
+ deleteJob: lazyLoad('./api/ml.delete_job.js', opts),
+ delete_model_snapshot: lazyLoad('./api/ml.delete_model_snapshot.js', opts),
+ deleteModelSnapshot: lazyLoad('./api/ml.delete_model_snapshot.js', opts),
+ find_file_structure: lazyLoad('./api/ml.find_file_structure.js', opts),
+ findFileStructure: lazyLoad('./api/ml.find_file_structure.js', opts),
+ flush_job: lazyLoad('./api/ml.flush_job.js', opts),
+ flushJob: lazyLoad('./api/ml.flush_job.js', opts),
+ forecast: lazyLoad('./api/ml.forecast.js', opts),
+ get_buckets: lazyLoad('./api/ml.get_buckets.js', opts),
+ getBuckets: lazyLoad('./api/ml.get_buckets.js', opts),
+ get_calendar_events: lazyLoad('./api/ml.get_calendar_events.js', opts),
+ getCalendarEvents: lazyLoad('./api/ml.get_calendar_events.js', opts),
+ get_calendars: lazyLoad('./api/ml.get_calendars.js', opts),
+ getCalendars: lazyLoad('./api/ml.get_calendars.js', opts),
+ get_categories: lazyLoad('./api/ml.get_categories.js', opts),
+ getCategories: lazyLoad('./api/ml.get_categories.js', opts),
+ get_datafeed_stats: lazyLoad('./api/ml.get_datafeed_stats.js', opts),
+ getDatafeedStats: lazyLoad('./api/ml.get_datafeed_stats.js', opts),
+ get_datafeeds: lazyLoad('./api/ml.get_datafeeds.js', opts),
+ getDatafeeds: lazyLoad('./api/ml.get_datafeeds.js', opts),
+ get_filters: lazyLoad('./api/ml.get_filters.js', opts),
+ getFilters: lazyLoad('./api/ml.get_filters.js', opts),
+ get_influencers: lazyLoad('./api/ml.get_influencers.js', opts),
+ getInfluencers: lazyLoad('./api/ml.get_influencers.js', opts),
+ get_job_stats: lazyLoad('./api/ml.get_job_stats.js', opts),
+ getJobStats: lazyLoad('./api/ml.get_job_stats.js', opts),
+ get_jobs: lazyLoad('./api/ml.get_jobs.js', opts),
+ getJobs: lazyLoad('./api/ml.get_jobs.js', opts),
+ get_model_snapshots: lazyLoad('./api/ml.get_model_snapshots.js', opts),
+ getModelSnapshots: lazyLoad('./api/ml.get_model_snapshots.js', opts),
+ get_overall_buckets: lazyLoad('./api/ml.get_overall_buckets.js', opts),
+ getOverallBuckets: lazyLoad('./api/ml.get_overall_buckets.js', opts),
+ get_records: lazyLoad('./api/ml.get_records.js', opts),
+ getRecords: lazyLoad('./api/ml.get_records.js', opts),
+ info: lazyLoad('./api/ml.info.js', opts),
+ open_job: lazyLoad('./api/ml.open_job.js', opts),
+ openJob: lazyLoad('./api/ml.open_job.js', opts),
+ post_calendar_events: lazyLoad('./api/ml.post_calendar_events.js', opts),
+ postCalendarEvents: lazyLoad('./api/ml.post_calendar_events.js', opts),
+ post_data: lazyLoad('./api/ml.post_data.js', opts),
+ postData: lazyLoad('./api/ml.post_data.js', opts),
+ preview_datafeed: lazyLoad('./api/ml.preview_datafeed.js', opts),
+ previewDatafeed: lazyLoad('./api/ml.preview_datafeed.js', opts),
+ put_calendar: lazyLoad('./api/ml.put_calendar.js', opts),
+ putCalendar: lazyLoad('./api/ml.put_calendar.js', opts),
+ put_calendar_job: lazyLoad('./api/ml.put_calendar_job.js', opts),
+ putCalendarJob: lazyLoad('./api/ml.put_calendar_job.js', opts),
+ put_datafeed: lazyLoad('./api/ml.put_datafeed.js', opts),
+ putDatafeed: lazyLoad('./api/ml.put_datafeed.js', opts),
+ put_filter: lazyLoad('./api/ml.put_filter.js', opts),
+ putFilter: lazyLoad('./api/ml.put_filter.js', opts),
+ put_job: lazyLoad('./api/ml.put_job.js', opts),
+ putJob: lazyLoad('./api/ml.put_job.js', opts),
+ revert_model_snapshot: lazyLoad('./api/ml.revert_model_snapshot.js', opts),
+ revertModelSnapshot: lazyLoad('./api/ml.revert_model_snapshot.js', opts),
+ set_upgrade_mode: lazyLoad('./api/ml.set_upgrade_mode.js', opts),
+ setUpgradeMode: lazyLoad('./api/ml.set_upgrade_mode.js', opts),
+ start_datafeed: lazyLoad('./api/ml.start_datafeed.js', opts),
+ startDatafeed: lazyLoad('./api/ml.start_datafeed.js', opts),
+ stop_datafeed: lazyLoad('./api/ml.stop_datafeed.js', opts),
+ stopDatafeed: lazyLoad('./api/ml.stop_datafeed.js', opts),
+ update_datafeed: lazyLoad('./api/ml.update_datafeed.js', opts),
+ updateDatafeed: lazyLoad('./api/ml.update_datafeed.js', opts),
+ update_filter: lazyLoad('./api/ml.update_filter.js', opts),
+ updateFilter: lazyLoad('./api/ml.update_filter.js', opts),
+ update_job: lazyLoad('./api/ml.update_job.js', opts),
+ updateJob: lazyLoad('./api/ml.update_job.js', opts),
+ update_model_snapshot: lazyLoad('./api/ml.update_model_snapshot.js', opts),
+ updateModelSnapshot: lazyLoad('./api/ml.update_model_snapshot.js', opts),
+ validate: lazyLoad('./api/ml.validate.js', opts),
+ validate_detector: lazyLoad('./api/ml.validate_detector.js', opts),
+ validateDetector: lazyLoad('./api/ml.validate_detector.js', opts)
+ },
+ monitoring: {
+ bulk: lazyLoad('./api/monitoring.bulk.js', opts)
+ },
+ msearch: lazyLoad('./api/msearch.js', opts),
+ msearch_template: lazyLoad('./api/msearch_template.js', opts),
+ msearchTemplate: lazyLoad('./api/msearch_template.js', opts),
+ mtermvectors: lazyLoad('./api/mtermvectors.js', opts),
+ nodes: {
+ hot_threads: lazyLoad('./api/nodes.hot_threads.js', opts),
+ hotThreads: lazyLoad('./api/nodes.hot_threads.js', opts),
+ info: lazyLoad('./api/nodes.info.js', opts),
+ reload_secure_settings: lazyLoad('./api/nodes.reload_secure_settings.js', opts),
+ reloadSecureSettings: lazyLoad('./api/nodes.reload_secure_settings.js', opts),
+ stats: lazyLoad('./api/nodes.stats.js', opts),
+ usage: lazyLoad('./api/nodes.usage.js', opts)
+ },
+ ping: lazyLoad('./api/ping.js', opts),
+ put_script: lazyLoad('./api/put_script.js', opts),
+ putScript: lazyLoad('./api/put_script.js', opts),
+ rank_eval: lazyLoad('./api/rank_eval.js', opts),
+ rankEval: lazyLoad('./api/rank_eval.js', opts),
+ reindex: lazyLoad('./api/reindex.js', opts),
+ reindex_rethrottle: lazyLoad('./api/reindex_rethrottle.js', opts),
+ reindexRethrottle: lazyLoad('./api/reindex_rethrottle.js', opts),
+ render_search_template: lazyLoad('./api/render_search_template.js', opts),
+ renderSearchTemplate: lazyLoad('./api/render_search_template.js', opts),
+ scripts_painless_execute: lazyLoad('./api/scripts_painless_execute.js', opts),
+ scriptsPainlessExecute: lazyLoad('./api/scripts_painless_execute.js', opts),
+ scroll: lazyLoad('./api/scroll.js', opts),
+ search: lazyLoad('./api/search.js', opts),
+ search_shards: lazyLoad('./api/search_shards.js', opts),
+ searchShards: lazyLoad('./api/search_shards.js', opts),
+ search_template: lazyLoad('./api/search_template.js', opts),
+ searchTemplate: lazyLoad('./api/search_template.js', opts),
+ security: {
+ authenticate: lazyLoad('./api/security.authenticate.js', opts),
+ change_password: lazyLoad('./api/security.change_password.js', opts),
+ changePassword: lazyLoad('./api/security.change_password.js', opts),
+ clear_cached_realms: lazyLoad('./api/security.clear_cached_realms.js', opts),
+ clearCachedRealms: lazyLoad('./api/security.clear_cached_realms.js', opts),
+ clear_cached_roles: lazyLoad('./api/security.clear_cached_roles.js', opts),
+ clearCachedRoles: lazyLoad('./api/security.clear_cached_roles.js', opts),
+ create_api_key: lazyLoad('./api/security.create_api_key.js', opts),
+ createApiKey: lazyLoad('./api/security.create_api_key.js', opts),
+ delete_privileges: lazyLoad('./api/security.delete_privileges.js', opts),
+ deletePrivileges: lazyLoad('./api/security.delete_privileges.js', opts),
+ delete_role: lazyLoad('./api/security.delete_role.js', opts),
+ deleteRole: lazyLoad('./api/security.delete_role.js', opts),
+ delete_role_mapping: lazyLoad('./api/security.delete_role_mapping.js', opts),
+ deleteRoleMapping: lazyLoad('./api/security.delete_role_mapping.js', opts),
+ delete_user: lazyLoad('./api/security.delete_user.js', opts),
+ deleteUser: lazyLoad('./api/security.delete_user.js', opts),
+ disable_user: lazyLoad('./api/security.disable_user.js', opts),
+ disableUser: lazyLoad('./api/security.disable_user.js', opts),
+ enable_user: lazyLoad('./api/security.enable_user.js', opts),
+ enableUser: lazyLoad('./api/security.enable_user.js', opts),
+ get_api_key: lazyLoad('./api/security.get_api_key.js', opts),
+ getApiKey: lazyLoad('./api/security.get_api_key.js', opts),
+ get_privileges: lazyLoad('./api/security.get_privileges.js', opts),
+ getPrivileges: lazyLoad('./api/security.get_privileges.js', opts),
+ get_role: lazyLoad('./api/security.get_role.js', opts),
+ getRole: lazyLoad('./api/security.get_role.js', opts),
+ get_role_mapping: lazyLoad('./api/security.get_role_mapping.js', opts),
+ getRoleMapping: lazyLoad('./api/security.get_role_mapping.js', opts),
+ get_token: lazyLoad('./api/security.get_token.js', opts),
+ getToken: lazyLoad('./api/security.get_token.js', opts),
+ get_user: lazyLoad('./api/security.get_user.js', opts),
+ getUser: lazyLoad('./api/security.get_user.js', opts),
+ get_user_privileges: lazyLoad('./api/security.get_user_privileges.js', opts),
+ getUserPrivileges: lazyLoad('./api/security.get_user_privileges.js', opts),
+ has_privileges: lazyLoad('./api/security.has_privileges.js', opts),
+ hasPrivileges: lazyLoad('./api/security.has_privileges.js', opts),
+ invalidate_api_key: lazyLoad('./api/security.invalidate_api_key.js', opts),
+ invalidateApiKey: lazyLoad('./api/security.invalidate_api_key.js', opts),
+ invalidate_token: lazyLoad('./api/security.invalidate_token.js', opts),
+ invalidateToken: lazyLoad('./api/security.invalidate_token.js', opts),
+ put_privileges: lazyLoad('./api/security.put_privileges.js', opts),
+ putPrivileges: lazyLoad('./api/security.put_privileges.js', opts),
+ put_role: lazyLoad('./api/security.put_role.js', opts),
+ putRole: lazyLoad('./api/security.put_role.js', opts),
+ put_role_mapping: lazyLoad('./api/security.put_role_mapping.js', opts),
+ putRoleMapping: lazyLoad('./api/security.put_role_mapping.js', opts),
+ put_user: lazyLoad('./api/security.put_user.js', opts),
+ putUser: lazyLoad('./api/security.put_user.js', opts)
+ },
+ snapshot: {
+ create: lazyLoad('./api/snapshot.create.js', opts),
+ create_repository: lazyLoad('./api/snapshot.create_repository.js', opts),
+ createRepository: lazyLoad('./api/snapshot.create_repository.js', opts),
+ delete: lazyLoad('./api/snapshot.delete.js', opts),
+ delete_repository: lazyLoad('./api/snapshot.delete_repository.js', opts),
+ deleteRepository: lazyLoad('./api/snapshot.delete_repository.js', opts),
+ get: lazyLoad('./api/snapshot.get.js', opts),
+ get_repository: lazyLoad('./api/snapshot.get_repository.js', opts),
+ getRepository: lazyLoad('./api/snapshot.get_repository.js', opts),
+ restore: lazyLoad('./api/snapshot.restore.js', opts),
+ status: lazyLoad('./api/snapshot.status.js', opts),
+ verify_repository: lazyLoad('./api/snapshot.verify_repository.js', opts),
+ verifyRepository: lazyLoad('./api/snapshot.verify_repository.js', opts)
+ },
+ ssl: {
+ certificates: lazyLoad('./api/ssl.certificates.js', opts)
+ },
+ tasks: {
+ cancel: lazyLoad('./api/tasks.cancel.js', opts),
+ get: lazyLoad('./api/tasks.get.js', opts),
+ list: lazyLoad('./api/tasks.list.js', opts)
+ },
+ termvectors: lazyLoad('./api/termvectors.js', opts),
+ update: lazyLoad('./api/update.js', opts),
+ update_by_query: lazyLoad('./api/update_by_query.js', opts),
+ updateByQuery: lazyLoad('./api/update_by_query.js', opts),
+ update_by_query_rethrottle: lazyLoad('./api/update_by_query_rethrottle.js', opts),
+ updateByQueryRethrottle: lazyLoad('./api/update_by_query_rethrottle.js', opts),
+ xpack: {
+ graph: {
+ explore: lazyLoad('./api/xpack.graph.explore.js', opts)
+ },
+ info: lazyLoad('./api/xpack.info.js', opts),
+ license: {
+ delete: lazyLoad('./api/xpack.license.delete.js', opts),
+ get: lazyLoad('./api/xpack.license.get.js', opts),
+ get_basic_status: lazyLoad('./api/xpack.license.get_basic_status.js', opts),
+ getBasicStatus: lazyLoad('./api/xpack.license.get_basic_status.js', opts),
+ get_trial_status: lazyLoad('./api/xpack.license.get_trial_status.js', opts),
+ getTrialStatus: lazyLoad('./api/xpack.license.get_trial_status.js', opts),
+ post: lazyLoad('./api/xpack.license.post.js', opts),
+ post_start_basic: lazyLoad('./api/xpack.license.post_start_basic.js', opts),
+ postStartBasic: lazyLoad('./api/xpack.license.post_start_basic.js', opts),
+ post_start_trial: lazyLoad('./api/xpack.license.post_start_trial.js', opts),
+ postStartTrial: lazyLoad('./api/xpack.license.post_start_trial.js', opts)
+ },
+ migration: {
+ deprecations: lazyLoad('./api/xpack.migration.deprecations.js', opts),
+ get_assistance: lazyLoad('./api/xpack.migration.get_assistance.js', opts),
+ getAssistance: lazyLoad('./api/xpack.migration.get_assistance.js', opts),
+ upgrade: lazyLoad('./api/xpack.migration.upgrade.js', opts)
+ },
+ rollup: {
+ delete_job: lazyLoad('./api/xpack.rollup.delete_job.js', opts),
+ deleteJob: lazyLoad('./api/xpack.rollup.delete_job.js', opts),
+ get_jobs: lazyLoad('./api/xpack.rollup.get_jobs.js', opts),
+ getJobs: lazyLoad('./api/xpack.rollup.get_jobs.js', opts),
+ get_rollup_caps: lazyLoad('./api/xpack.rollup.get_rollup_caps.js', opts),
+ getRollupCaps: lazyLoad('./api/xpack.rollup.get_rollup_caps.js', opts),
+ get_rollup_index_caps: lazyLoad('./api/xpack.rollup.get_rollup_index_caps.js', opts),
+ getRollupIndexCaps: lazyLoad('./api/xpack.rollup.get_rollup_index_caps.js', opts),
+ put_job: lazyLoad('./api/xpack.rollup.put_job.js', opts),
+ putJob: lazyLoad('./api/xpack.rollup.put_job.js', opts),
+ rollup_search: lazyLoad('./api/xpack.rollup.rollup_search.js', opts),
+ rollupSearch: lazyLoad('./api/xpack.rollup.rollup_search.js', opts),
+ start_job: lazyLoad('./api/xpack.rollup.start_job.js', opts),
+ startJob: lazyLoad('./api/xpack.rollup.start_job.js', opts),
+ stop_job: lazyLoad('./api/xpack.rollup.stop_job.js', opts),
+ stopJob: lazyLoad('./api/xpack.rollup.stop_job.js', opts)
+ },
+ sql: {
+ clear_cursor: lazyLoad('./api/xpack.sql.clear_cursor.js', opts),
+ clearCursor: lazyLoad('./api/xpack.sql.clear_cursor.js', opts),
+ query: lazyLoad('./api/xpack.sql.query.js', opts),
+ translate: lazyLoad('./api/xpack.sql.translate.js', opts)
+ },
+ usage: lazyLoad('./api/xpack.usage.js', opts),
+ watcher: {
+ ack_watch: lazyLoad('./api/xpack.watcher.ack_watch.js', opts),
+ ackWatch: lazyLoad('./api/xpack.watcher.ack_watch.js', opts),
+ activate_watch: lazyLoad('./api/xpack.watcher.activate_watch.js', opts),
+ activateWatch: lazyLoad('./api/xpack.watcher.activate_watch.js', opts),
+ deactivate_watch: lazyLoad('./api/xpack.watcher.deactivate_watch.js', opts),
+ deactivateWatch: lazyLoad('./api/xpack.watcher.deactivate_watch.js', opts),
+ delete_watch: lazyLoad('./api/xpack.watcher.delete_watch.js', opts),
+ deleteWatch: lazyLoad('./api/xpack.watcher.delete_watch.js', opts),
+ execute_watch: lazyLoad('./api/xpack.watcher.execute_watch.js', opts),
+ executeWatch: lazyLoad('./api/xpack.watcher.execute_watch.js', opts),
+ get_watch: lazyLoad('./api/xpack.watcher.get_watch.js', opts),
+ getWatch: lazyLoad('./api/xpack.watcher.get_watch.js', opts),
+ put_watch: lazyLoad('./api/xpack.watcher.put_watch.js', opts),
+ putWatch: lazyLoad('./api/xpack.watcher.put_watch.js', opts),
+ start: lazyLoad('./api/xpack.watcher.start.js', opts),
+ stats: lazyLoad('./api/xpack.watcher.stats.js', opts),
+ stop: lazyLoad('./api/xpack.watcher.stop.js', opts)
+ }
+ }
+ }
+
+ return apis
+}
+
+// It's unlikely that a user needs all of our APIs,
+// and since require is a sync operation that takes time
+// (given the amount of APIs we have), let's lazy load them,
+// so a given API file will be required only
+// if the user actually needs that API.
+// The following implementation takes advantage
+// of js closures to have a simple cache with the least overhead.
+function lazyLoad (file, opts) {
+ var fn = null
+ return function _lazyLoad (params, options, callback) {
+ if (fn === null) {
+ fn = require(file)(opts)
+ }
+ return fn(params, options, callback)
+ }
+}
+
+module.exports = ESAPI
diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts
new file mode 100644
index 000000000..755fddf88
--- /dev/null
+++ b/api/requestParams.d.ts
@@ -0,0 +1,2021 @@
+/*
+ * 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.
+ */
+
+export interface Generic {
+ method?: string;
+ ignore?: number | number[];
+ filter_path?: string | string[];
+ pretty?: boolean;
+ human?: boolean;
+ error_trace?: boolean;
+ source?: string;
+}
+
+export interface Bulk extends Generic {
+ index?: string;
+ type?: string;
+ wait_for_active_shards?: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+ routing?: string;
+ timeout?: string;
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ pipeline?: string;
+ body: any;
+}
+
+export interface CatAliases extends Generic {
+ name?: string | string[];
+ format?: string;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatAllocation extends Generic {
+ node_id?: string | string[];
+ format?: string;
+ bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatCount extends Generic {
+ index?: string | string[];
+ format?: string;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatFielddata extends Generic {
+ fields?: string | string[];
+ format?: string;
+ bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatHealth extends Generic {
+ format?: string;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ ts?: boolean;
+ v?: boolean;
+}
+
+export interface CatHelp extends Generic {
+ help?: boolean;
+ s?: string | string[];
+}
+
+export interface CatIndices extends Generic {
+ index?: string | string[];
+ format?: string;
+ bytes?: 'b' | 'k' | 'm' | 'g';
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ health?: 'green' | 'yellow' | 'red';
+ help?: boolean;
+ pri?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatMaster extends Generic {
+ format?: string;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatNodeattrs extends Generic {
+ format?: string;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatNodes extends Generic {
+ format?: string;
+ full_id?: boolean;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatPendingTasks extends Generic {
+ format?: string;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatPlugins extends Generic {
+ format?: string;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatRecovery extends Generic {
+ index?: string | string[];
+ format?: string;
+ bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatRepositories extends Generic {
+ format?: string;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatSegments extends Generic {
+ index?: string | string[];
+ format?: string;
+ bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatShards extends Generic {
+ index?: string | string[];
+ format?: string;
+ bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatSnapshots extends Generic {
+ repository?: string | string[];
+ format?: string;
+ ignore_unavailable?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatTasks extends Generic {
+ format?: string;
+ node_id?: string | string[];
+ actions?: string | string[];
+ detailed?: boolean;
+ parent_task?: number;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatTemplates extends Generic {
+ name?: string;
+ format?: string;
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface CatThreadPool extends Generic {
+ thread_pool_patterns?: string | string[];
+ format?: string;
+ size?: '' | 'k' | 'm' | 'g' | 't' | 'p';
+ local?: boolean;
+ master_timeout?: string;
+ h?: string | string[];
+ help?: boolean;
+ s?: string | string[];
+ v?: boolean;
+}
+
+export interface ClearScroll extends Generic {
+ scroll_id?: string | string[];
+ body?: any;
+}
+
+export interface ClusterAllocationExplain extends Generic {
+ include_yes_decisions?: boolean;
+ include_disk_info?: boolean;
+ body?: any;
+}
+
+export interface ClusterGetSettings extends Generic {
+ flat_settings?: boolean;
+ master_timeout?: string;
+ timeout?: string;
+ include_defaults?: boolean;
+}
+
+export interface ClusterHealth extends Generic {
+ index?: string | string[];
+ level?: 'cluster' | 'indices' | 'shards';
+ local?: boolean;
+ master_timeout?: string;
+ timeout?: string;
+ wait_for_active_shards?: string;
+ wait_for_nodes?: string;
+ wait_for_events?: 'immediate' | 'urgent' | 'high' | 'normal' | 'low' | 'languid';
+ wait_for_no_relocating_shards?: boolean;
+ wait_for_no_initializing_shards?: boolean;
+ wait_for_status?: 'green' | 'yellow' | 'red';
+}
+
+export interface ClusterPendingTasks extends Generic {
+ local?: boolean;
+ master_timeout?: string;
+}
+
+export interface ClusterPutSettings extends Generic {
+ flat_settings?: boolean;
+ master_timeout?: string;
+ timeout?: string;
+ body: any;
+}
+
+export interface ClusterRemoteInfo extends Generic {
+}
+
+export interface ClusterReroute extends Generic {
+ dry_run?: boolean;
+ explain?: boolean;
+ retry_failed?: boolean;
+ metric?: string | string[];
+ master_timeout?: string;
+ timeout?: string;
+ body?: any;
+}
+
+export interface ClusterState extends Generic {
+ index?: string | string[];
+ metric?: string | string[];
+ local?: boolean;
+ master_timeout?: string;
+ flat_settings?: boolean;
+ wait_for_metadata_version?: number;
+ wait_for_timeout?: string;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface ClusterStats extends Generic {
+ node_id?: string | string[];
+ flat_settings?: boolean;
+ timeout?: string;
+}
+
+export interface Count extends Generic {
+ index?: string | string[];
+ type?: string | string[];
+ ignore_unavailable?: boolean;
+ ignore_throttled?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ min_score?: number;
+ preference?: string;
+ routing?: string | string[];
+ q?: string;
+ analyzer?: string;
+ analyze_wildcard?: boolean;
+ default_operator?: 'AND' | 'OR';
+ df?: string;
+ lenient?: boolean;
+ terminate_after?: number;
+ body?: any;
+}
+
+export interface Create extends Generic {
+ id: string;
+ index: string;
+ type?: string;
+ wait_for_active_shards?: string;
+ parent?: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+ routing?: string;
+ timeout?: string;
+ version?: number;
+ version_type?: 'internal' | 'external' | 'external_gte' | 'force';
+ pipeline?: string;
+ body: any;
+}
+
+export interface Delete extends Generic {
+ id: string;
+ index: string;
+ type?: string;
+ wait_for_active_shards?: string;
+ parent?: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+ routing?: string;
+ timeout?: string;
+ if_seq_no?: number;
+ if_primary_term?: number;
+ version?: number;
+ version_type?: 'internal' | 'external' | 'external_gte' | 'force';
+}
+
+export interface DeleteByQuery extends Generic {
+ index: string | string[];
+ type?: string | string[];
+ analyzer?: string;
+ analyze_wildcard?: boolean;
+ default_operator?: 'AND' | 'OR';
+ df?: string;
+ from?: number;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ conflicts?: 'abort' | 'proceed';
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ lenient?: boolean;
+ preference?: string;
+ q?: string;
+ routing?: string | string[];
+ scroll?: string;
+ search_type?: 'query_then_fetch' | 'dfs_query_then_fetch';
+ search_timeout?: string;
+ size?: number;
+ sort?: string | string[];
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ terminate_after?: number;
+ stats?: string | string[];
+ version?: boolean;
+ request_cache?: boolean;
+ refresh?: boolean;
+ timeout?: string;
+ wait_for_active_shards?: string;
+ scroll_size?: number;
+ wait_for_completion?: boolean;
+ requests_per_second?: number;
+ slices?: number;
+ body: any;
+}
+
+export interface DeleteByQueryRethrottle extends Generic {
+ task_id: string;
+ requests_per_second: number;
+}
+
+export interface DeleteScript extends Generic {
+ id: string;
+ timeout?: string;
+ master_timeout?: string;
+}
+
+export interface Exists extends Generic {
+ id: string;
+ index: string;
+ type?: string;
+ stored_fields?: string | string[];
+ parent?: string;
+ preference?: string;
+ realtime?: boolean;
+ refresh?: boolean;
+ routing?: string;
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ version?: number;
+ version_type?: 'internal' | 'external' | 'external_gte' | 'force';
+}
+
+export interface ExistsSource extends Generic {
+ id: string;
+ index: string;
+ type?: string;
+ parent?: string;
+ preference?: string;
+ realtime?: boolean;
+ refresh?: boolean;
+ routing?: string;
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ version?: number;
+ version_type?: 'internal' | 'external' | 'external_gte' | 'force';
+}
+
+export interface Explain extends Generic {
+ id: string;
+ index: string;
+ type?: string;
+ analyze_wildcard?: boolean;
+ analyzer?: string;
+ default_operator?: 'AND' | 'OR';
+ df?: string;
+ stored_fields?: string | string[];
+ lenient?: boolean;
+ parent?: string;
+ preference?: string;
+ q?: string;
+ routing?: string;
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ body?: any;
+}
+
+export interface FieldCaps extends Generic {
+ index?: string | string[];
+ fields?: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface Get extends Generic {
+ id: string;
+ index: string;
+ type?: string;
+ stored_fields?: string | string[];
+ parent?: string;
+ preference?: string;
+ realtime?: boolean;
+ refresh?: boolean;
+ routing?: string;
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ _source_exclude?: string | string[];
+ _source_include?: string | string[];
+ version?: number;
+ version_type?: 'internal' | 'external' | 'external_gte' | 'force';
+}
+
+export interface GetScript extends Generic {
+ id: string;
+ master_timeout?: string;
+}
+
+export interface GetSource extends Generic {
+ id: string;
+ index: string;
+ type?: string;
+ parent?: string;
+ preference?: string;
+ realtime?: boolean;
+ refresh?: boolean;
+ routing?: string;
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ version?: number;
+ version_type?: 'internal' | 'external' | 'external_gte' | 'force';
+}
+
+export interface Index extends Generic {
+ id?: string;
+ index: string;
+ type?: string;
+ wait_for_active_shards?: string;
+ op_type?: 'index' | 'create';
+ parent?: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+ routing?: string;
+ timeout?: string;
+ version?: number;
+ version_type?: 'internal' | 'external' | 'external_gte' | 'force';
+ if_seq_no?: number;
+ if_primary_term?: number;
+ pipeline?: string;
+ body: any;
+}
+
+export interface IndicesAnalyze extends Generic {
+ index?: string;
+ body?: any;
+}
+
+export interface IndicesClearCache extends Generic {
+ index?: string | string[];
+ fielddata?: boolean;
+ fields?: string | string[];
+ query?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ request?: boolean;
+}
+
+export interface IndicesClose extends Generic {
+ index: string | string[];
+ timeout?: string;
+ master_timeout?: string;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface IndicesCreate extends Generic {
+ index: string;
+ include_type_name?: boolean;
+ wait_for_active_shards?: string;
+ timeout?: string;
+ master_timeout?: string;
+ body?: any;
+}
+
+export interface IndicesDelete extends Generic {
+ index: string | string[];
+ timeout?: string;
+ master_timeout?: string;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface IndicesDeleteAlias extends Generic {
+ index: string | string[];
+ name: string | string[];
+ timeout?: string;
+ master_timeout?: string;
+}
+
+export interface IndicesDeleteTemplate extends Generic {
+ name: string;
+ timeout?: string;
+ master_timeout?: string;
+}
+
+export interface IndicesExists extends Generic {
+ index: string | string[];
+ local?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ flat_settings?: boolean;
+ include_defaults?: boolean;
+}
+
+export interface IndicesExistsAlias extends Generic {
+ index?: string | string[];
+ name: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ local?: boolean;
+}
+
+export interface IndicesExistsTemplate extends Generic {
+ name: string | string[];
+ flat_settings?: boolean;
+ master_timeout?: string;
+ local?: boolean;
+}
+
+export interface IndicesExistsType extends Generic {
+ index: string | string[];
+ type: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ local?: boolean;
+}
+
+export interface IndicesFlush extends Generic {
+ index?: string | string[];
+ force?: boolean;
+ wait_if_ongoing?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface IndicesFlushSynced extends Generic {
+ index?: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface IndicesForcemerge extends Generic {
+ index?: string | string[];
+ flush?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ max_num_segments?: number;
+ only_expunge_deletes?: boolean;
+}
+
+export interface IndicesGet extends Generic {
+ index: string | string[];
+ include_type_name?: boolean;
+ local?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ flat_settings?: boolean;
+ include_defaults?: boolean;
+ master_timeout?: string;
+}
+
+export interface IndicesGetAlias extends Generic {
+ index?: string | string[];
+ name?: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ local?: boolean;
+}
+
+export interface IndicesGetFieldMapping extends Generic {
+ index?: string | string[];
+ type?: string | string[];
+ fields: string | string[];
+ include_type_name?: boolean;
+ include_defaults?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ local?: boolean;
+}
+
+export interface IndicesGetMapping extends Generic {
+ index?: string | string[];
+ type?: string | string[];
+ include_type_name?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ master_timeout?: string;
+ local?: boolean;
+}
+
+export interface IndicesGetSettings extends Generic {
+ index?: string | string[];
+ name?: string | string[];
+ master_timeout?: string;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ flat_settings?: boolean;
+ local?: boolean;
+ include_defaults?: boolean;
+}
+
+export interface IndicesGetTemplate extends Generic {
+ name?: string | string[];
+ include_type_name?: boolean;
+ flat_settings?: boolean;
+ master_timeout?: string;
+ local?: boolean;
+}
+
+export interface IndicesGetUpgrade extends Generic {
+ index?: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface IndicesOpen extends Generic {
+ index: string | string[];
+ timeout?: string;
+ master_timeout?: string;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ wait_for_active_shards?: string;
+}
+
+export interface IndicesPutAlias extends Generic {
+ index: string | string[];
+ name: string;
+ timeout?: string;
+ master_timeout?: string;
+ body?: any;
+}
+
+export interface IndicesPutMapping extends Generic {
+ index?: string | string[];
+ type?: string;
+ include_type_name?: boolean;
+ timeout?: string;
+ master_timeout?: string;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ body: any;
+}
+
+export interface IndicesPutSettings extends Generic {
+ index?: string | string[];
+ master_timeout?: string;
+ timeout?: string;
+ preserve_existing?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ flat_settings?: boolean;
+ body: any;
+}
+
+export interface IndicesPutTemplate extends Generic {
+ name: string;
+ include_type_name?: boolean;
+ order?: number;
+ create?: boolean;
+ timeout?: string;
+ master_timeout?: string;
+ flat_settings?: boolean;
+ body: any;
+}
+
+export interface IndicesRecovery extends Generic {
+ index?: string | string[];
+ detailed?: boolean;
+ active_only?: boolean;
+}
+
+export interface IndicesRefresh extends Generic {
+ index?: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface IndicesRollover extends Generic {
+ alias: string;
+ new_index?: string;
+ include_type_name?: boolean;
+ timeout?: string;
+ dry_run?: boolean;
+ master_timeout?: string;
+ wait_for_active_shards?: string;
+ body?: any;
+}
+
+export interface IndicesSegments extends Generic {
+ index?: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ verbose?: boolean;
+}
+
+export interface IndicesShardStores extends Generic {
+ index?: string | string[];
+ status?: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface IndicesShrink extends Generic {
+ index: string;
+ target: string;
+ copy_settings?: boolean;
+ timeout?: string;
+ master_timeout?: string;
+ wait_for_active_shards?: string;
+ body?: any;
+}
+
+export interface IndicesSplit extends Generic {
+ index: string;
+ target: string;
+ copy_settings?: boolean;
+ timeout?: string;
+ master_timeout?: string;
+ wait_for_active_shards?: string;
+ body?: any;
+}
+
+export interface IndicesStats extends Generic {
+ index?: string | string[];
+ metric?: string | string[];
+ completion_fields?: string | string[];
+ fielddata_fields?: string | string[];
+ fields?: string | string[];
+ groups?: string | string[];
+ level?: 'cluster' | 'indices' | 'shards';
+ types?: string | string[];
+ include_segment_file_sizes?: boolean;
+}
+
+export interface IndicesUpdateAliases extends Generic {
+ timeout?: string;
+ master_timeout?: string;
+ body: any;
+}
+
+export interface IndicesUpgrade extends Generic {
+ index?: string | string[];
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ ignore_unavailable?: boolean;
+ wait_for_completion?: boolean;
+ only_ancient_segments?: boolean;
+}
+
+export interface IndicesValidateQuery extends Generic {
+ index?: string | string[];
+ type?: string | string[];
+ explain?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ q?: string;
+ analyzer?: string;
+ analyze_wildcard?: boolean;
+ default_operator?: 'AND' | 'OR';
+ df?: string;
+ lenient?: boolean;
+ rewrite?: boolean;
+ all_shards?: boolean;
+ body?: any;
+}
+
+export interface Info extends Generic {
+}
+
+export interface IngestDeletePipeline extends Generic {
+ id: string;
+ master_timeout?: string;
+ timeout?: string;
+}
+
+export interface IngestGetPipeline extends Generic {
+ id?: string;
+ master_timeout?: string;
+}
+
+export interface IngestProcessorGrok extends Generic {
+}
+
+export interface IngestPutPipeline extends Generic {
+ id: string;
+ master_timeout?: string;
+ timeout?: string;
+ body: any;
+}
+
+export interface IngestSimulate extends Generic {
+ id?: string;
+ verbose?: boolean;
+ body: any;
+}
+
+export interface Mget extends Generic {
+ index?: string;
+ type?: string;
+ stored_fields?: string | string[];
+ preference?: string;
+ realtime?: boolean;
+ refresh?: boolean;
+ routing?: string;
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ body: any;
+}
+
+export interface Msearch extends Generic {
+ index?: string | string[];
+ type?: string | string[];
+ search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
+ max_concurrent_searches?: number;
+ typed_keys?: boolean;
+ pre_filter_shard_size?: number;
+ max_concurrent_shard_requests?: number;
+ rest_total_hits_as_int?: boolean;
+ ccs_minimize_roundtrips?: boolean;
+ body: any;
+}
+
+export interface MsearchTemplate extends Generic {
+ index?: string | string[];
+ type?: string | string[];
+ search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
+ typed_keys?: boolean;
+ max_concurrent_searches?: number;
+ rest_total_hits_as_int?: boolean;
+ ccs_minimize_roundtrips?: boolean;
+ body: any;
+}
+
+export interface Mtermvectors extends Generic {
+ index?: string;
+ type?: string;
+ ids?: string | string[];
+ term_statistics?: boolean;
+ field_statistics?: boolean;
+ fields?: string | string[];
+ offsets?: boolean;
+ positions?: boolean;
+ payloads?: boolean;
+ preference?: string;
+ routing?: string;
+ parent?: string;
+ realtime?: boolean;
+ version?: number;
+ version_type?: 'internal' | 'external' | 'external_gte' | 'force';
+ body?: any;
+}
+
+export interface NodesHotThreads extends Generic {
+ node_id?: string | string[];
+ interval?: string;
+ snapshots?: number;
+ threads?: number;
+ ignore_idle_threads?: boolean;
+ type?: 'cpu' | 'wait' | 'block';
+ timeout?: string;
+}
+
+export interface NodesInfo extends Generic {
+ node_id?: string | string[];
+ metric?: string | string[];
+ flat_settings?: boolean;
+ timeout?: string;
+}
+
+export interface NodesReloadSecureSettings extends Generic {
+ node_id?: string | string[];
+ timeout?: string;
+}
+
+export interface NodesStats extends Generic {
+ metric?: string | string[];
+ index_metric?: string | string[];
+ node_id?: string | string[];
+ completion_fields?: string | string[];
+ fielddata_fields?: string | string[];
+ fields?: string | string[];
+ groups?: boolean;
+ level?: 'indices' | 'node' | 'shards';
+ types?: string | string[];
+ timeout?: string;
+ include_segment_file_sizes?: boolean;
+}
+
+export interface NodesUsage extends Generic {
+ metric?: string | string[];
+ node_id?: string | string[];
+ timeout?: string;
+}
+
+export interface Ping extends Generic {
+}
+
+export interface PutScript extends Generic {
+ id: string;
+ context?: string;
+ timeout?: string;
+ master_timeout?: string;
+ body: any;
+}
+
+export interface RankEval extends Generic {
+ index?: string | string[];
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ body: any;
+}
+
+export interface Reindex extends Generic {
+ refresh?: boolean;
+ timeout?: string;
+ wait_for_active_shards?: string;
+ wait_for_completion?: boolean;
+ requests_per_second?: number;
+ slices?: number;
+ body: any;
+}
+
+export interface ReindexRethrottle extends Generic {
+ task_id: string;
+ requests_per_second: number;
+}
+
+export interface RenderSearchTemplate extends Generic {
+ id?: string;
+ body?: any;
+}
+
+export interface ScriptsPainlessExecute extends Generic {
+ body?: any;
+}
+
+export interface Scroll extends Generic {
+ scroll_id?: string;
+ scroll?: string;
+ rest_total_hits_as_int?: boolean;
+ body?: any;
+}
+
+export interface Search extends Generic {
+ index?: string | string[];
+ type?: string | string[];
+ analyzer?: string;
+ analyze_wildcard?: boolean;
+ ccs_minimize_roundtrips?: boolean;
+ default_operator?: 'AND' | 'OR';
+ df?: string;
+ explain?: boolean;
+ stored_fields?: string | string[];
+ docvalue_fields?: string | string[];
+ from?: number;
+ ignore_unavailable?: boolean;
+ ignore_throttled?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ lenient?: boolean;
+ preference?: string;
+ q?: string;
+ routing?: string | string[];
+ scroll?: string;
+ search_type?: 'query_then_fetch' | 'dfs_query_then_fetch';
+ size?: number;
+ sort?: string | string[];
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ terminate_after?: number;
+ stats?: string | string[];
+ suggest_field?: string;
+ suggest_mode?: 'missing' | 'popular' | 'always';
+ suggest_size?: number;
+ suggest_text?: string;
+ timeout?: string;
+ track_scores?: boolean;
+ track_total_hits?: boolean;
+ allow_partial_search_results?: boolean;
+ typed_keys?: boolean;
+ version?: boolean;
+ seq_no_primary_term?: boolean;
+ request_cache?: boolean;
+ batched_reduce_size?: number;
+ max_concurrent_shard_requests?: number;
+ pre_filter_shard_size?: number;
+ rest_total_hits_as_int?: boolean;
+ body?: any;
+}
+
+export interface SearchShards extends Generic {
+ index?: string | string[];
+ preference?: string;
+ routing?: string;
+ local?: boolean;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+}
+
+export interface SearchTemplate extends Generic {
+ index?: string | string[];
+ type?: string | string[];
+ ignore_unavailable?: boolean;
+ ignore_throttled?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ preference?: string;
+ routing?: string | string[];
+ scroll?: string;
+ search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
+ explain?: boolean;
+ profile?: boolean;
+ typed_keys?: boolean;
+ rest_total_hits_as_int?: boolean;
+ ccs_minimize_roundtrips?: boolean;
+ body: any;
+}
+
+export interface SnapshotCreate extends Generic {
+ repository: string;
+ snapshot: string;
+ master_timeout?: string;
+ wait_for_completion?: boolean;
+ body?: any;
+}
+
+export interface SnapshotCreateRepository extends Generic {
+ repository: string;
+ master_timeout?: string;
+ timeout?: string;
+ verify?: boolean;
+ body: any;
+}
+
+export interface SnapshotDelete extends Generic {
+ repository: string;
+ snapshot: string;
+ master_timeout?: string;
+}
+
+export interface SnapshotDeleteRepository extends Generic {
+ repository: string | string[];
+ master_timeout?: string;
+ timeout?: string;
+}
+
+export interface SnapshotGet extends Generic {
+ repository: string;
+ snapshot: string | string[];
+ master_timeout?: string;
+ ignore_unavailable?: boolean;
+ verbose?: boolean;
+}
+
+export interface SnapshotGetRepository extends Generic {
+ repository?: string | string[];
+ master_timeout?: string;
+ local?: boolean;
+}
+
+export interface SnapshotRestore extends Generic {
+ repository: string;
+ snapshot: string;
+ master_timeout?: string;
+ wait_for_completion?: boolean;
+ body?: any;
+}
+
+export interface SnapshotStatus extends Generic {
+ repository?: string;
+ snapshot?: string | string[];
+ master_timeout?: string;
+ ignore_unavailable?: boolean;
+}
+
+export interface SnapshotVerifyRepository extends Generic {
+ repository: string;
+ master_timeout?: string;
+ timeout?: string;
+}
+
+export interface TasksCancel extends Generic {
+ task_id?: string;
+ nodes?: string | string[];
+ actions?: string | string[];
+ parent_task_id?: string;
+}
+
+export interface TasksGet extends Generic {
+ task_id: string;
+ wait_for_completion?: boolean;
+ timeout?: string;
+}
+
+export interface TasksList extends Generic {
+ nodes?: string | string[];
+ actions?: string | string[];
+ detailed?: boolean;
+ parent_task_id?: string;
+ wait_for_completion?: boolean;
+ group_by?: 'nodes' | 'parents' | 'none';
+ timeout?: string;
+}
+
+export interface Termvectors extends Generic {
+ index: string;
+ type?: string;
+ id?: string;
+ term_statistics?: boolean;
+ field_statistics?: boolean;
+ fields?: string | string[];
+ offsets?: boolean;
+ positions?: boolean;
+ payloads?: boolean;
+ preference?: string;
+ routing?: string;
+ parent?: string;
+ realtime?: boolean;
+ version?: number;
+ version_type?: 'internal' | 'external' | 'external_gte' | 'force';
+ body?: any;
+}
+
+export interface Update extends Generic {
+ id: string;
+ index: string;
+ type?: string;
+ wait_for_active_shards?: string;
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ lang?: string;
+ parent?: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+ retry_on_conflict?: number;
+ routing?: string;
+ timeout?: string;
+ if_seq_no?: number;
+ if_primary_term?: number;
+ body: any;
+}
+
+export interface UpdateByQuery extends Generic {
+ index: string | string[];
+ type?: string | string[];
+ analyzer?: string;
+ analyze_wildcard?: boolean;
+ default_operator?: 'AND' | 'OR';
+ df?: string;
+ from?: number;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ conflicts?: 'abort' | 'proceed';
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ lenient?: boolean;
+ pipeline?: string;
+ preference?: string;
+ q?: string;
+ routing?: string | string[];
+ scroll?: string;
+ search_type?: 'query_then_fetch' | 'dfs_query_then_fetch';
+ search_timeout?: string;
+ size?: number;
+ sort?: string | string[];
+ _source?: string | string[];
+ _source_excludes?: string | string[];
+ _source_includes?: string | string[];
+ terminate_after?: number;
+ stats?: string | string[];
+ version?: boolean;
+ version_type?: boolean;
+ request_cache?: boolean;
+ refresh?: boolean;
+ timeout?: string;
+ wait_for_active_shards?: string;
+ scroll_size?: number;
+ wait_for_completion?: boolean;
+ requests_per_second?: number;
+ slices?: number;
+ body?: any;
+}
+
+export interface UpdateByQueryRethrottle extends Generic {
+ task_id: string;
+ requests_per_second: number;
+}
+
+export interface CcrDeleteAutoFollowPattern extends Generic {
+ name: string;
+}
+
+export interface CcrFollow extends Generic {
+ index: string;
+ wait_for_active_shards?: string;
+ body: any;
+}
+
+export interface CcrFollowInfo extends Generic {
+ index?: string | string[];
+}
+
+export interface CcrFollowStats extends Generic {
+ index?: string | string[];
+}
+
+export interface CcrGetAutoFollowPattern extends Generic {
+ name?: string;
+}
+
+export interface CcrPauseFollow extends Generic {
+ index: string;
+}
+
+export interface CcrPutAutoFollowPattern extends Generic {
+ name: string;
+ body: any;
+}
+
+export interface CcrResumeFollow extends Generic {
+ index: string;
+ body?: any;
+}
+
+export interface CcrStats extends Generic {
+}
+
+export interface CcrUnfollow extends Generic {
+ index: string;
+}
+
+export interface IlmDeleteLifecycle extends Generic {
+ policy?: string;
+}
+
+export interface IlmExplainLifecycle extends Generic {
+ index?: string;
+ human?: boolean;
+}
+
+export interface IlmGetLifecycle extends Generic {
+ policy?: string;
+}
+
+export interface IlmGetStatus extends Generic {
+}
+
+export interface IlmMoveToStep extends Generic {
+ index?: string;
+ body?: any;
+}
+
+export interface IlmPutLifecycle extends Generic {
+ policy?: string;
+ body?: any;
+}
+
+export interface IlmRemovePolicy extends Generic {
+ index?: string;
+}
+
+export interface IlmRetry extends Generic {
+ index?: string;
+}
+
+export interface IlmStart extends Generic {
+}
+
+export interface IlmStop extends Generic {
+}
+
+export interface IndicesFreeze extends Generic {
+ index: string;
+ timeout?: string;
+ master_timeout?: string;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ wait_for_active_shards?: string;
+}
+
+export interface IndicesUnfreeze extends Generic {
+ index: string;
+ timeout?: string;
+ master_timeout?: string;
+ ignore_unavailable?: boolean;
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ wait_for_active_shards?: string;
+}
+
+export interface MlCloseJob extends Generic {
+ job_id: string;
+ allow_no_jobs?: boolean;
+ force?: boolean;
+ timeout?: string;
+ body?: any;
+}
+
+export interface MlDeleteCalendar extends Generic {
+ calendar_id: string;
+}
+
+export interface MlDeleteCalendarEvent extends Generic {
+ calendar_id: string;
+ event_id: string;
+}
+
+export interface MlDeleteCalendarJob extends Generic {
+ calendar_id: string;
+ job_id: string;
+}
+
+export interface MlDeleteDatafeed extends Generic {
+ datafeed_id: string;
+ force?: boolean;
+}
+
+export interface MlDeleteExpiredData extends Generic {
+}
+
+export interface MlDeleteFilter extends Generic {
+ filter_id: string;
+}
+
+export interface MlDeleteForecast extends Generic {
+ job_id: string;
+ forecast_id?: string;
+ allow_no_forecasts?: boolean;
+ timeout?: string;
+}
+
+export interface MlDeleteJob extends Generic {
+ job_id: string;
+ force?: boolean;
+ wait_for_completion?: boolean;
+}
+
+export interface MlDeleteModelSnapshot extends Generic {
+ job_id: string;
+ snapshot_id: string;
+}
+
+export interface MlFindFileStructure extends Generic {
+ lines_to_sample?: number;
+ timeout?: string;
+ charset?: string;
+ format?: 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text';
+ has_header_row?: boolean;
+ column_names?: string | string[];
+ delimiter?: string;
+ quote?: string;
+ should_trim_fields?: boolean;
+ grok_pattern?: string;
+ timestamp_field?: string;
+ timestamp_format?: string;
+ explain?: boolean;
+ body: any;
+}
+
+export interface MlFlushJob extends Generic {
+ job_id: string;
+ calc_interim?: boolean;
+ start?: string;
+ end?: string;
+ advance_time?: string;
+ skip_time?: string;
+ body?: any;
+}
+
+export interface MlForecast extends Generic {
+ job_id: string;
+ duration?: string;
+ expires_in?: string;
+}
+
+export interface MlGetBuckets extends Generic {
+ job_id: string;
+ timestamp?: string;
+ expand?: boolean;
+ exclude_interim?: boolean;
+ from?: number;
+ size?: number;
+ start?: string;
+ end?: string;
+ anomaly_score?: number;
+ sort?: string;
+ desc?: boolean;
+ body?: any;
+}
+
+export interface MlGetCalendarEvents extends Generic {
+ calendar_id: string;
+ job_id?: string;
+ start?: string;
+ end?: string;
+ from?: number;
+ size?: number;
+}
+
+export interface MlGetCalendars extends Generic {
+ calendar_id?: string;
+ from?: number;
+ size?: number;
+}
+
+export interface MlGetCategories extends Generic {
+ job_id: string;
+ category_id?: number;
+ from?: number;
+ size?: number;
+ body?: any;
+}
+
+export interface MlGetDatafeedStats extends Generic {
+ datafeed_id?: string;
+ allow_no_datafeeds?: boolean;
+}
+
+export interface MlGetDatafeeds extends Generic {
+ datafeed_id?: string;
+ allow_no_datafeeds?: boolean;
+}
+
+export interface MlGetFilters extends Generic {
+ filter_id?: string;
+ from?: number;
+ size?: number;
+}
+
+export interface MlGetInfluencers extends Generic {
+ job_id: string;
+ exclude_interim?: boolean;
+ from?: number;
+ size?: number;
+ start?: string;
+ end?: string;
+ influencer_score?: number;
+ sort?: string;
+ desc?: boolean;
+ body?: any;
+}
+
+export interface MlGetJobStats extends Generic {
+ job_id?: string;
+ allow_no_jobs?: boolean;
+}
+
+export interface MlGetJobs extends Generic {
+ job_id?: string;
+ allow_no_jobs?: boolean;
+}
+
+export interface MlGetModelSnapshots extends Generic {
+ job_id: string;
+ snapshot_id?: string;
+ from?: number;
+ size?: number;
+ start?: string;
+ end?: string;
+ sort?: string;
+ desc?: boolean;
+ body?: any;
+}
+
+export interface MlGetOverallBuckets extends Generic {
+ job_id: string;
+ top_n?: number;
+ bucket_span?: string;
+ overall_score?: number;
+ exclude_interim?: boolean;
+ start?: string;
+ end?: string;
+ allow_no_jobs?: boolean;
+ body?: any;
+}
+
+export interface MlGetRecords extends Generic {
+ job_id: string;
+ exclude_interim?: boolean;
+ from?: number;
+ size?: number;
+ start?: string;
+ end?: string;
+ record_score?: number;
+ sort?: string;
+ desc?: boolean;
+ body?: any;
+}
+
+export interface MlInfo extends Generic {
+}
+
+export interface MlOpenJob extends Generic {
+ job_id: string;
+ ignore_downtime?: boolean;
+ timeout?: string;
+}
+
+export interface MlPostCalendarEvents extends Generic {
+ calendar_id: string;
+ body: any;
+}
+
+export interface MlPostData extends Generic {
+ job_id: string;
+ reset_start?: string;
+ reset_end?: string;
+ body: any;
+}
+
+export interface MlPreviewDatafeed extends Generic {
+ datafeed_id: string;
+}
+
+export interface MlPutCalendar extends Generic {
+ calendar_id: string;
+ body?: any;
+}
+
+export interface MlPutCalendarJob extends Generic {
+ calendar_id: string;
+ job_id: string;
+}
+
+export interface MlPutDatafeed extends Generic {
+ datafeed_id: string;
+ body: any;
+}
+
+export interface MlPutFilter extends Generic {
+ filter_id: string;
+ body: any;
+}
+
+export interface MlPutJob extends Generic {
+ job_id: string;
+ body: any;
+}
+
+export interface MlRevertModelSnapshot extends Generic {
+ job_id: string;
+ snapshot_id: string;
+ delete_intervening_results?: boolean;
+ body?: any;
+}
+
+export interface MlSetUpgradeMode extends Generic {
+ enabled?: boolean;
+ timeout?: string;
+}
+
+export interface MlStartDatafeed extends Generic {
+ datafeed_id: string;
+ start?: string;
+ end?: string;
+ timeout?: string;
+ body?: any;
+}
+
+export interface MlStopDatafeed extends Generic {
+ datafeed_id: string;
+ allow_no_datafeeds?: boolean;
+ force?: boolean;
+ timeout?: string;
+}
+
+export interface MlUpdateDatafeed extends Generic {
+ datafeed_id: string;
+ body: any;
+}
+
+export interface MlUpdateFilter extends Generic {
+ filter_id: string;
+ body: any;
+}
+
+export interface MlUpdateJob extends Generic {
+ job_id: string;
+ body: any;
+}
+
+export interface MlUpdateModelSnapshot extends Generic {
+ job_id: string;
+ snapshot_id: string;
+ body: any;
+}
+
+export interface MlValidate extends Generic {
+ body: any;
+}
+
+export interface MlValidateDetector extends Generic {
+ body: any;
+}
+
+export interface MonitoringBulk extends Generic {
+ type?: string;
+ system_id?: string;
+ system_api_version?: string;
+ interval?: string;
+ body: any;
+}
+
+export interface SecurityAuthenticate extends Generic {
+}
+
+export interface SecurityChangePassword extends Generic {
+ username?: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+ body: any;
+}
+
+export interface SecurityClearCachedRealms extends Generic {
+ realms: string | string[];
+ usernames?: string | string[];
+}
+
+export interface SecurityClearCachedRoles extends Generic {
+ name: string | string[];
+}
+
+export interface SecurityCreateApiKey extends Generic {
+ refresh?: 'true' | 'false' | 'wait_for';
+ body: any;
+}
+
+export interface SecurityDeletePrivileges extends Generic {
+ application: string;
+ name: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+}
+
+export interface SecurityDeleteRole extends Generic {
+ name: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+}
+
+export interface SecurityDeleteRoleMapping extends Generic {
+ name: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+}
+
+export interface SecurityDeleteUser extends Generic {
+ username: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+}
+
+export interface SecurityDisableUser extends Generic {
+ username?: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+}
+
+export interface SecurityEnableUser extends Generic {
+ username?: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+}
+
+export interface SecurityGetApiKey extends Generic {
+ id?: string;
+ name?: string;
+ username?: string;
+ realm_name?: string;
+}
+
+export interface SecurityGetPrivileges extends Generic {
+ application?: string;
+ name?: string;
+}
+
+export interface SecurityGetRole extends Generic {
+ name?: string;
+}
+
+export interface SecurityGetRoleMapping extends Generic {
+ name?: string;
+}
+
+export interface SecurityGetToken extends Generic {
+ body: any;
+}
+
+export interface SecurityGetUser extends Generic {
+ username?: string | string[];
+}
+
+export interface SecurityGetUserPrivileges extends Generic {
+}
+
+export interface SecurityHasPrivileges extends Generic {
+ user?: string;
+ body: any;
+}
+
+export interface SecurityInvalidateApiKey extends Generic {
+ body: any;
+}
+
+export interface SecurityInvalidateToken extends Generic {
+ body: any;
+}
+
+export interface SecurityPutPrivileges extends Generic {
+ refresh?: 'true' | 'false' | 'wait_for';
+ body: any;
+}
+
+export interface SecurityPutRole extends Generic {
+ name: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+ body: any;
+}
+
+export interface SecurityPutRoleMapping extends Generic {
+ name: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+ body: any;
+}
+
+export interface SecurityPutUser extends Generic {
+ username: string;
+ refresh?: 'true' | 'false' | 'wait_for';
+ body: any;
+}
+
+export interface SslCertificates extends Generic {
+}
+
+export interface XpackGraphExplore extends Generic {
+ index?: string | string[];
+ type?: string | string[];
+ routing?: string;
+ timeout?: string;
+ body?: any;
+}
+
+export interface XpackInfo extends Generic {
+ categories?: string | string[];
+}
+
+export interface XpackLicenseDelete extends Generic {
+}
+
+export interface XpackLicenseGet extends Generic {
+ local?: boolean;
+}
+
+export interface XpackLicenseGetBasicStatus extends Generic {
+}
+
+export interface XpackLicenseGetTrialStatus extends Generic {
+}
+
+export interface XpackLicensePost extends Generic {
+ acknowledge?: boolean;
+ body?: any;
+}
+
+export interface XpackLicensePostStartBasic extends Generic {
+ acknowledge?: boolean;
+}
+
+export interface XpackLicensePostStartTrial extends Generic {
+ type?: string;
+ acknowledge?: boolean;
+}
+
+export interface XpackMigrationDeprecations extends Generic {
+ index?: string;
+}
+
+export interface XpackMigrationGetAssistance extends Generic {
+ index?: string | string[];
+ allow_no_indices?: boolean;
+ expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
+ ignore_unavailable?: boolean;
+}
+
+export interface XpackMigrationUpgrade extends Generic {
+ index: string;
+ wait_for_completion?: boolean;
+}
+
+export interface XpackRollupDeleteJob extends Generic {
+ id: string;
+}
+
+export interface XpackRollupGetJobs extends Generic {
+ id?: string;
+}
+
+export interface XpackRollupGetRollupCaps extends Generic {
+ id?: string;
+}
+
+export interface XpackRollupGetRollupIndexCaps extends Generic {
+ index: string;
+}
+
+export interface XpackRollupPutJob extends Generic {
+ id: string;
+ body: any;
+}
+
+export interface XpackRollupRollupSearch extends Generic {
+ index: string;
+ type?: string;
+ typed_keys?: boolean;
+ rest_total_hits_as_int?: boolean;
+ body: any;
+}
+
+export interface XpackRollupStartJob extends Generic {
+ id: string;
+}
+
+export interface XpackRollupStopJob extends Generic {
+ id: string;
+ wait_for_completion?: boolean;
+ timeout?: string;
+}
+
+export interface XpackSqlClearCursor extends Generic {
+ body: any;
+}
+
+export interface XpackSqlQuery extends Generic {
+ format?: string;
+ body: any;
+}
+
+export interface XpackSqlTranslate extends Generic {
+ body: any;
+}
+
+export interface XpackUsage extends Generic {
+ master_timeout?: string;
+}
+
+export interface XpackWatcherAckWatch extends Generic {
+ watch_id: string;
+ action_id?: string | string[];
+}
+
+export interface XpackWatcherActivateWatch extends Generic {
+ watch_id: string;
+}
+
+export interface XpackWatcherDeactivateWatch extends Generic {
+ watch_id: string;
+}
+
+export interface XpackWatcherDeleteWatch extends Generic {
+ id: string;
+}
+
+export interface XpackWatcherExecuteWatch extends Generic {
+ id?: string;
+ debug?: boolean;
+ body?: any;
+}
+
+export interface XpackWatcherGetWatch extends Generic {
+ id: string;
+}
+
+export interface XpackWatcherPutWatch extends Generic {
+ id: string;
+ active?: boolean;
+ version?: number;
+ if_seq_no?: number;
+ if_primary_term?: number;
+ body?: any;
+}
+
+export interface XpackWatcherStart extends Generic {
+}
+
+export interface XpackWatcherStats extends Generic {
+ metric?: '_all' | 'queued_watches' | 'current_watches' | 'pending_watches';
+ emit_stacktraces?: boolean;
+}
+
+export interface XpackWatcherStop extends Generic {
+}
diff --git a/docs/authentication.asciidoc b/docs/authentication.asciidoc
new file mode 100644
index 000000000..8a69cb404
--- /dev/null
+++ b/docs/authentication.asciidoc
@@ -0,0 +1,69 @@
+= Authentication
+
+This document contains code snippets to show you how to connect to various Elasticsearch providers.
+
+== Basic Auth
+
+You can provide your credentials in the node(s) URL.
+
+[source,js]
+----
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({
+ node: 'https://username:password@localhost:9200'
+})
+----
+
+Or you can use the full node declaration.
+
+[source,js]
+----
+const { URL } = require('url')
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({
+ node: {
+ url: new URL('https://username:password@localhost:9200'),
+ id: 'node-1',
+ ...
+ }
+})
+----
+
+== SSL configuration
+
+Without any additional configuration you can specify `https://` node urls, but the certificates used to sign these requests will not verified (`rejectUnauthorized: false`). To turn on certificate verification you must specify an `ssl` object either in the top level config or in each host config object and set `rejectUnauthorized: true`. The ssl config object can contain many of the same configuration options that https://nodejs.org/api/tls.html#tls_tls_connect_options_callback[tls.connect()] accepts.
+
+[source,js]
+----
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({
+ node: 'http://username:password@localhost:9200',
+ ssl: {
+ ca: fs.readFileSync('./cacert.pem'),
+ rejectUnauthorized: true
+ }
+})
+----
+
+== Elastic Cloud
+
+If you are using https://www.elastic.co/cloud[Elastic Cloud], the client offers a easy way to connect to it via the `cloud` option. +
+You must pass the Cloud ID that you can find in the cloud console, then your username and password.
+
+NOTE: When connecting to Elastic Cloud, the client will automatically enable both request and response compression by default, since it yields significant throughput improvements. +
+Moreover, the client will also set the ssl option `secureProtocol` to `TLSv1_2_method` unless specified otherwise.
+You can still override this option by configuring them.
+
+IMPORTANT: Do not enable sniffing when using Elastic Cloud, since the nodes are behind a load balancer, Elastic Cloud will take care of everything for you.
+
+[source,js]
+----
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({
+ cloud: {
+ id: 'name:bG9jYWxob3N0JGFiY2QkZWZnaA==',
+ username: 'elastic',
+ password: 'changeme'
+ }
+})
+----
\ No newline at end of file
diff --git a/docs/breaking-changes.asciidoc b/docs/breaking-changes.asciidoc
new file mode 100644
index 000000000..3170fd922
--- /dev/null
+++ b/docs/breaking-changes.asciidoc
@@ -0,0 +1,286 @@
+= Breaking changes coming from the old client
+
+If you were already using the previous version of this client --i.e. the one you used to install with `npm install elasticsearch`-- you will encounter some breaking changes.
+
+=== Don’t panic!
+
+Every breaking change was carefully weighed, and each is justified. Furthermore, the new codebase has been rewritten with modern JavaScript and has been carefully designed to be easy to maintain.
+
+=== Breaking changes
+
+* Minimum supported version of Node.js is `v6`.
+
+* Everything has been rewritten using ES6 classes to help users extend the defaults more easily.
+
+* There is no longer an integrated logger. The client now is an event emitter that emits the following events: `request`, `response`, and `error`.
+
+* The code is no longer shipped with all the versions of the API, but only that of the package’s major version, This means that if you are using Elasticsearch `v6`, you will be required to install `@elastic/elasticsearch@6`, and so on.
+
+* The internals are completely different, so if you used to tweak them a lot, you will need to refactor your code. The public API should be almost the same.
+
+* No more browser support, for that will be distributed via another module, `@elastic/elasticsearch-browser`. This module is intended for Node.js only.
+
+* The returned value of an API call will no longer be the `body`, `statusCode`, and `headers` for callbacks and just the `body` for promises. The new returned value will be a unique object containing the `body`, `statusCode`, `headers`, `warnings`, and `meta`, for both callback and promises.
+
+[source,js]
+----
+// before
+const body = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+})
+
+client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, (err, body, statusCode, headers) => {
+ if (err) console.log(err)
+})
+
+// after
+const { body, statusCode, headers, warnings } = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+})
+
+client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, (err, { body, statusCode, headers, warnings }) => {
+ if (err) console.log(err)
+})
+----
+
+
+* Errors: there is no longer a custom error class for every HTTP status code (such as `BadRequest` or `NotFound`). There is instead a single `ResponseError`. Each error class has been renamed, and now each is suffixed with `Error` at the end.
+
+* Errors that have been removed: `RequestTypeError`, `Generic`, and all the status code specific errors (such as `BadRequest` or `NotFound`).
+
+* Errors that have been added: `ConfigurationError` (in case of bad configurations) and `ResponseError`, which contains all the data you may need to handle the specific error, such as `statusCode`, `headers`, `body`, and `message`.
+
+
+* Errors that has been renamed:
+
+** `RequestTimeout` (408 statusCode) => `TimeoutError`
+** `ConnectionFault` => `ConnectionError`
+** `NoConnections` => `NoLivingConnectionsError`
+** `Serialization` => `SerializationError`
+** `Serialization` => `DeserializationError`
+
+* You must specify the port number in the configuration. In the previous version you can specify the host and port in a variety of ways, with the new client there is only one via the `node` parameter.
+
+* The `plugins` option has been removed, if you want to extend the client now you should use the `client.extend` API.
+
+[source,js]
+----
+// before
+const { Client } = require('elasticsearch')
+const client = new Client({ plugins: [...] })
+
+// after
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ ... })
+client.extend(...)
+----
+
+* There is a clear distinction between the API related parameters and the client related configurations, the parameters `ignore`, `headers`, `requestTimeout` and `maxRetries` are no longer part of the API object, and you should specify them in a second option object.
+
+[source,js]
+----
+// before
+const body = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' },
+ ignore: [404]
+})
+
+client.search({
+ index: 'my-index',
+ body: { foo: 'bar' },
+ ignore: [404]
+}, (err, body, statusCode, headers) => {
+ if (err) console.log(err)
+})
+
+// after
+const { body, statusCode, headers, warnings } = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, {
+ ignore: [404]
+})
+
+client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, {
+ ignore: [404]
+}, (err, { body, statusCode, headers, warnings }) => {
+ if (err) console.log(err)
+})
+----
+
+* The `transport.request` method will no longer accept the `query` key, but the `querystring` key instead (which can be a string or an object), furthermore, you need to send a bulk-like request, instead of the `body` key, you should use the `bulkBody` key. Also in this method, the client specific parameters should be passed as a second object.
+
+[source,js]
+----
+// before
+const body = await client.transport.request({
+ method: 'GET',
+ path: '/my-index/_search',
+ body: { foo: 'bar' },
+ query: { bar: 'baz' }
+ ignore: [404]
+})
+
+client.transport.request({
+ method: 'GET',
+ path: '/my-index/_search',
+ body: { foo: 'bar' },
+ query: { bar: 'baz' }
+ ignore: [404]
+}, (err, body, statusCode, headers) => {
+ if (err) console.log(err)
+})
+
+// after
+const { body, statusCode, headers, warnings } = await client.transport.request({
+ method: 'GET',
+ path: '/my-index/_search',
+ body: { foo: 'bar' },
+ querystring: { bar: 'baz' }
+}, {
+ ignore: [404]
+})
+
+client.transport.request({
+ method: 'GET',
+ path: '/my-index/_search',
+ body: { foo: 'bar' },
+ querystring: { bar: 'baz' }
+}, {
+ ignore: [404]
+}, (err, { body, statusCode, headers, warnings }) => {
+ if (err) console.log(err)
+})
+----
+
+=== Talk is cheap. Show me the code.
+
+Following you will find a snippet of code with the old client, followed by the same code logic, but with the new client.
+
+[source,js]
+----
+const { Client, errors } = require('elasticsearch')
+const client = new Client({
+ host: 'http://localhost:9200',
+ plugins: [utility]
+})
+
+async function run () {
+ try {
+ const body = await client.search({
+ index: 'game-of-thrones',
+ body: {
+ query: {
+ match: { quote: 'winter' }
+ }
+ }
+ ignore: [404]
+ })
+ console.log(body)
+ } catch (err) {
+ if (err instanceof errors.BadRequest) {
+ console.log('Bad request')
+ } else {
+ console.log(err)
+ }
+ }
+}
+
+function utility (Client, config, components) {
+ const ca = components.clientAction.factory
+ Client.prototype.utility = components.clientAction.namespaceFactory()
+ const utility = Client.prototype.utility.prototype
+
+ utility.index = ca({
+ params: {
+ refresh: {
+ type: 'enum',
+ options: [
+ 'true',
+ 'false',
+ 'wait_for',
+ ''
+ ]
+ },
+ },
+ urls: [
+ {
+ fmt: '/<%=index%>/_doc',
+ req: {
+ index: {
+ type: 'string',
+ required: true
+ }
+ }
+ }
+ ],
+ needBody: true,
+ method: 'POST'
+ })
+})
+----
+
+And now with the new client.
+
+[source,js]
+----
+const { Client, errors } = require('@elastic/elasticsearch')
+// NOTE: `host` has been renamed to `node`,
+// and `plugins` is no longer supported
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ try {
+ // NOTE: we are using the destructuring assignment
+ const { body } = await client.search({
+ index: 'game-of-thrones',
+ body: {
+ query: {
+ match: { quote: 'winter' }
+ }
+ }
+ // NOTE: `ignore` now is in a separated object
+ }, {
+ ignore: [404]
+ })
+ console.log(body)
+ } catch (err) {
+ // NOTE: we are checking the `statusCode` property
+ if (err.statusCode === 400) {
+ console.log('Bad request')
+ } else {
+ console.log(err)
+ }
+ }
+}
+
+// NOTE: we can still extend the client, but with a different API.
+// This new API is a little bit more verbose, since you must write
+// your own validations, but it's way more flexible.
+client.extend('utility.index', ({ makeRequest, ConfigurationError }) => {
+ return function utilityIndex (params, options) {
+ const { body, index, ...querystring } = params
+ if (body == null) throw new ConfigurationError('Missing body')
+ if (index == null) throw new ConfigurationError('Missing index')
+ const requestParams = {
+ method: 'POST',
+ path: `/${index}/_doc`,
+ body: body,
+ querystring
+ }
+ return makeRequest(requestParams, options)
+ }
+})
+----
diff --git a/docs/child.asciidoc b/docs/child.asciidoc
new file mode 100644
index 000000000..74ba23185
--- /dev/null
+++ b/docs/child.asciidoc
@@ -0,0 +1,23 @@
+= Creating a child client
+
+There are some use cases where you may need multiple instances of the client. You can easily do that by calling `new Client()` as many times as you need, but you will lose all the benefits of using one single client, such as the long living connections and the connection pool handling. +
+To avoid this problem the client offers a `child` API, which returns a new client instance that shares the connection pool with the parent client. +
+
+NOTE: The event emitter is shared between the parent and the child(ren), and if you extend the parent client, the child client will have the same extensions, while if the child client adds an extension, the parent client will not be extended.
+
+You can pass to the `child` every client option you would pass to a normal client, but the connection pool specific options (`ssl`, `agent`, `pingTimeout`, `Connection`, and `resurrectStrategy`).
+
+CAUTION: If you call `close` in any of the parent/child clients, every client will be closed.
+
+[source,js]
+----
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+const child = client.child({
+ headers: { 'x-foo': 'bar' },
+ requestTimeout: 1000
+})
+
+client.info(console.log)
+child.info(console.log)
+----
diff --git a/docs/configuration.asciidoc b/docs/configuration.asciidoc
new file mode 100644
index 000000000..5392cec24
--- /dev/null
+++ b/docs/configuration.asciidoc
@@ -0,0 +1,219 @@
+= Client configuration
+
+The client is designed to be easily configured as you see fit for your needs, following you can see all the possible basic options that you can use to configure it.
+
+[source,js]
+----
+const { Client } = require('@elastic/elasticsearch')
+
+const client = new Client({
+ node: 'http://localhost:9200'
+ maxRetries: 5,
+ requestTimeout: 60000,
+ sniffOnStart: true
+})
+----
+
+== Basic options
+[cols=2*]
+|===
+|`node` or `nodes`
+a|The Elasticsearch endpoint to use. +
+It can be a single string or an array of strings:
+[source,js]
+----
+node: 'http://localhost:9200'
+----
+Or it can be an object (or an array of objects) that represents the node
+[source,js]
+----
+node: {
+ url: new URL('http://localhost:9200'),
+ ssl: 'ssl options',
+ agent: 'http agent options',
+ id: 'custom node id',
+ headers: { 'custom': 'headers' }
+ roles: {
+ master: true,
+ data: true,
+ ingest: true,
+ ml: false
+ }
+}
+----
+
+|`maxRetries`
+|`number` - Max number of retries for each request. +
+_Default:_ `3`
+
+|`requestTimeout`
+|`number` - Max request timeout for each request. +
+_Default:_ `30000`
+
+|`pingTimeout`
+|`number` - Max ping request timeout for each request. +
+_Default:_ `3000`
+
+|`sniffInterval`
+|`number, boolean` - Perform a sniff operation every `n` milliseconds. +
+_Default:_ `false`
+
+|`sniffOnStart`
+|`boolean` - Perform a sniff once the client is started. +
+_Default:_ `false`
+
+|`sniffEndpoint`
+|`string` - Max request timeout for each request. +
+_Default:_ `'_nodes/_all/http'`
+
+|`sniffOnConnectionFault`
+|`boolean` - Perform a sniff on connection fault. +
+_Default:_ `false`
+
+|`resurrectStrategy`
+|`string` - Configure the node resurrection strategy. +
+_Options:_ `'ping'`, `'optimistic'`, `'none'` +
+_Default:_ `'ping'`
+
+|`suggestCompression`
+|`boolean` - Adds `accept-encoding` header to every request. +
+_Default:_ `false`
+
+|`compression`
+|`string, boolean` - Enables gzip request body compression. +
+_Options:_ `'gzip'`, `false` +
+_Default:_ `false`
+
+|`ssl`
+|`http.SecureContextOptions` - ssl https://nodejs.org/api/tls.html[configuraton]. +
+_Default:_ `null`
+
+|`agent`
+|`http.AgentOptions` - http agent https://nodejs.org/api/http.html#http_new_agent_options[options]. +
+_Default:_ `null`
+
+|`nodeFilter`
+a|`function` - Filters which node not to use for a request. +
+_Default:_
+[source,js]
+----
+function defaultNodeFilter (node) {
+ // avoid master only nodes
+ if (node.roles.master === true &&
+ node.roles.data === false &&
+ node.roles.ingest === false) {
+ return false
+ }
+ return true
+}
+----
+
+|`nodeSelector`
+a|`function` - custom selection strategy. +
+_Options:_ `'round-robin'`, `'random'`, custom function +
+_Default:_ `'round-robin'` +
+_Custom function example:_
+[source,js]
+----
+function nodeSelector (connections) {
+ const index = calculateIndex()
+ return connections[index]
+}
+----
+|===
+
+== Advanced configuration
+If you need to customize the client behavior heavily, you are in the right place! +
+The client allows you to customize the following internals:
+
+* `Transport` class
+* `ConnectionPool` class
+* `Connection` class
+* `Serializer` class
+
+=== `Transport`
+This class is responsible to perform the request to Elasticsearch and handling errors, it also handle the sniffing.
+[source,js]
+----
+const { Client, Transport } = require('@elastic/elasticsearch')
+
+class MyTransport extends Transport {
+ request (params, options, callback) {
+ // your code
+ }
+}
+
+const client = new Client({
+ Transport: MyTransport
+})
+----
+
+Sometimes you just need to inject a little snippet of your code and then continue to use the usual client code, in such case, you should call `super.method`.
+[source,js]
+----
+class MyTransport extends Transport {
+ request (params, options, callback) {
+ // your code
+ super.request(params, options, callback)
+ }
+}
+----
+
+=== `ConnectionPool`
+This class is responsible for keeping in memory all the Elasticsearch Connection that we are using, there is a single Connection for every node. +
+Moreover, the connection pool will handle the resurrection strategies and the updates of the pool.
+[source,js]
+----
+const { Client, ConnectionPool } = require('@elastic/elasticsearch')
+
+class MyConnectionPool extends ConnectionPool {
+ markAlive (connection) {
+ // your code
+ super.markAlive(connection)
+ }
+}
+
+const client = new Client({
+ ConnectionPool: MyConnectionPool
+})
+----
+
+=== `Connection`
+This class represents a single Node, it holds every information we have on the node, such as roles, id, URL, custom headers and so on. The actual HTTP request is performed here, this means that if you want to swap the default HTTP client (Node.js core), you should override this class `request` method.
+[source,js]
+----
+const { Client, Connection } = require('@elastic/elasticsearch')
+
+class MyConnection extends Connection {
+ request (params, callback) {
+ // your code
+ }
+}
+
+const client = new Client({
+ Connection: MyConnection
+})
+----
+
+=== `Serializer`
+This class is responsible of the serialization of every request, it offers the following methods:
+
+* `serialize(object: any): string;`, serializes request objects
+* `deserialize(json: string): any;`, deserializes response strings
+* `ndserialize(array: any[]): string;`, serializes bulk request objects
+* `qserialize(object: any): string;`, serializes request query parameters
+
+[source,js]
+----
+const { Client, Serializer } = require('@elastic/elasticsearch')
+
+class MySerializer extends Serializer {
+ serialize (object) {
+ // your code
+ }
+}
+
+const client = new Client({
+ Serializer: MySerializer
+})
+----
\ No newline at end of file
diff --git a/docs/examples/asStream.asciidoc b/docs/examples/asStream.asciidoc
new file mode 100644
index 000000000..00929bab0
--- /dev/null
+++ b/docs/examples/asStream.asciidoc
@@ -0,0 +1,96 @@
+== asStream
+
+Instead of getting the parsed body back, you will get the raw Node.js stream of data.
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ await client.bulk({
+ refresh: true,
+ body: [
+ // operation to perform
+ { index: { _index: 'game-of-thrones' } },
+ // the document to index
+ {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ ]
+ })
+
+ // Let's search!
+ const { body } = await client.search({
+ index: 'game-of-thrones',
+ body: {
+ query: {
+ match: {
+ quote: 'winter'
+ }
+ }
+ }
+ }, {
+ asStream: true
+ })
+
+ // stream async iteration, available in Node.js ≥ 10
+ var payload = ''
+ body.setEncoding('utf8')
+ for await (const chunk of body) {
+ payload += chunk
+ }
+ console.log(JSON.parse(payload))
+
+ // classic stream callback style
+ var payload = ''
+ body.setEncoding('utf8')
+ body.on('data', chunk => { payload += chunk })
+ body.on('error', console.log)
+ body.on('end', () => {
+ console.log(JSON.parse(payload))
+ })
+}
+
+run().catch(console.log)
+----
+
+TIP: This can be useful if you need to pipe the Elasticsearch's response to a proxy, or send it directly to another source.
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+const fastify = require('fastify')()
+
+fastify.post('/search/:index', async (req, reply) => {
+ const { body, statusCode, headers } = await client.search({
+ index: req.params.index,
+ body: req.body
+ }, {
+ asStream: true
+ })
+
+ reply.code(statusCode).headers(headers)
+ return body
+})
+
+fastify.listen(3000)
+----
\ No newline at end of file
diff --git a/docs/examples/bulk.asciidoc b/docs/examples/bulk.asciidoc
new file mode 100644
index 000000000..93c5397c1
--- /dev/null
+++ b/docs/examples/bulk.asciidoc
@@ -0,0 +1,58 @@
+= Bulk
+
+The `bulk` API makes it possible to perform many index/delete operations in a single API call. +
+This can greatly increase the indexing speed.
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ await client.bulk({
+ // here we are forcing an index refresh,
+ // otherwise we will not get any result
+ // in the consequent search
+ refresh: true,
+ body: [
+ // operation to perform
+ { index: { _index: 'game-of-thrones' } },
+ // the document to index
+ {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ ]
+ })
+
+ // Let's search!
+ const { body } = await client.search({
+ index: 'game-of-thrones',
+ body: {
+ query: {
+ match: {
+ quote: 'winter'
+ }
+ }
+ }
+ })
+
+ console.log(body.hits.hits)
+}
+
+run().catch(console.log)
+----
\ No newline at end of file
diff --git a/docs/examples/exists.asciidoc b/docs/examples/exists.asciidoc
new file mode 100644
index 000000000..4c64287a3
--- /dev/null
+++ b/docs/examples/exists.asciidoc
@@ -0,0 +1,33 @@
+= Exists
+
+Check that the document `/game-of-thrones/1` exists.
+
+NOTE: Since this API uses the `HEAD` method, the body value will be boolean.
+
+[source,js]
+---------
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ await client.index({
+ index: 'game-of-thrones',
+ id: '1',
+ body: {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ }
+ })
+
+ const { body } = await client.exists({
+ index: 'game-of-thrones',
+ id: 1
+ })
+
+ console.log(body) // true
+}
+
+run().catch(console.log)
+---------
\ No newline at end of file
diff --git a/docs/examples/get.asciidoc b/docs/examples/get.asciidoc
new file mode 100644
index 000000000..b978bc8ce
--- /dev/null
+++ b/docs/examples/get.asciidoc
@@ -0,0 +1,32 @@
+= Get
+
+The get API allows to get a typed JSON document from the index based on its id. +
+The following example gets a JSON document from an index called `game-of-thrones`, under a type called `_doc`, with id valued `'1'`.
+
+[source,js]
+---------
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ await client.index({
+ index: 'game-of-thrones',
+ id: '1',
+ body: {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ }
+ })
+
+ const { body } = await client.get({
+ index: 'game-of-thrones',
+ id: '1'
+ })
+
+ console.log(body)
+}
+
+run().catch(console.log)
+---------
\ No newline at end of file
diff --git a/docs/examples/ignore.asciidoc b/docs/examples/ignore.asciidoc
new file mode 100644
index 000000000..d4b5a9af1
--- /dev/null
+++ b/docs/examples/ignore.asciidoc
@@ -0,0 +1,55 @@
+== Ignore
+HTTP status codes which should not be considered errors for this request.
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ await client.bulk({
+ refresh: true,
+ body: [
+ // operation to perform
+ { index: { _index: 'game-of-thrones' } },
+ // the document to index
+ {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ ]
+ })
+
+ // Let's search!
+ const { body } = await client.search({
+ index: 'game-of-thrones',
+ body: {
+ query: {
+ match: {
+ quote: 'fire'
+ }
+ }
+ }
+ }, {
+ ignore: [404]
+ })
+
+ console.log(body) // ResponseError
+}
+
+run().catch(console.log)
+----
\ No newline at end of file
diff --git a/docs/examples/msearch.asciidoc b/docs/examples/msearch.asciidoc
new file mode 100644
index 000000000..5915dc77d
--- /dev/null
+++ b/docs/examples/msearch.asciidoc
@@ -0,0 +1,50 @@
+= MSearch
+
+The multi search API allows to execute several search requests within the same API.
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ await client.bulk({
+ refresh: true,
+ body: [
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ ]
+ })
+
+ const { body } = await client.msearch({
+ body: [
+ { index: 'game-of-thrones' },
+ { query: { match: { character: 'Daenerys' } } },
+
+ { index: 'game-of-thrones' },
+ { query: { match: { character: 'Tyrion' } } }
+ ]
+ })
+
+ console.log(body.responses)
+}
+
+run().catch(console.log)
+----
\ No newline at end of file
diff --git a/docs/examples/scroll.asciidoc b/docs/examples/scroll.asciidoc
new file mode 100644
index 000000000..90ade2fb6
--- /dev/null
+++ b/docs/examples/scroll.asciidoc
@@ -0,0 +1,174 @@
+= Scroll
+
+While a search request returns a single “page” of results, the scroll API can be used to retrieve large numbers of results (or even all results) from a single search request, in much the same way as you would use a cursor on a traditional database.
+
+Scrolling is not intended for real time user requests, but rather for processing large amounts of data, e.g. in order to reindex the contents of one index into a new index with a different configuration.
+
+NOTE: The results that are returned from a scroll request reflect the state of the index at the time that the initial search request was made, like a snapshot in time. Subsequent changes to documents (index, update or delete) will only affect later search requests.
+
+In order to use scrolling, the initial search request should specify the scroll parameter in the query string, which tells Elasticsearch how long it should keep the “search context” alive.
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ const allQuotes = []
+ const responseQueue = []
+
+ // Let's index some data!
+ await client.bulk({
+ // here we are forcing an index refresh,
+ // otherwise we will not get any result
+ // in the consequent search
+ refresh: true,
+ body: [
+ // operation to perform
+ { index: { _index: 'game-of-thrones' } },
+ // the document to index
+ {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ ]
+ })
+
+ // start things off by searching, setting a scroll timeout, and pushing
+ // our first response into the queue to be processed
+ const response = await client.search({
+ index: 'game-of-thrones',
+ // keep the search results "scrollable" for 30 seconds
+ scroll: '30s',
+ // for the sake of this example, we will get only one result per search
+ size: 1,
+ // filter the source to only include the quote field
+ _source: ['quote'],
+ body: {
+ query: {
+ match_all: {}
+ }
+ }
+ })
+
+ responseQueue.push(response)
+
+ while (responseQueue.length) {
+ const { body } = responseQueue.shift()
+
+ // collect the titles from this response
+ body.hits.hits.forEach(function (hit) {
+ allQuotes.push(hit._source.quote)
+ })
+
+ // check to see if we have collected all of the quotes
+ if (body.hits.total.value === allQuotes.length) {
+ console.log('Every quote', allQuotes)
+ break
+ }
+
+ // get the next response if there are more quotes to fetch
+ responseQueue.push(
+ await client.scroll({
+ scrollId: body._scroll_id,
+ scroll: '30s'
+ })
+ )
+ }
+}
+
+run().catch(console.log)
+----
+
+Another cool usage of the `scroll` API can be done with Node.js ≥ 10, by using async iteration!
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+// Scroll utility
+async function * scrollSearch (params) {
+ var response = await client.search(params)
+
+ while (true) {
+ const sourceHits = response.body.hits.hits
+
+ if (sourceHits.length === 0) {
+ break
+ }
+
+ for (const hit of sourceHits) {
+ yield hit
+ }
+
+ if (!response.body._scroll_id) {
+ break
+ }
+
+ response = await client.scroll({
+ scrollId: response.body._scroll_id,
+ scroll: params.scroll
+ })
+ }
+}
+
+async function run () {
+ await client.bulk({
+ refresh: true,
+ body: [
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ ]
+ })
+
+ const params = {
+ index: 'game-of-thrones',
+ scroll: '30s',
+ size: 1,
+ _source: ['quote'],
+ body: {
+ query: {
+ match_all: {}
+ }
+ }
+ }
+
+ for await (const hit of scrollSearch(params)) {
+ console.log(hit._source)
+ }
+}
+
+run().catch(console.log)
+----
\ No newline at end of file
diff --git a/docs/examples/search.asciidoc b/docs/examples/search.asciidoc
new file mode 100644
index 000000000..794efc1e5
--- /dev/null
+++ b/docs/examples/search.asciidoc
@@ -0,0 +1,59 @@
+= Search
+
+The `search` API allows you to execute a search query and get back search hits that match the query. +
+The query can either be provided using a simple https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-uri-request.html[query string as a parameter], or using a https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-body.html[request body].
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ // Let's start by indexing some data
+ await client.index({
+ index: 'game-of-thrones',
+ body: {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ }
+ })
+
+ await client.index({
+ index: 'game-of-thrones',
+ body: {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ }
+ })
+
+ await client.index({
+ index: 'game-of-thrones',
+ // here we are forcing an index refresh,
+ // otherwise we will not get any result
+ // in the consequent search
+ refresh: true,
+ body: {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ })
+
+ // Let's search!
+ const { body } = await client.search({
+ index: 'game-of-thrones',
+ body: {
+ query: {
+ match: {
+ quote: 'winter'
+ }
+ }
+ }
+ })
+
+ console.log(body.hits.hits)
+}
+
+run().catch(console.log)
+----
\ No newline at end of file
diff --git a/docs/examples/suggest.asciidoc b/docs/examples/suggest.asciidoc
new file mode 100644
index 000000000..d691d8344
--- /dev/null
+++ b/docs/examples/suggest.asciidoc
@@ -0,0 +1,59 @@
+= Suggest
+
+The suggest feature suggests similar looking terms based on a provided text by using a suggester. _Parts of the suggest feature are still under development._
+
+The suggest request part is defined alongside the query part in a `search` request. +
+If the query part is left out, only suggestions are returned.
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ await client.bulk({
+ refresh: true,
+ body: [
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ ]
+ })
+
+ const { body } = await client.search({
+ index: 'game-of-thrones',
+ body: {
+ query: {
+ match: { quote: 'witner' }
+ },
+ suggest: {
+ gotsuggest: {
+ text: 'witner',
+ term: { field: 'quote' }
+ }
+ }
+ }
+ })
+
+ console.log(body)
+}
+
+run().catch(console.log)
+
+----
\ No newline at end of file
diff --git a/docs/examples/transport.request.asciidoc b/docs/examples/transport.request.asciidoc
new file mode 100644
index 000000000..f89514b50
--- /dev/null
+++ b/docs/examples/transport.request.asciidoc
@@ -0,0 +1,58 @@
+= transport.request
+
+It can happen that you need to communicate with Elasticsearch by using an API that is not supported by the client, to mitigate this issue you can directly call `client.transport.request`, which is the internal utility that the client uses to communicate with Elasticsearch when you use an API method.
+
+NOTE: When using the `transport.request` method you must provide all the parameters needed to perform an HTTP call, such as `method`, `path`, `querystring`, and `body`.
+
+
+TIP: If you find yourself use this method too often, take in consideration the use of `client.extend`, which will make your code look cleaner and easier to maintain.
+
+[source,js]
+----
+'use strict'
+
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run () {
+ await client.bulk({
+ refresh: true,
+ body: [
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ },
+
+ { index: { _index: 'game-of-thrones' } },
+ {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ ]
+ })
+
+ const { body } = await client.transport.request({
+ method: 'POST',
+ path: '/game-of-thrones/_search',
+ body: {
+ query: {
+ match: {
+ quote: 'winter'
+ }
+ }
+ },
+ querystring: {}
+ })
+
+ console.log(body)
+}
+
+run().catch(console.log)
+----
\ No newline at end of file
diff --git a/docs/examples/typescript.asciidoc b/docs/examples/typescript.asciidoc
new file mode 100644
index 000000000..b3df28b74
--- /dev/null
+++ b/docs/examples/typescript.asciidoc
@@ -0,0 +1,69 @@
+= Typescript
+
+The client offers a first-class support for TypeScript, since it ships the type definitions for every exposed API.
+
+NOTE: If you are using TypeScript you will be required to use _snake_case_ style to define the API parameters instead of _camelCase_.
+
+[source,ts]
+----
+'use strict'
+
+import { Client, ApiResponse, RequestParams } from '@elastic/elasticsearch'
+const client = new Client({ node: 'http://localhost:9200' })
+
+async function run (): void {
+ // Let's start by indexing some data
+ const doc1: RequestParams.Index = {
+ index: 'game-of-thrones',
+ body: {
+ character: 'Ned Stark',
+ quote: 'Winter is coming.'
+ }
+ }
+ await client.index(doc1)
+
+ const doc2: RequestParams.Index = {
+ index: 'game-of-thrones',
+ body: {
+ character: 'Daenerys Targaryen',
+ quote: 'I am the blood of the dragon.'
+ }
+ }
+ await client.index(doc2)
+
+ const doc3: RequestParams.Index = {
+ index: 'game-of-thrones',
+ // here we are forcing an index refresh,
+ // otherwise we will not get any result
+ // in the consequent search
+ refresh: true,
+ body: {
+ character: 'Tyrion Lannister',
+ quote: 'A mind needs books like a sword needs a whetstone.'
+ }
+ }
+ await client.index(doc3)
+
+ // Let's search!
+ const params: RequestParams.Search = {
+ index: 'game-of-thrones',
+ body: {
+ query: {
+ match: {
+ quote: 'winter'
+ }
+ }
+ }
+ }
+ client
+ .search(params)
+ .then((result: ApiResponse) => {
+ console.og(result.body.hits.hits)
+ })
+ .catch((err: Error) => {
+ console.log(err)
+ })
+}
+
+run()
+----
\ No newline at end of file
diff --git a/docs/extend.asciidoc b/docs/extend.asciidoc
new file mode 100644
index 000000000..c80c8bd3f
--- /dev/null
+++ b/docs/extend.asciidoc
@@ -0,0 +1,69 @@
+= Extend the client
+
+Sometimes you need to reuse the same logic, or you want to build a custom API to allow you simplify your code. +
+The easiest way to achieve that is by extending the client.
+
+NOTE: If you want to override existing methods, you should specify the `{ force: true }` option.
+
+[source,js]
+----
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+client.extend('supersearch', ({ makeRequest, ConfigurationError }) => {
+ return function supersearch (params, options) {
+ const {
+ body,
+ index,
+ method,
+ ...querystring
+ } = params
+
+ // params validation
+ if (body == null) {
+ throw new ConfigurationError('Missing required parameter: body')
+ }
+
+ // build request object
+ const request = {
+ method: method || 'POST',
+ path: `/${encodeURIComponent(index)}/_search_`,
+ body,
+ querystring
+ }
+
+ // build request options object
+ const requestOptions = {
+ ignore: options.ignore || null,
+ requestTimeout: options.requestTimeout || null,
+ maxRetries: options.maxRetries || null,
+ asStream: options.asStream || false,
+ headers: options.headers || null
+ }
+
+ return makeRequest(request, requestOptions)
+ }
+})
+
+client.extend('utility.index', ({ makeRequest }) => {
+ return function _index (params, options) {
+ // your code
+ }
+})
+
+client.extend('utility.delete', ({ makeRequest }) => {
+ return function _delete (params, options) {
+ // your code
+ }
+})
+
+client.extend('indices.delete', { force: true }, ({ makeRequest }) => {
+ return function _delete (params, options) {
+ // your code
+ }
+})
+
+client.supersearch(...)
+client.utility.index(...)
+client.utility.delete(...)
+----
\ No newline at end of file
diff --git a/docs/index.asciidoc b/docs/index.asciidoc
new file mode 100644
index 000000000..2c4d7fb87
--- /dev/null
+++ b/docs/index.asciidoc
@@ -0,0 +1,51 @@
+= @elastic/elasticsearch
+
+The official Node.js client for Elasticsearch.
+
+== Features
+* One-to-one mapping with REST API.
+* Generalized, pluggable architecture.
+* Configurable, automatic discovery of cluster nodes.
+* Persistent, Keep-Alive connections.
+* Load balancing (with pluggable selection strategy) across all available nodes.
+* TypeScript support out of the box.
+
+== Install
+[source,sh]
+----
+npm install @elastic/elasticsearch
+----
+By default the latest version of the module will be installed, which is the same version of the current release of Elasticsearch. +
+If you need to work with older versions of Elasticsearch, you should install the same version of the client as well. +
+For example, if you are using Elasticsearch `v6.5.4`, you will need the client `v6`, and you can easily do that with `npm install @elastic/elasticsearch@6`.
+
+== Usage
+[source,js]
+----
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+// promise API
+const result = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+})
+
+// callback API
+client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, (err, result) => {
+ if (err) console.log(err)
+})
+----
+
+== Reference
+* Client configuration
+* Client usage
+* API methods
+* TypeScript support
+* Extend the client
+* Breaking changes from old client
+* Authentication
+* Child client
diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc
new file mode 100644
index 000000000..856b5885e
--- /dev/null
+++ b/docs/reference.asciidoc
@@ -0,0 +1,6107 @@
+= API Reference
+
+=== Common parameters
+Parameters that are accepted by all API endpoints.
+https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html
+[cols=2*]
+|===
+|`pretty`
+|`boolean` - Pretty format the returned JSON response.
+
+|`human`
+|`boolean` - Return human readable values for statistics. +
+ _Default:_ `true`
+
+|`error_trace` or `errorTrace`
+|`boolean` - Include the stack trace of returned errors.
+
+|`source`
+|`string` - The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
+
+|`filter_path` or `filterPath`
+|`list` - A comma-separated list of filters used to reduce the response.
+
+|===
+=== bulk
+[source,js]
+----
+client.bulk([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html
+[cols=2*]
+|===
+|`index`
+|`string` - Default index for items which don't provide one
+
+|`type`
+|`string` - Default document type for items which don't provide one
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of shard copies that must be active before proceeding with the bulk 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)
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - 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.
+
+|`routing`
+|`string` - Specific routing value
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`type`
+|`string` - Default document type for items which don't provide one
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - Default list of fields to extract and return from the _source field, can be overridden on each sub-request
+
+|`pipeline`
+|`string` - The pipeline id to preprocess incoming documents with
+
+|`body`
+|`object` - The operation definition and data (action-data pairs), separated by newlines
+
+|===
+=== cat.aliases
+[source,js]
+----
+client.cat.aliases([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html
+[cols=2*]
+|===
+|`name`
+|`string, string[]` - A comma-separated list of alias names to return
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.allocation
+[source,js]
+----
+client.cat.allocation([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html
+[cols=2*]
+|===
+|`node_id` or `nodeId`
+|`string, string[]` - A comma-separated list of node IDs or names to limit the returned information
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`bytes`
+|`'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'` - The unit in which to display byte values
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.count
+[source,js]
+----
+client.cat.count([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to limit the returned information
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.fielddata
+[source,js]
+----
+client.cat.fielddata([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html
+[cols=2*]
+|===
+|`fields`
+|`string, string[]` - A comma-separated list of fields to return the fielddata size
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`bytes`
+|`'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'` - The unit in which to display byte values
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|`fields`
+|`string, string[]` - A comma-separated list of fields to return in the output
+
+|===
+=== cat.health
+[source,js]
+----
+client.cat.health([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html
+[cols=2*]
+|===
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`ts`
+|`boolean` - Set to false to disable timestamping +
+ _Default:_ `true`
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.help
+[source,js]
+----
+client.cat.help([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html
+[cols=2*]
+|===
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|===
+=== cat.indices
+[source,js]
+----
+client.cat.indices([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to limit the returned information
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`bytes`
+|`'b', 'k', 'm', 'g'` - The unit in which to display byte values
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`health`
+|`'green', 'yellow', 'red'` - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status
+
+|`help`
+|`boolean` - Return help information
+
+|`pri`
+|`boolean` - Set to true to return stats only for primary shards
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.master
+[source,js]
+----
+client.cat.master([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html
+[cols=2*]
+|===
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.nodeattrs
+[source,js]
+----
+client.cat.nodeattrs([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html
+[cols=2*]
+|===
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.nodes
+[source,js]
+----
+client.cat.nodes([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html
+[cols=2*]
+|===
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`full_id` or `fullId`
+|`boolean` - Return the full node ID instead of the shortened version (default: false)
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.pendingTasks
+[source,js]
+----
+client.cat.pendingTasks([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html
+[cols=2*]
+|===
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.plugins
+[source,js]
+----
+client.cat.plugins([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html
+[cols=2*]
+|===
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.recovery
+[source,js]
+----
+client.cat.recovery([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to limit the returned information
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`bytes`
+|`'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'` - The unit in which to display byte values
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.repositories
+[source,js]
+----
+client.cat.repositories([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html
+[cols=2*]
+|===
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.segments
+[source,js]
+----
+client.cat.segments([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to limit the returned information
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`bytes`
+|`'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'` - The unit in which to display byte values
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.shards
+[source,js]
+----
+client.cat.shards([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to limit the returned information
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`bytes`
+|`'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'` - The unit in which to display byte values
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.snapshots
+[source,js]
+----
+client.cat.snapshots([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string, string[]` - Name of repository from which to fetch the snapshot information
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Set to true to ignore unavailable snapshots
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.tasks
+[source,js]
+----
+client.cat.tasks([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
+[cols=2*]
+|===
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`node_id` or `nodeId`
+|`string, string[]` - 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
+
+|`actions`
+|`string, string[]` - A comma-separated list of actions that should be returned. Leave empty to return all.
+
+|`detailed`
+|`boolean` - Return detailed task information (default: false)
+
+|`parent_task` or `parentTask`
+|`number` - Return tasks with specified parent task id. Set to -1 to return all.
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.templates
+[source,js]
+----
+client.cat.templates([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html
+[cols=2*]
+|===
+|`name`
+|`string` - A pattern that returned template names must match
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== cat.threadPool
+[source,js]
+----
+client.cat.threadPool([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html
+[cols=2*]
+|===
+|`thread_pool_patterns` or `threadPoolPatterns`
+|`string, string[]` - A comma-separated list of regular-expressions to filter the thread pools in the output
+
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`size`
+|`'', 'k', 'm', 'g', 't', 'p'` - The multiplier in which to display values
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`h`
+|`string, string[]` - Comma-separated list of column names to display
+
+|`help`
+|`boolean` - Return help information
+
+|`s`
+|`string, string[]` - Comma-separated list of column names or column aliases to sort by
+
+|`v`
+|`boolean` - Verbose mode. Display column headers
+
+|===
+=== clearScroll
+[source,js]
+----
+client.clearScroll([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html
+[cols=2*]
+|===
+|`scroll_id` or `scrollId`
+|`string, string[]` - A comma-separated list of scroll IDs to clear
+
+|`body`
+|`object` - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
+
+|===
+=== cluster.allocationExplain
+[source,js]
+----
+client.cluster.allocationExplain([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html
+[cols=2*]
+|===
+|`include_yes_decisions` or `includeYesDecisions`
+|`boolean` - Return 'YES' decisions in explanation (default: false)
+
+|`include_disk_info` or `includeDiskInfo`
+|`boolean` - Return information about disk usage and shard sizes (default: false)
+
+|`body`
+|`object` - The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'
+
+|===
+=== cluster.getSettings
+[source,js]
+----
+client.cluster.getSettings([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html
+[cols=2*]
+|===
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`include_defaults` or `includeDefaults`
+|`boolean` - Whether to return all default clusters setting.
+
+|===
+=== cluster.health
+[source,js]
+----
+client.cluster.health([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - Limit the information returned to a specific index
+
+|`level`
+|`'cluster', 'indices', 'shards'` - Specify the level of detail for returned information +
+ _Default:_ `cluster`
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Wait until the specified number of shards is active
+
+|`wait_for_nodes` or `waitForNodes`
+|`string` - Wait until the specified number of nodes is available
+
+|`wait_for_events` or `waitForEvents`
+|`'immediate', 'urgent', 'high', 'normal', 'low', 'languid'` - Wait until all currently queued events with the given priority are processed
+
+|`wait_for_no_relocating_shards` or `waitForNoRelocatingShards`
+|`boolean` - Whether to wait until there are no relocating shards in the cluster
+
+|`wait_for_no_initializing_shards` or `waitForNoInitializingShards`
+|`boolean` - Whether to wait until there are no initializing shards in the cluster
+
+|`wait_for_status` or `waitForStatus`
+|`'green', 'yellow', 'red'` - Wait until cluster is in a specific state
+
+|===
+=== cluster.pendingTasks
+[source,js]
+----
+client.cluster.pendingTasks([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html
+[cols=2*]
+|===
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|===
+=== cluster.putSettings
+[source,js]
+----
+client.cluster.putSettings([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html
+[cols=2*]
+|===
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`body`
+|`object` - The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).
+
+|===
+=== cluster.remoteInfo
+[source,js]
+----
+client.cluster.remoteInfo([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html
+[cols=2*]
+|===
+|===
+=== cluster.reroute
+[source,js]
+----
+client.cluster.reroute([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html
+[cols=2*]
+|===
+|`dry_run` or `dryRun`
+|`boolean` - Simulate the operation only and return the resulting state
+
+|`explain`
+|`boolean` - Return an explanation of why the commands can or cannot be executed
+
+|`retry_failed` or `retryFailed`
+|`boolean` - Retries allocation of shards that are blocked due to too many subsequent allocation failures
+
+|`metric`
+|`string, string[]` - Limit the information returned to the specified metrics. Defaults to all but metadata
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`body`
+|`object` - The definition of `commands` to perform (`move`, `cancel`, `allocate`)
+
+|===
+=== cluster.state
+[source,js]
+----
+client.cluster.state([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`metric`
+|`string, string[]` - Limit the information returned to the specified metrics
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`wait_for_metadata_version` or `waitForMetadataVersion`
+|`number` - Wait for the metadata version to be equal or greater than the specified metadata version
+
+|`wait_for_timeout` or `waitForTimeout`
+|`string` - The maximum time to wait for wait_for_metadata_version before timing out
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|===
+=== cluster.stats
+[source,js]
+----
+client.cluster.stats([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html
+[cols=2*]
+|===
+|`node_id` or `nodeId`
+|`string, string[]` - 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
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== count
+[source,js]
+----
+client.count([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of indices to restrict the results
+
+|`type`
+|`string, string[]` - A comma-separated list of types to restrict the results
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`ignore_throttled` or `ignoreThrottled`
+|`boolean` - Whether specified concrete, expanded or aliased indices should be ignored when throttled
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`min_score` or `minScore`
+|`number` - Include only documents with a specific `_score` value in the result
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`routing`
+|`string, string[]` - A comma-separated list of specific routing values
+
+|`q`
+|`string` - Query in the Lucene query string syntax
+
+|`analyzer`
+|`string` - The analyzer to use for the query string
+
+|`analyze_wildcard` or `analyzeWildcard`
+|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)
+
+|`default_operator` or `defaultOperator`
+|`'AND', 'OR'` - The default operator for query string query (AND or OR) +
+ _Default:_ `OR`
+
+|`df`
+|`string` - The field to use as default where no field prefix is given in the query string
+
+|`lenient`
+|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+
+|`terminate_after` or `terminateAfter`
+|`number` - The maximum count for each shard, upon reaching which the query execution will terminate early
+
+|`body`
+|`object` - A query to restrict the results specified with the Query DSL (optional)
+
+|===
+=== create
+[source,js]
+----
+client.create([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html
+[cols=2*]
+|===
+|`id`
+|`string` - Document ID
+
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of shard copies that must be active before proceeding with the index 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)
+
+|`parent`
+|`string` - ID of the parent document
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - 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.
+
+|`routing`
+|`string` - Specific routing value
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`version_type` or `versionType`
+|`'internal', 'external', 'external_gte', 'force'` - Specific version type
+
+|`pipeline`
+|`string` - The pipeline id to preprocess incoming documents with
+
+|`body`
+|`object` - The document
+
+|===
+=== delete
+[source,js]
+----
+client.delete([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html
+[cols=2*]
+|===
+|`id`
+|`string` - The document ID
+
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of shard copies that must be active before proceeding with the delete 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)
+
+|`parent`
+|`string` - ID of parent document
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - 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.
+
+|`routing`
+|`string` - Specific routing value
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`if_seq_no` or `ifSeqNo`
+|`number` - only perform the delete operation if the last operation that has changed the document has the specified sequence number
+
+|`if_primary_term` or `ifPrimaryTerm`
+|`number` - only perform the delete operation if the last operation that has changed the document has the specified primary term
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`version_type` or `versionType`
+|`'internal', 'external', 'external_gte', 'force'` - Specific version type
+
+|===
+=== deleteByQuery
+[source,js]
+----
+client.deleteByQuery([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
+
+|`type`
+|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types
+
+|`analyzer`
+|`string` - The analyzer to use for the query string
+
+|`analyze_wildcard` or `analyzeWildcard`
+|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)
+
+|`default_operator` or `defaultOperator`
+|`'AND', 'OR'` - The default operator for query string query (AND or OR) +
+ _Default:_ `OR`
+
+|`df`
+|`string` - The field to use as default where no field prefix is given in the query string
+
+|`from`
+|`number` - Starting offset (default: 0)
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`conflicts`
+|`'abort', 'proceed'` - What to do when the delete by query hits version conflicts? +
+ _Default:_ `abort`
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`lenient`
+|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`q`
+|`string` - Query in the Lucene query string syntax
+
+|`routing`
+|`string, string[]` - A comma-separated list of specific routing values
+
+|`scroll`
+|`string` - Specify how long a consistent view of the index should be maintained for scrolled search
+
+|`search_type` or `searchType`
+|`'query_then_fetch', 'dfs_query_then_fetch'` - Search operation type
+
+|`search_timeout` or `searchTimeout`
+|`string` - Explicit timeout for each search request. Defaults to no timeout.
+
+|`size`
+|`number` - Number of hits to return (default: 10)
+
+|`sort`
+|`string, string[]` - A comma-separated list of : pairs
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`terminate_after` or `terminateAfter`
+|`number` - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
+
+|`stats`
+|`string, string[]` - Specific 'tag' of the request for logging and statistical purposes
+
+|`version`
+|`boolean` - Specify whether to return document version as part of a hit
+
+|`request_cache` or `requestCache`
+|`boolean` - Specify if request cache should be used for this request or not, defaults to index level setting
+
+|`refresh`
+|`boolean` - Should the effected indexes be refreshed?
+
+|`timeout`
+|`string` - Time each individual bulk request should wait for shards that are unavailable. +
+ _Default:_ `1m`
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - 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)
+
+|`scroll_size` or `scrollSize`
+|`number` - Size on the scroll request powering the delete by query
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Should the request should block until the delete by query is complete. +
+ _Default:_ `true`
+
+|`requests_per_second` or `requestsPerSecond`
+|`number` - The throttle for this request in sub-requests per second. -1 means no throttle.
+
+|`slices`
+|`number` - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. +
+ _Default:_ `1`
+
+|`body`
+|`object` - The search definition using the Query DSL
+
+|===
+=== deleteByQueryRethrottle
+[source,js]
+----
+client.deleteByQueryRethrottle([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
+[cols=2*]
+|===
+|`task_id` or `taskId`
+|`string` - The task id to rethrottle
+
+|`requests_per_second` or `requestsPerSecond`
+|`number` - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
+
+|===
+=== deleteScript
+[source,js]
+----
+client.deleteScript([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
+[cols=2*]
+|===
+|`id`
+|`string` - Script ID
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|===
+=== exists
+[source,js]
+----
+client.exists([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
+[cols=2*]
+|===
+|`id`
+|`string` - The document ID
+
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types)
+
+|`stored_fields` or `storedFields`
+|`string, string[]` - A comma-separated list of stored fields to return in the response
+
+|`parent`
+|`string` - The ID of the parent document
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`realtime`
+|`boolean` - Specify whether to perform the operation in realtime or search mode
+
+|`refresh`
+|`boolean` - Refresh the shard containing the document before performing the operation
+
+|`routing`
+|`string` - Specific routing value
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`version_type` or `versionType`
+|`'internal', 'external', 'external_gte', 'force'` - Specific version type
+
+|===
+=== existsSource
+[source,js]
+----
+client.existsSource([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
+[cols=2*]
+|===
+|`id`
+|`string` - The document ID
+
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document; deprecated and optional starting with 7.0
+
+|`parent`
+|`string` - The ID of the parent document
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`realtime`
+|`boolean` - Specify whether to perform the operation in realtime or search mode
+
+|`refresh`
+|`boolean` - Refresh the shard containing the document before performing the operation
+
+|`routing`
+|`string` - Specific routing value
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`version_type` or `versionType`
+|`'internal', 'external', 'external_gte', 'force'` - Specific version type
+
+|===
+=== explain
+[source,js]
+----
+client.explain([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html
+[cols=2*]
+|===
+|`id`
+|`string` - The document ID
+
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document
+
+|`analyze_wildcard` or `analyzeWildcard`
+|`boolean` - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)
+
+|`analyzer`
+|`string` - The analyzer for the query string query
+
+|`default_operator` or `defaultOperator`
+|`'AND', 'OR'` - The default operator for query string query (AND or OR) +
+ _Default:_ `OR`
+
+|`df`
+|`string` - The default field for query string query (default: _all)
+
+|`stored_fields` or `storedFields`
+|`string, string[]` - A comma-separated list of stored fields to return in the response
+
+|`lenient`
+|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+
+|`parent`
+|`string` - The ID of the parent document
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`q`
+|`string` - Query in the Lucene query string syntax
+
+|`routing`
+|`string` - Specific routing value
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`body`
+|`object` - The query definition using the Query DSL
+
+|===
+=== fieldCaps
+[source,js]
+----
+client.fieldCaps([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`fields`
+|`string, string[]` - A comma-separated list of field names
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|===
+=== get
+[source,js]
+----
+client.get([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
+[cols=2*]
+|===
+|`id`
+|`string` - The document ID
+
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types)
+
+|`stored_fields` or `storedFields`
+|`string, string[]` - A comma-separated list of stored fields to return in the response
+
+|`parent`
+|`string` - The ID of the parent document
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`realtime`
+|`boolean` - Specify whether to perform the operation in realtime or search mode
+
+|`refresh`
+|`boolean` - Refresh the shard containing the document before performing the operation
+
+|`routing`
+|`string` - Specific routing value
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`_source_exclude` or `_sourceExclude`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_include` or `_sourceInclude`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`version_type` or `versionType`
+|`'internal', 'external', 'external_gte', 'force'` - Specific version type
+
+|===
+=== getScript
+[source,js]
+----
+client.getScript([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
+[cols=2*]
+|===
+|`id`
+|`string` - Script ID
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|===
+=== getSource
+[source,js]
+----
+client.getSource([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
+[cols=2*]
+|===
+|`id`
+|`string` - The document ID
+
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document; deprecated and optional starting with 7.0
+
+|`parent`
+|`string` - The ID of the parent document
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`realtime`
+|`boolean` - Specify whether to perform the operation in realtime or search mode
+
+|`refresh`
+|`boolean` - Refresh the shard containing the document before performing the operation
+
+|`routing`
+|`string` - Specific routing value
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`version_type` or `versionType`
+|`'internal', 'external', 'external_gte', 'force'` - Specific version type
+
+|===
+=== index
+[source,js]
+----
+client.index([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html
+[cols=2*]
+|===
+|`id`
+|`string` - Document ID
+
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of shard copies that must be active before proceeding with the index 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)
+
+|`op_type` or `opType`
+|`'index', 'create'` - Explicit operation type +
+ _Default:_ `index`
+
+|`parent`
+|`string` - ID of the parent document
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - 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.
+
+|`routing`
+|`string` - Specific routing value
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`version_type` or `versionType`
+|`'internal', 'external', 'external_gte', 'force'` - Specific version type
+
+|`if_seq_no` or `ifSeqNo`
+|`number` - only perform the index operation if the last operation that has changed the document has the specified sequence number
+
+|`if_primary_term` or `ifPrimaryTerm`
+|`number` - only perform the index operation if the last operation that has changed the document has the specified primary term
+
+|`pipeline`
+|`string` - The pipeline id to preprocess incoming documents with
+
+|`body`
+|`object` - The document
+
+|===
+=== indices.analyze
+[source,js]
+----
+client.indices.analyze([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the index to scope the operation
+
+|`index`
+|`string` - The name of the index to scope the operation
+
+|`body`
+|`object` - Define analyzer/tokenizer parameters and the text on which the analysis should be performed
+
+|===
+=== indices.clearCache
+[source,js]
+----
+client.indices.clearCache([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index name to limit the operation
+
+|`fielddata`
+|`boolean` - Clear field data
+
+|`fields`
+|`string, string[]` - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)
+
+|`query`
+|`boolean` - Clear query caches
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`index`
+|`string, string[]` - A comma-separated list of index name to limit the operation
+
+|`request`
+|`boolean` - Clear request cache
+
+|===
+=== indices.close
+[source,js]
+----
+client.indices.close([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma separated list of indices to close
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|===
+=== indices.create
+[source,js]
+----
+client.indices.create([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the index
+
+|`include_type_name` or `includeTypeName`
+|`boolean` - Whether a type should be expected in the body of the mappings.
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Set the number of active shards to wait for before the operation returns.
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`body`
+|`object` - The configuration for the index (`settings` and `mappings`)
+
+|===
+=== indices.delete
+[source,js]
+----
+client.indices.delete([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Ignore unavailable indexes (default: false)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Ignore if a wildcard expression resolves to no concrete indices (default: false)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) +
+ _Default:_ `open`
+
+|===
+=== indices.deleteAlias
+[source,js]
+----
+client.indices.deleteAlias([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names (supports wildcards); use `_all` for all indices
+
+|`name`
+|`string, string[]` - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.
+
+|`timeout`
+|`string` - Explicit timestamp for the document
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|===
+=== indices.deleteTemplate
+[source,js]
+----
+client.indices.deleteTemplate([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+[cols=2*]
+|===
+|`name`
+|`string` - The name of the template
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|===
+=== indices.exists
+[source,js]
+----
+client.indices.exists([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Ignore unavailable indexes (default: false)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Ignore if a wildcard expression resolves to no concrete indices (default: false)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) +
+ _Default:_ `open`
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`include_defaults` or `includeDefaults`
+|`boolean` - Whether to return all default setting for each of the indices.
+
+|===
+=== indices.existsAlias
+[source,js]
+----
+client.indices.existsAlias([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to filter aliases
+
+|`name`
+|`string, string[]` - A comma-separated list of alias names to return
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `all`
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|===
+=== indices.existsTemplate
+[source,js]
+----
+client.indices.existsTemplate([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+[cols=2*]
+|===
+|`name`
+|`string, string[]` - The comma separated names of the index templates
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|===
+=== indices.existsType
+[source,js]
+----
+client.indices.existsType([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` to check the types across all indices
+
+|`type`
+|`string, string[]` - A comma-separated list of document types to check
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|===
+=== indices.flush
+[source,js]
+----
+client.indices.flush([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string for all indices
+
+|`force`
+|`boolean` - 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)
+
+|`wait_if_ongoing` or `waitIfOngoing`
+|`boolean` - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running.
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|===
+=== indices.flushSynced
+[source,js]
+----
+client.indices.flushSynced([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string for all indices
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|===
+=== indices.forcemerge
+[source,js]
+----
+client.indices.forcemerge([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`flush`
+|`boolean` - Specify whether the index should be flushed after performing the operation (default: true)
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`max_num_segments` or `maxNumSegments`
+|`number` - The number of segments the index should be merged into (default: dynamic)
+
+|`only_expunge_deletes` or `onlyExpungeDeletes`
+|`boolean` - Specify whether the operation should only expunge deleted documents
+
+|===
+=== indices.get
+[source,js]
+----
+client.indices.get([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names
+
+|`include_type_name` or `includeTypeName`
+|`boolean` - Whether to add the type name to the response (default: false)
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Ignore unavailable indexes (default: false)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Ignore if a wildcard expression resolves to no concrete indices (default: false)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) +
+ _Default:_ `open`
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`include_defaults` or `includeDefaults`
+|`boolean` - Whether to return all default setting for each of the indices.
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|===
+=== indices.getAlias
+[source,js]
+----
+client.indices.getAlias([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to filter aliases
+
+|`name`
+|`string, string[]` - A comma-separated list of alias names to return
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `all`
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|===
+=== indices.getFieldMapping
+[source,js]
+----
+client.indices.getFieldMapping([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names
+
+|`type`
+|`string, string[]` - A comma-separated list of document types
+
+|`fields`
+|`string, string[]` - A comma-separated list of fields
+
+|`include_type_name` or `includeTypeName`
+|`boolean` - Whether a type should be returned in the body of the mappings.
+
+|`include_defaults` or `includeDefaults`
+|`boolean` - Whether the default mapping values should be returned as well
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|===
+=== indices.getMapping
+[source,js]
+----
+client.indices.getMapping([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names
+
+|`type`
+|`string, string[]` - A comma-separated list of document types
+
+|`include_type_name` or `includeTypeName`
+|`boolean` - Whether to add the type name to the response (default: false)
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|===
+=== indices.getSettings
+[source,js]
+----
+client.indices.getSettings([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`name`
+|`string, string[]` - The name of the settings that should be included
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open,closed`
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`include_defaults` or `includeDefaults`
+|`boolean` - Whether to return all default setting for each of the indices.
+
+|===
+=== indices.getTemplate
+[source,js]
+----
+client.indices.getTemplate([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+[cols=2*]
+|===
+|`name`
+|`string, string[]` - The comma separated names of the index templates
+
+|`include_type_name` or `includeTypeName`
+|`boolean` - Whether a type should be returned in the body of the mappings.
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|===
+=== indices.getUpgrade
+[source,js]
+----
+client.indices.getUpgrade([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|===
+=== indices.open
+[source,js]
+----
+client.indices.open([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma separated list of indices to open
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `closed`
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of active shards to wait for before the operation returns.
+
+|===
+=== indices.putAlias
+[source,js]
+----
+client.indices.putAlias([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices.
+
+|`name`
+|`string` - The name of the alias to be created or updated
+
+|`timeout`
+|`string` - Explicit timestamp for the document
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`body`
+|`object` - The settings for the alias, such as `routing` or `filter`
+
+|===
+=== indices.putMapping
+[source,js]
+----
+client.indices.putMapping([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices.
+
+|`type`
+|`string` - The name of the document type
+
+|`include_type_name` or `includeTypeName`
+|`boolean` - Whether a type should be expected in the body of the mappings.
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`body`
+|`object` - The mapping definition
+
+|===
+=== indices.putSettings
+[source,js]
+----
+client.indices.putSettings([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`preserve_existing` or `preserveExisting`
+|`boolean` - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`body`
+|`object` - The index settings to be updated
+
+|===
+=== indices.putTemplate
+[source,js]
+----
+client.indices.putTemplate([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
+[cols=2*]
+|===
+|`name`
+|`string` - The name of the template
+
+|`include_type_name` or `includeTypeName`
+|`boolean` - Whether a type should be returned in the body of the mappings.
+
+|`order`
+|`number` - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
+
+|`create`
+|`boolean` - Whether the index template should only be added if new or can also replace an existing one
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`body`
+|`object` - The template definition
+
+|===
+=== indices.recovery
+[source,js]
+----
+client.indices.recovery([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`detailed`
+|`boolean` - Whether to display detailed information about shard recovery
+
+|`active_only` or `activeOnly`
+|`boolean` - Display only those recoveries that are currently on-going
+
+|===
+=== indices.refresh
+[source,js]
+----
+client.indices.refresh([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|===
+=== indices.rollover
+[source,js]
+----
+client.indices.rollover([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html
+[cols=2*]
+|===
+|`alias`
+|`string` - The name of the alias to rollover
+
+|`new_index` or `newIndex`
+|`string` - The name of the rollover index
+
+|`include_type_name` or `includeTypeName`
+|`boolean` - Whether a type should be included in the body of the mappings.
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`dry_run` or `dryRun`
+|`boolean` - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Set the number of active shards to wait for on the newly created rollover index before the operation returns.
+
+|`body`
+|`object` - The conditions that needs to be met for executing rollover
+
+|===
+=== indices.segments
+[source,js]
+----
+client.indices.segments([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`verbose`
+|`boolean` - Includes detailed memory usage by Lucene.
+
+|===
+=== indices.shardStores
+[source,js]
+----
+client.indices.shardStores([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`status`
+|`string, string[]` - A comma-separated list of statuses used to filter on shards to get store information for
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|===
+=== indices.shrink
+[source,js]
+----
+client.indices.shrink([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the source index to shrink
+
+|`target`
+|`string` - The name of the target index to shrink into
+
+|`copy_settings` or `copySettings`
+|`boolean` - whether or not to copy settings from the source index (defaults to false)
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Set the number of active shards to wait for on the shrunken index before the operation returns.
+
+|`body`
+|`object` - The configuration for the target index (`settings` and `aliases`)
+
+|===
+=== indices.split
+[source,js]
+----
+client.indices.split([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the source index to split
+
+|`target`
+|`string` - The name of the target index to split into
+
+|`copy_settings` or `copySettings`
+|`boolean` - whether or not to copy settings from the source index (defaults to false)
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Set the number of active shards to wait for on the shrunken index before the operation returns.
+
+|`body`
+|`object` - The configuration for the target index (`settings` and `aliases`)
+
+|===
+=== indices.stats
+[source,js]
+----
+client.indices.stats([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`metric`
+|`string, string[]` - Limit the information returned the specific metrics.
+
+|`completion_fields` or `completionFields`
+|`string, string[]` - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
+
+|`fielddata_fields` or `fielddataFields`
+|`string, string[]` - A comma-separated list of fields for `fielddata` index metric (supports wildcards)
+
+|`fields`
+|`string, string[]` - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
+
+|`groups`
+|`string, string[]` - A comma-separated list of search groups for `search` index metric
+
+|`level`
+|`'cluster', 'indices', 'shards'` - Return stats aggregated at cluster, index or shard level +
+ _Default:_ `indices`
+
+|`types`
+|`string, string[]` - A comma-separated list of document types for the `indexing` index metric
+
+|`include_segment_file_sizes` or `includeSegmentFileSizes`
+|`boolean` - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
+
+|===
+=== indices.updateAliases
+[source,js]
+----
+client.indices.updateAliases([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
+[cols=2*]
+|===
+|`timeout`
+|`string` - Request timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`body`
+|`object` - The definition of `actions` to perform
+
+|===
+=== indices.upgrade
+[source,js]
+----
+client.indices.upgrade([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Specify whether the request should block until the all segments are upgraded (default: false)
+
+|`only_ancient_segments` or `onlyAncientSegments`
+|`boolean` - If true, only ancient (an older Lucene major release) segments will be upgraded
+
+|===
+=== indices.validateQuery
+[source,js]
+----
+client.indices.validateQuery([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices
+
+|`type`
+|`string, string[]` - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types
+
+|`explain`
+|`boolean` - Return detailed information about the error
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`q`
+|`string` - Query in the Lucene query string syntax
+
+|`analyzer`
+|`string` - The analyzer to use for the query string
+
+|`analyze_wildcard` or `analyzeWildcard`
+|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)
+
+|`default_operator` or `defaultOperator`
+|`'AND', 'OR'` - The default operator for query string query (AND or OR) +
+ _Default:_ `OR`
+
+|`df`
+|`string` - The field to use as default where no field prefix is given in the query string
+
+|`lenient`
+|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+
+|`rewrite`
+|`boolean` - Provide a more detailed explanation showing the actual Lucene query that will be executed.
+
+|`all_shards` or `allShards`
+|`boolean` - Execute validation on all shards instead of one random shard per index
+
+|`body`
+|`object` - The query definition specified with the Query DSL
+
+|===
+=== info
+[source,js]
+----
+client.info([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/
+[cols=2*]
+|===
+|===
+=== ingest.deletePipeline
+[source,js]
+----
+client.ingest.deletePipeline([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html
+[cols=2*]
+|===
+|`id`
+|`string` - Pipeline ID
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== ingest.getPipeline
+[source,js]
+----
+client.ingest.getPipeline([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html
+[cols=2*]
+|===
+|`id`
+|`string` - Comma separated list of pipeline ids. Wildcards supported
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|===
+=== ingest.processorGrok
+[source,js]
+----
+client.ingest.processorGrok([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html
+[cols=2*]
+|===
+|===
+=== ingest.putPipeline
+[source,js]
+----
+client.ingest.putPipeline([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html
+[cols=2*]
+|===
+|`id`
+|`string` - Pipeline ID
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`body`
+|`object` - The ingest definition
+
+|===
+=== ingest.simulate
+[source,js]
+----
+client.ingest.simulate([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html
+[cols=2*]
+|===
+|`id`
+|`string` - Pipeline ID
+
+|`verbose`
+|`boolean` - Verbose mode. Display data output for each processor in executed pipeline
+
+|`body`
+|`object` - The simulate definition
+
+|===
+=== mget
+[source,js]
+----
+client.mget([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document
+
+|`stored_fields` or `storedFields`
+|`string, string[]` - A comma-separated list of stored fields to return in the response
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`realtime`
+|`boolean` - Specify whether to perform the operation in realtime or search mode
+
+|`refresh`
+|`boolean` - Refresh the shard containing the document before performing the operation
+
+|`routing`
+|`string` - Specific routing value
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`body`
+|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.
+
+|===
+=== msearch
+[source,js]
+----
+client.msearch([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to use as default
+
+|`type`
+|`string, string[]` - A comma-separated list of document types to use as default
+
+|`search_type` or `searchType`
+|`'query_then_fetch', 'query_and_fetch', 'dfs_query_then_fetch', 'dfs_query_and_fetch'` - Search operation type
+
+|`max_concurrent_searches` or `maxConcurrentSearches`
+|`number` - Controls the maximum number of concurrent searches the multi search api will execute
+
+|`typed_keys` or `typedKeys`
+|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+
+|`pre_filter_shard_size` or `preFilterShardSize`
+|`number` - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. +
+ _Default:_ `128`
+
+|`max_concurrent_shard_requests` or `maxConcurrentShardRequests`
+|`number` - The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests +
+ _Default:_ `The default grows with the number of nodes in the cluster but is at most 256.`
+
+|`rest_total_hits_as_int` or `restTotalHitsAsInt`
+|`boolean` - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+
+|`ccs_minimize_roundtrips` or `ccsMinimizeRoundtrips`
+|`boolean` - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution +
+ _Default:_ `true`
+
+|`body`
+|`object` - The request definitions (metadata-search request definition pairs), separated by newlines
+
+|===
+=== msearchTemplate
+[source,js]
+----
+client.msearchTemplate([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to use as default
+
+|`type`
+|`string, string[]` - A comma-separated list of document types to use as default
+
+|`search_type` or `searchType`
+|`'query_then_fetch', 'query_and_fetch', 'dfs_query_then_fetch', 'dfs_query_and_fetch'` - Search operation type
+
+|`typed_keys` or `typedKeys`
+|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+
+|`max_concurrent_searches` or `maxConcurrentSearches`
+|`number` - Controls the maximum number of concurrent searches the multi search api will execute
+
+|`rest_total_hits_as_int` or `restTotalHitsAsInt`
+|`boolean` - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+
+|`ccs_minimize_roundtrips` or `ccsMinimizeRoundtrips`
+|`boolean` - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution +
+ _Default:_ `true`
+
+|`body`
+|`object` - The request definitions (metadata-search request definition pairs), separated by newlines
+
+|===
+=== mtermvectors
+[source,js]
+----
+client.mtermvectors([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html
+[cols=2*]
+|===
+|`index`
+|`string` - The index in which the document resides.
+
+|`type`
+|`string` - The type of the document.
+
+|`ids`
+|`string, string[]` - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
+
+|`term_statistics` or `termStatistics`
+|`boolean` - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+
+|`field_statistics` or `fieldStatistics`
+|`boolean` - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +
+ _Default:_ `true`
+
+|`fields`
+|`string, string[]` - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+
+|`offsets`
+|`boolean` - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +
+ _Default:_ `true`
+
+|`positions`
+|`boolean` - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +
+ _Default:_ `true`
+
+|`payloads`
+|`boolean` - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". +
+ _Default:_ `true`
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs".
+
+|`routing`
+|`string` - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+
+|`parent`
+|`string` - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs".
+
+|`realtime`
+|`boolean` - Specifies if requests are real-time as opposed to near-real-time (default: true).
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`version_type` or `versionType`
+|`'internal', 'external', 'external_gte', 'force'` - Specific version type
+
+|`body`
+|`object` - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.
+
+|===
+=== nodes.hotThreads
+[source,js]
+----
+client.nodes.hotThreads([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html
+[cols=2*]
+|===
+|`node_id` or `nodeId`
+|`string, string[]` - 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
+
+|`interval`
+|`string` - The interval for the second sampling of threads
+
+|`snapshots`
+|`number` - Number of samples of thread stacktrace (default: 10)
+
+|`threads`
+|`number` - Specify the number of threads to provide information for (default: 3)
+
+|`ignore_idle_threads` or `ignoreIdleThreads`
+|`boolean` - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)
+
+|`type`
+|`'cpu', 'wait', 'block'` - The type to sample (default: cpu)
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== nodes.info
+[source,js]
+----
+client.nodes.info([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html
+[cols=2*]
+|===
+|`node_id` or `nodeId`
+|`string, string[]` - 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
+
+|`metric`
+|`string, string[]` - A comma-separated list of metrics you wish returned. Leave empty to return all.
+
+|`flat_settings` or `flatSettings`
+|`boolean` - Return settings in flat format (default: false)
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== nodes.reloadSecureSettings
+[source,js]
+----
+client.nodes.reloadSecureSettings([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings
+[cols=2*]
+|===
+|`node_id` or `nodeId`
+|`string, string[]` - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== nodes.stats
+[source,js]
+----
+client.nodes.stats([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html
+[cols=2*]
+|===
+|`metric`
+|`string, string[]` - Limit the information returned to the specified metrics
+
+|`index_metric` or `indexMetric`
+|`string, string[]` - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified.
+
+|`node_id` or `nodeId`
+|`string, string[]` - 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
+
+|`completion_fields` or `completionFields`
+|`string, string[]` - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
+
+|`fielddata_fields` or `fielddataFields`
+|`string, string[]` - A comma-separated list of fields for `fielddata` index metric (supports wildcards)
+
+|`fields`
+|`string, string[]` - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
+
+|`groups`
+|`boolean` - A comma-separated list of search groups for `search` index metric
+
+|`level`
+|`'indices', 'node', 'shards'` - Return indices stats aggregated at index, node or shard level +
+ _Default:_ `node`
+
+|`types`
+|`string, string[]` - A comma-separated list of document types for the `indexing` index metric
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`include_segment_file_sizes` or `includeSegmentFileSizes`
+|`boolean` - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
+
+|===
+=== nodes.usage
+[source,js]
+----
+client.nodes.usage([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html
+[cols=2*]
+|===
+|`metric`
+|`string, string[]` - Limit the information returned to the specified metrics
+
+|`node_id` or `nodeId`
+|`string, string[]` - 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
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== ping
+[source,js]
+----
+client.ping([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/
+[cols=2*]
+|===
+|===
+=== putScript
+[source,js]
+----
+client.putScript([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
+[cols=2*]
+|===
+|`id`
+|`string` - Script ID
+
+|`context`
+|`string` - Script context
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`context`
+|`string` - Context name to compile script against
+
+|`body`
+|`object` - The document
+
+|===
+=== rankEval
+[source,js]
+----
+client.rankEval([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`body`
+|`object` - The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.
+
+|===
+=== reindex
+[source,js]
+----
+client.reindex([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html
+[cols=2*]
+|===
+|`refresh`
+|`boolean` - Should the effected indexes be refreshed?
+
+|`timeout`
+|`string` - Time each individual bulk request should wait for shards that are unavailable. +
+ _Default:_ `1m`
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of shard copies that must be active before proceeding with the reindex 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)
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Should the request should block until the reindex is complete. +
+ _Default:_ `true`
+
+|`requests_per_second` or `requestsPerSecond`
+|`number` - The throttle to set on this request in sub-requests per second. -1 means no throttle.
+
+|`slices`
+|`number` - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. +
+ _Default:_ `1`
+
+|`body`
+|`object` - The search definition using the Query DSL and the prototype for the index request.
+
+|===
+=== reindexRethrottle
+[source,js]
+----
+client.reindexRethrottle([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html
+[cols=2*]
+|===
+|`task_id` or `taskId`
+|`string` - The task id to rethrottle
+
+|`requests_per_second` or `requestsPerSecond`
+|`number` - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
+
+|===
+=== renderSearchTemplate
+[source,js]
+----
+client.renderSearchTemplate([params] [, options] [, callback])
+----
+http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html
+[cols=2*]
+|===
+|`id`
+|`string` - The id of the stored search template
+
+|`body`
+|`object` - The search definition template and its params
+
+|===
+=== scriptsPainlessExecute
+[source,js]
+----
+client.scriptsPainlessExecute([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html
+[cols=2*]
+|===
+|`body`
+|`object` - The script to execute
+
+|===
+=== scroll
+[source,js]
+----
+client.scroll([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html
+[cols=2*]
+|===
+|`scroll_id` or `scrollId`
+|`string` - The scroll ID
+
+|`scroll`
+|`string` - Specify how long a consistent view of the index should be maintained for scrolled search
+
+|`scroll_id` or `scrollId`
+|`string` - The scroll ID for scrolled search
+
+|`rest_total_hits_as_int` or `restTotalHitsAsInt`
+|`boolean` - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+
+|`body`
+|`object` - The scroll ID if not passed by URL or query parameter.
+
+|===
+=== search
+[source,js]
+----
+client.search([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
+
+|`type`
+|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types
+
+|`analyzer`
+|`string` - The analyzer to use for the query string
+
+|`analyze_wildcard` or `analyzeWildcard`
+|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)
+
+|`ccs_minimize_roundtrips` or `ccsMinimizeRoundtrips`
+|`boolean` - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution +
+ _Default:_ `true`
+
+|`default_operator` or `defaultOperator`
+|`'AND', 'OR'` - The default operator for query string query (AND or OR) +
+ _Default:_ `OR`
+
+|`df`
+|`string` - The field to use as default where no field prefix is given in the query string
+
+|`explain`
+|`boolean` - Specify whether to return detailed information about score computation as part of a hit
+
+|`stored_fields` or `storedFields`
+|`string, string[]` - A comma-separated list of stored fields to return as part of a hit
+
+|`docvalue_fields` or `docvalueFields`
+|`string, string[]` - A comma-separated list of fields to return as the docvalue representation of a field for each hit
+
+|`from`
+|`number` - Starting offset (default: 0)
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`ignore_throttled` or `ignoreThrottled`
+|`boolean` - Whether specified concrete, expanded or aliased indices should be ignored when throttled
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`lenient`
+|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`q`
+|`string` - Query in the Lucene query string syntax
+
+|`routing`
+|`string, string[]` - A comma-separated list of specific routing values
+
+|`scroll`
+|`string` - Specify how long a consistent view of the index should be maintained for scrolled search
+
+|`search_type` or `searchType`
+|`'query_then_fetch', 'dfs_query_then_fetch'` - Search operation type
+
+|`size`
+|`number` - Number of hits to return (default: 10)
+
+|`sort`
+|`string, string[]` - A comma-separated list of : pairs
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`terminate_after` or `terminateAfter`
+|`number` - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
+
+|`stats`
+|`string, string[]` - Specific 'tag' of the request for logging and statistical purposes
+
+|`suggest_field` or `suggestField`
+|`string` - Specify which field to use for suggestions
+
+|`suggest_mode` or `suggestMode`
+|`'missing', 'popular', 'always'` - Specify suggest mode +
+ _Default:_ `missing`
+
+|`suggest_size` or `suggestSize`
+|`number` - How many suggestions to return in response
+
+|`suggest_text` or `suggestText`
+|`string` - The source text for which the suggestions should be returned
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`track_scores` or `trackScores`
+|`boolean` - Whether to calculate and return scores even if they are not used for sorting
+
+|`track_total_hits` or `trackTotalHits`
+|`boolean` - Indicate if the number of documents that match the query should be tracked
+
+|`allow_partial_search_results` or `allowPartialSearchResults`
+|`boolean` - Indicate if an error should be returned if there is a partial search failure or timeout +
+ _Default:_ `true`
+
+|`typed_keys` or `typedKeys`
+|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+
+|`version`
+|`boolean` - Specify whether to return document version as part of a hit
+
+|`seq_no_primary_term` or `seqNoPrimaryTerm`
+|`boolean` - Specify whether to return sequence number and primary term of the last modification of each hit
+
+|`request_cache` or `requestCache`
+|`boolean` - Specify if request cache should be used for this request or not, defaults to index level setting
+
+|`batched_reduce_size` or `batchedReduceSize`
+|`number` - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. +
+ _Default:_ `512`
+
+|`max_concurrent_shard_requests` or `maxConcurrentShardRequests`
+|`number` - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests +
+ _Default:_ `The default is 5.`
+
+|`pre_filter_shard_size` or `preFilterShardSize`
+|`number` - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. +
+ _Default:_ `128`
+
+|`rest_total_hits_as_int` or `restTotalHitsAsInt`
+|`boolean` - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+
+|`body`
+|`object` - The search definition using the Query DSL
+
+|===
+=== searchShards
+[source,js]
+----
+client.searchShards([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`routing`
+|`string` - Specific routing value
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|===
+=== searchTemplate
+[source,js]
+----
+client.searchTemplate([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
+
+|`type`
+|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`ignore_throttled` or `ignoreThrottled`
+|`boolean` - Whether specified concrete, expanded or aliased indices should be ignored when throttled
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`routing`
+|`string, string[]` - A comma-separated list of specific routing values
+
+|`scroll`
+|`string` - Specify how long a consistent view of the index should be maintained for scrolled search
+
+|`search_type` or `searchType`
+|`'query_then_fetch', 'query_and_fetch', 'dfs_query_then_fetch', 'dfs_query_and_fetch'` - Search operation type
+
+|`explain`
+|`boolean` - Specify whether to return detailed information about score computation as part of a hit
+
+|`profile`
+|`boolean` - Specify whether to profile the query execution
+
+|`typed_keys` or `typedKeys`
+|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+
+|`rest_total_hits_as_int` or `restTotalHitsAsInt`
+|`boolean` - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+
+|`ccs_minimize_roundtrips` or `ccsMinimizeRoundtrips`
+|`boolean` - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution +
+ _Default:_ `true`
+
+|`body`
+|`object` - The search definition template and its params
+
+|===
+=== snapshot.create
+[source,js]
+----
+client.snapshot.create([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string` - A repository name
+
+|`snapshot`
+|`string` - A snapshot name
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Should this request wait until the operation has completed before returning
+
+|`body`
+|`object` - The snapshot definition
+
+|===
+=== snapshot.createRepository
+[source,js]
+----
+client.snapshot.createRepository([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string` - A repository name
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`verify`
+|`boolean` - Whether to verify the repository after creation
+
+|`body`
+|`object` - The repository definition
+
+|===
+=== snapshot.delete
+[source,js]
+----
+client.snapshot.delete([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string` - A repository name
+
+|`snapshot`
+|`string` - A snapshot name
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|===
+=== snapshot.deleteRepository
+[source,js]
+----
+client.snapshot.deleteRepository([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string, string[]` - A comma-separated list of repository names
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== snapshot.get
+[source,js]
+----
+client.snapshot.get([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string` - A repository name
+
+|`snapshot`
+|`string, string[]` - A comma-separated list of snapshot names
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
+
+|`verbose`
+|`boolean` - Whether to show verbose snapshot info or only show the basic info found in the repository index blob
+
+|===
+=== snapshot.getRepository
+[source,js]
+----
+client.snapshot.getRepository([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string, string[]` - A comma-separated list of repository names
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|===
+=== snapshot.restore
+[source,js]
+----
+client.snapshot.restore([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string` - A repository name
+
+|`snapshot`
+|`string` - A snapshot name
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Should this request wait until the operation has completed before returning
+
+|`body`
+|`object` - Details of what to restore
+
+|===
+=== snapshot.status
+[source,js]
+----
+client.snapshot.status([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string` - A repository name
+
+|`snapshot`
+|`string, string[]` - A comma-separated list of snapshot names
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
+
+|===
+=== snapshot.verifyRepository
+[source,js]
+----
+client.snapshot.verifyRepository([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html
+[cols=2*]
+|===
+|`repository`
+|`string` - A repository name
+
+|`master_timeout` or `masterTimeout`
+|`string` - Explicit operation timeout for connection to master node
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== tasks.cancel
+[source,js]
+----
+client.tasks.cancel([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
+[cols=2*]
+|===
+|`task_id` or `taskId`
+|`string` - Cancel the task with specified task id (node_id:task_number)
+
+|`nodes`
+|`string, string[]` - 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
+
+|`actions`
+|`string, string[]` - A comma-separated list of actions that should be cancelled. Leave empty to cancel all.
+
+|`parent_task_id` or `parentTaskId`
+|`string` - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.
+
+|===
+=== tasks.get
+[source,js]
+----
+client.tasks.get([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
+[cols=2*]
+|===
+|`task_id` or `taskId`
+|`string` - Return the task with specified id (node_id:task_number)
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Wait for the matching tasks to complete (default: false)
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== tasks.list
+[source,js]
+----
+client.tasks.list([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
+[cols=2*]
+|===
+|`nodes`
+|`string, string[]` - 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
+
+|`actions`
+|`string, string[]` - A comma-separated list of actions that should be returned. Leave empty to return all.
+
+|`detailed`
+|`boolean` - Return detailed task information (default: false)
+
+|`parent_task_id` or `parentTaskId`
+|`string` - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Wait for the matching tasks to complete (default: false)
+
+|`group_by` or `groupBy`
+|`'nodes', 'parents', 'none'` - Group tasks by nodes or parent/child relationships +
+ _Default:_ `nodes`
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|===
+=== termvectors
+[source,js]
+----
+client.termvectors([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html
+[cols=2*]
+|===
+|`index`
+|`string` - The index in which the document resides.
+
+|`type`
+|`string` - The type of the document.
+
+|`id`
+|`string` - The id of the document, when not specified a doc param should be supplied.
+
+|`term_statistics` or `termStatistics`
+|`boolean` - Specifies if total term frequency and document frequency should be returned.
+
+|`field_statistics` or `fieldStatistics`
+|`boolean` - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. +
+ _Default:_ `true`
+
+|`fields`
+|`string, string[]` - A comma-separated list of fields to return.
+
+|`offsets`
+|`boolean` - Specifies if term offsets should be returned. +
+ _Default:_ `true`
+
+|`positions`
+|`boolean` - Specifies if term positions should be returned. +
+ _Default:_ `true`
+
+|`payloads`
+|`boolean` - Specifies if term payloads should be returned. +
+ _Default:_ `true`
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random).
+
+|`routing`
+|`string` - Specific routing value.
+
+|`parent`
+|`string` - Parent id of documents.
+
+|`realtime`
+|`boolean` - Specifies if request is real-time as opposed to near-real-time (default: true).
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`version_type` or `versionType`
+|`'internal', 'external', 'external_gte', 'force'` - Specific version type
+
+|`body`
+|`object` - Define parameters and or supply a document to get termvectors for. See documentation.
+
+|===
+=== update
+[source,js]
+----
+client.update([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html
+[cols=2*]
+|===
+|`id`
+|`string` - Document ID
+
+|`index`
+|`string` - The name of the index
+
+|`type`
+|`string` - The type of the document
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of shard copies that must be active before proceeding with the update 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)
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`lang`
+|`string` - The script language (default: painless)
+
+|`parent`
+|`string` - ID of the parent document. Is is only used for routing and when for the upsert request
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - 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.
+
+|`retry_on_conflict` or `retryOnConflict`
+|`number` - Specify how many times should the operation be retried when a conflict occurs (default: 0)
+
+|`routing`
+|`string` - Specific routing value
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`if_seq_no` or `ifSeqNo`
+|`number` - only perform the update operation if the last operation that has changed the document has the specified sequence number
+
+|`if_primary_term` or `ifPrimaryTerm`
+|`number` - only perform the update operation if the last operation that has changed the document has the specified primary term
+
+|`body`
+|`object` - The request definition requires either `script` or partial `doc`
+
+|===
+=== updateByQuery
+[source,js]
+----
+client.updateByQuery([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
+
+|`type`
+|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types
+
+|`analyzer`
+|`string` - The analyzer to use for the query string
+
+|`analyze_wildcard` or `analyzeWildcard`
+|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false)
+
+|`default_operator` or `defaultOperator`
+|`'AND', 'OR'` - The default operator for query string query (AND or OR) +
+ _Default:_ `OR`
+
+|`df`
+|`string` - The field to use as default where no field prefix is given in the query string
+
+|`from`
+|`number` - Starting offset (default: 0)
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`conflicts`
+|`'abort', 'proceed'` - What to do when the update by query hits version conflicts? +
+ _Default:_ `abort`
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`lenient`
+|`boolean` - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+
+|`pipeline`
+|`string` - Ingest pipeline to set on index requests made by this action. (default: none)
+
+|`preference`
+|`string` - Specify the node or shard the operation should be performed on (default: random)
+
+|`q`
+|`string` - Query in the Lucene query string syntax
+
+|`routing`
+|`string, string[]` - A comma-separated list of specific routing values
+
+|`scroll`
+|`string` - Specify how long a consistent view of the index should be maintained for scrolled search
+
+|`search_type` or `searchType`
+|`'query_then_fetch', 'dfs_query_then_fetch'` - Search operation type
+
+|`search_timeout` or `searchTimeout`
+|`string` - Explicit timeout for each search request. Defaults to no timeout.
+
+|`size`
+|`number` - Number of hits to return (default: 10)
+
+|`sort`
+|`string, string[]` - A comma-separated list of : pairs
+
+|`_source`
+|`string, string[]` - True or false to return the _source field or not, or a list of fields to return
+
+|`_source_excludes` or `_sourceExcludes`
+|`string, string[]` - A list of fields to exclude from the returned _source field
+
+|`_source_includes` or `_sourceIncludes`
+|`string, string[]` - A list of fields to extract and return from the _source field
+
+|`terminate_after` or `terminateAfter`
+|`number` - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
+
+|`stats`
+|`string, string[]` - Specific 'tag' of the request for logging and statistical purposes
+
+|`version`
+|`boolean` - Specify whether to return document version as part of a hit
+
+|`version_type` or `versionType`
+|`boolean` - Should the document increment the version number (internal) on hit or not (reindex)
+
+|`request_cache` or `requestCache`
+|`boolean` - Specify if request cache should be used for this request or not, defaults to index level setting
+
+|`refresh`
+|`boolean` - Should the effected indexes be refreshed?
+
+|`timeout`
+|`string` - Time each individual bulk request should wait for shards that are unavailable. +
+ _Default:_ `1m`
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of shard copies that must be active before proceeding with the update 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)
+
+|`scroll_size` or `scrollSize`
+|`number` - Size on the scroll request powering the update by query
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Should the request should block until the update by query operation is complete. +
+ _Default:_ `true`
+
+|`requests_per_second` or `requestsPerSecond`
+|`number` - The throttle to set on this request in sub-requests per second. -1 means no throttle.
+
+|`slices`
+|`number` - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. +
+ _Default:_ `1`
+
+|`body`
+|`object` - The search definition using the Query DSL
+
+|===
+=== updateByQueryRethrottle
+[source,js]
+----
+client.updateByQueryRethrottle([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html
+[cols=2*]
+|===
+|`task_id` or `taskId`
+|`string` - The task id to rethrottle
+
+|`requests_per_second` or `requestsPerSecond`
+|`number` - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
+
+|===
+=== ccr.deleteAutoFollowPattern
+[source,js]
+----
+client.ccr.deleteAutoFollowPattern([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html
+[cols=2*]
+|===
+|`name`
+|`string` - The name of the auto follow pattern.
+
+|===
+=== ccr.follow
+[source,js]
+----
+client.ccr.follow([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the follower index
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - 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) +
+ _Default:_ `0`
+
+|`body`
+|`object` - The name of the leader index and other optional ccr related parameters
+
+|===
+=== ccr.followInfo
+[source,js]
+----
+client.ccr.followInfo([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
+
+|===
+=== ccr.followStats
+[source,js]
+----
+client.ccr.followStats([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
+
+|===
+=== ccr.getAutoFollowPattern
+[source,js]
+----
+client.ccr.getAutoFollowPattern([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html
+[cols=2*]
+|===
+|`name`
+|`string` - The name of the auto follow pattern.
+
+|===
+=== ccr.pauseFollow
+[source,js]
+----
+client.ccr.pauseFollow([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the follower index that should pause following its leader index.
+
+|===
+=== ccr.putAutoFollowPattern
+[source,js]
+----
+client.ccr.putAutoFollowPattern([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html
+[cols=2*]
+|===
+|`name`
+|`string` - The name of the auto follow pattern.
+
+|`body`
+|`object` - The specification of the auto follow pattern
+
+|===
+=== ccr.resumeFollow
+[source,js]
+----
+client.ccr.resumeFollow([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the follow index to resume following.
+
+|`body`
+|`object` - The name of the leader index and other optional ccr related parameters
+
+|===
+=== ccr.stats
+[source,js]
+----
+client.ccr.stats([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html
+[cols=2*]
+|===
+|===
+=== ccr.unfollow
+[source,js]
+----
+client.ccr.unfollow([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the follower index that should be turned into a regular index.
+
+|===
+=== ilm.deleteLifecycle
+[source,js]
+----
+client.ilm.deleteLifecycle([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html
+[cols=2*]
+|===
+|`policy`
+|`string` - The name of the index lifecycle policy
+
+|===
+=== ilm.explainLifecycle
+[source,js]
+----
+client.ilm.explainLifecycle([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the index to explain
+
+|`human`
+|`boolean` - Return data such as dates in a human readable format +
+ _Default:_ `false`
+
+|===
+=== ilm.getLifecycle
+[source,js]
+----
+client.ilm.getLifecycle([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html
+[cols=2*]
+|===
+|`policy`
+|`string` - The name of the index lifecycle policy
+
+|===
+=== ilm.getStatus
+[source,js]
+----
+client.ilm.getStatus([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html
+[cols=2*]
+|===
+|===
+=== ilm.moveToStep
+[source,js]
+----
+client.ilm.moveToStep([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the index whose lifecycle step is to change
+
+|`body`
+|`object` - The new lifecycle step to move to
+
+|===
+=== ilm.putLifecycle
+[source,js]
+----
+client.ilm.putLifecycle([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html
+[cols=2*]
+|===
+|`policy`
+|`string` - The name of the index lifecycle policy
+
+|`body`
+|`object` - The lifecycle policy definition to register
+
+|===
+=== ilm.removePolicy
+[source,js]
+----
+client.ilm.removePolicy([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the index to remove policy on
+
+|===
+=== ilm.retry
+[source,js]
+----
+client.ilm.retry([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the indices (comma-separated) whose failed lifecycle step is to be retry
+
+|===
+=== ilm.start
+[source,js]
+----
+client.ilm.start([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html
+[cols=2*]
+|===
+|===
+=== ilm.stop
+[source,js]
+----
+client.ilm.stop([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html
+[cols=2*]
+|===
+|===
+=== indices.freeze
+[source,js]
+----
+client.indices.freeze([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the index to freeze
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `closed`
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of active shards to wait for before the operation returns.
+
+|===
+=== indices.unfreeze
+[source,js]
+----
+client.indices.unfreeze([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the index to unfreeze
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for connection to master
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `closed`
+
+|`wait_for_active_shards` or `waitForActiveShards`
+|`string` - Sets the number of active shards to wait for before the operation returns.
+
+|===
+=== ml.closeJob
+[source,js]
+----
+client.ml.closeJob([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The name of the job to close
+
+|`allow_no_jobs` or `allowNoJobs`
+|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
+
+|`force`
+|`boolean` - True if the job should be forcefully closed
+
+|`timeout`
+|`string` - Controls the time to wait until a job has closed. Default to 30 minutes
+
+|`body`
+|`object` - The URL params optionally sent in the body
+
+|===
+=== ml.deleteCalendar
+[source,js]
+----
+client.ml.deleteCalendar([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`calendar_id` or `calendarId`
+|`string` - The ID of the calendar to delete
+
+|===
+=== ml.deleteCalendarEvent
+[source,js]
+----
+client.ml.deleteCalendarEvent([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`calendar_id` or `calendarId`
+|`string` - The ID of the calendar to modify
+
+|`event_id` or `eventId`
+|`string` - The ID of the event to remove from the calendar
+
+|===
+=== ml.deleteCalendarJob
+[source,js]
+----
+client.ml.deleteCalendarJob([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`calendar_id` or `calendarId`
+|`string` - The ID of the calendar to modify
+
+|`job_id` or `jobId`
+|`string` - The ID of the job to remove from the calendar
+
+|===
+=== ml.deleteDatafeed
+[source,js]
+----
+client.ml.deleteDatafeed([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html
+[cols=2*]
+|===
+|`datafeed_id` or `datafeedId`
+|`string` - The ID of the datafeed to delete
+
+|`force`
+|`boolean` - True if the datafeed should be forcefully deleted
+
+|===
+=== ml.deleteExpiredData
+[source,js]
+----
+client.ml.deleteExpiredData([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|===
+=== ml.deleteFilter
+[source,js]
+----
+client.ml.deleteFilter([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`filter_id` or `filterId`
+|`string` - The ID of the filter to delete
+
+|===
+=== ml.deleteForecast
+[source,js]
+----
+client.ml.deleteForecast([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job from which to delete forecasts
+
+|`forecast_id` or `forecastId`
+|`string` - The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all`
+
+|`allow_no_forecasts` or `allowNoForecasts`
+|`boolean` - Whether to ignore if `_all` matches no forecasts
+
+|`timeout`
+|`string` - Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds
+
+|===
+=== ml.deleteJob
+[source,js]
+----
+client.ml.deleteJob([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job to delete
+
+|`force`
+|`boolean` - True if the job should be forcefully deleted
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Should this request wait until the operation has completed before returning +
+ _Default:_ `true`
+
+|===
+=== ml.deleteModelSnapshot
+[source,js]
+----
+client.ml.deleteModelSnapshot([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job to fetch
+
+|`snapshot_id` or `snapshotId`
+|`string` - The ID of the snapshot to delete
+
+|===
+=== ml.findFileStructure
+[source,js]
+----
+client.ml.findFileStructure([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html
+[cols=2*]
+|===
+|`lines_to_sample` or `linesToSample`
+|`number` - How many lines of the file should be included in the analysis +
+ _Default:_ `1000`
+
+|`timeout`
+|`string` - Timeout after which the analysis will be aborted +
+ _Default:_ `25s`
+
+|`charset`
+|`string` - Optional parameter to specify the character set of the file
+
+|`format`
+|`'ndjson', 'xml', 'delimited', 'semi_structured_text'` - Optional parameter to specify the high level file format
+
+|`has_header_row` or `hasHeaderRow`
+|`boolean` - Optional parameter to specify whether a delimited file includes the column names in its first row
+
+|`column_names` or `columnNames`
+|`string, string[]` - Optional parameter containing a comma separated list of the column names for a delimited file
+
+|`delimiter`
+|`string` - Optional parameter to specify the delimiter character for a delimited file - must be a single character
+
+|`quote`
+|`string` - Optional parameter to specify the quote character for a delimited file - must be a single character
+
+|`should_trim_fields` or `shouldTrimFields`
+|`boolean` - Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them
+
+|`grok_pattern` or `grokPattern`
+|`string` - Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file
+
+|`timestamp_field` or `timestampField`
+|`string` - Optional parameter to specify the timestamp field in the file
+
+|`timestamp_format` or `timestampFormat`
+|`string` - Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format
+
+|`explain`
+|`boolean` - Whether to include a commentary on how the structure was derived
+
+|`body`
+|`object` - The contents of the file to be analyzed
+
+|===
+=== ml.flushJob
+[source,js]
+----
+client.ml.flushJob([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The name of the job to flush
+
+|`calc_interim` or `calcInterim`
+|`boolean` - Calculates interim results for the most recent bucket or all buckets within the latency period
+
+|`start`
+|`string` - When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results
+
+|`end`
+|`string` - When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results
+
+|`advance_time` or `advanceTime`
+|`string` - Advances time to the given value generating results and updating the model for the advanced interval
+
+|`skip_time` or `skipTime`
+|`string` - Skips time to the given value without generating results or updating the model for the skipped interval
+
+|`body`
+|`object` - Flush parameters
+
+|===
+=== ml.forecast
+[source,js]
+----
+client.ml.forecast([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job to forecast for
+
+|`duration`
+|`string` - The duration of the forecast
+
+|`expires_in` or `expiresIn`
+|`string` - The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity.
+
+|===
+=== ml.getBuckets
+[source,js]
+----
+client.ml.getBuckets([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - ID of the job to get bucket results from
+
+|`timestamp`
+|`string` - The timestamp of the desired single bucket result
+
+|`expand`
+|`boolean` - Include anomaly records
+
+|`exclude_interim` or `excludeInterim`
+|`boolean` - Exclude interim results
+
+|`from`
+|`number` - skips a number of buckets
+
+|`size`
+|`number` - specifies a max number of buckets to get
+
+|`start`
+|`string` - Start time filter for buckets
+
+|`end`
+|`string` - End time filter for buckets
+
+|`anomaly_score` or `anomalyScore`
+|`number` - Filter for the most anomalous buckets
+
+|`sort`
+|`string` - Sort buckets by a particular field
+
+|`desc`
+|`boolean` - Set the sort direction
+
+|`body`
+|`object` - Bucket selection details if not provided in URI
+
+|===
+=== ml.getCalendarEvents
+[source,js]
+----
+client.ml.getCalendarEvents([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`calendar_id` or `calendarId`
+|`string` - The ID of the calendar containing the events
+
+|`job_id` or `jobId`
+|`string` - Get events for the job. When this option is used calendar_id must be '_all'
+
+|`start`
+|`string` - Get events after this time
+
+|`end`
+|`string` - Get events before this time
+
+|`from`
+|`number` - Skips a number of events
+
+|`size`
+|`number` - Specifies a max number of events to get
+
+|===
+=== ml.getCalendars
+[source,js]
+----
+client.ml.getCalendars([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`calendar_id` or `calendarId`
+|`string` - The ID of the calendar to fetch
+
+|`from`
+|`number` - skips a number of calendars
+
+|`size`
+|`number` - specifies a max number of calendars to get
+
+|===
+=== ml.getCategories
+[source,js]
+----
+client.ml.getCategories([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The name of the job
+
+|`category_id` or `categoryId`
+|`number` - The identifier of the category definition of interest
+
+|`from`
+|`number` - skips a number of categories
+
+|`size`
+|`number` - specifies a max number of categories to get
+
+|`body`
+|`object` - Category selection details if not provided in URI
+
+|===
+=== ml.getDatafeedStats
+[source,js]
+----
+client.ml.getDatafeedStats([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html
+[cols=2*]
+|===
+|`datafeed_id` or `datafeedId`
+|`string` - The ID of the datafeeds stats to fetch
+
+|`allow_no_datafeeds` or `allowNoDatafeeds`
+|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
+
+|===
+=== ml.getDatafeeds
+[source,js]
+----
+client.ml.getDatafeeds([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html
+[cols=2*]
+|===
+|`datafeed_id` or `datafeedId`
+|`string` - The ID of the datafeeds to fetch
+
+|`allow_no_datafeeds` or `allowNoDatafeeds`
+|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
+
+|===
+=== ml.getFilters
+[source,js]
+----
+client.ml.getFilters([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`filter_id` or `filterId`
+|`string` - The ID of the filter to fetch
+
+|`from`
+|`number` - skips a number of filters
+
+|`size`
+|`number` - specifies a max number of filters to get
+
+|===
+=== ml.getInfluencers
+[source,js]
+----
+client.ml.getInfluencers([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - undefined
+
+|`exclude_interim` or `excludeInterim`
+|`boolean` - Exclude interim results
+
+|`from`
+|`number` - skips a number of influencers
+
+|`size`
+|`number` - specifies a max number of influencers to get
+
+|`start`
+|`string` - start timestamp for the requested influencers
+
+|`end`
+|`string` - end timestamp for the requested influencers
+
+|`influencer_score` or `influencerScore`
+|`number` - influencer score threshold for the requested influencers
+
+|`sort`
+|`string` - sort field for the requested influencers
+
+|`desc`
+|`boolean` - whether the results should be sorted in decending order
+
+|`body`
+|`object` - Influencer selection criteria
+
+|===
+=== ml.getJobStats
+[source,js]
+----
+client.ml.getJobStats([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the jobs stats to fetch
+
+|`allow_no_jobs` or `allowNoJobs`
+|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
+
+|===
+=== ml.getJobs
+[source,js]
+----
+client.ml.getJobs([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the jobs to fetch
+
+|`allow_no_jobs` or `allowNoJobs`
+|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
+
+|===
+=== ml.getModelSnapshots
+[source,js]
+----
+client.ml.getModelSnapshots([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job to fetch
+
+|`snapshot_id` or `snapshotId`
+|`string` - The ID of the snapshot to fetch
+
+|`from`
+|`number` - Skips a number of documents
+
+|`size`
+|`number` - The default number of documents returned in queries as a string.
+
+|`start`
+|`string` - The filter 'start' query parameter
+
+|`end`
+|`string` - The filter 'end' query parameter
+
+|`sort`
+|`string` - Name of the field to sort on
+
+|`desc`
+|`boolean` - True if the results should be sorted in descending order
+
+|`body`
+|`object` - Model snapshot selection criteria
+
+|===
+=== ml.getOverallBuckets
+[source,js]
+----
+client.ml.getOverallBuckets([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The job IDs for which to calculate overall bucket results
+
+|`top_n` or `topN`
+|`number` - The number of top job bucket scores to be used in the overall_score calculation
+
+|`bucket_span` or `bucketSpan`
+|`string` - The span of the overall buckets. Defaults to the longest job bucket_span
+
+|`overall_score` or `overallScore`
+|`number` - Returns overall buckets with overall scores higher than this value
+
+|`exclude_interim` or `excludeInterim`
+|`boolean` - If true overall buckets that include interim buckets will be excluded
+
+|`start`
+|`string` - Returns overall buckets with timestamps after this time
+
+|`end`
+|`string` - Returns overall buckets with timestamps earlier than this time
+
+|`allow_no_jobs` or `allowNoJobs`
+|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
+
+|`body`
+|`object` - Overall bucket selection details if not provided in URI
+
+|===
+=== ml.getRecords
+[source,js]
+----
+client.ml.getRecords([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - undefined
+
+|`exclude_interim` or `excludeInterim`
+|`boolean` - Exclude interim results
+
+|`from`
+|`number` - skips a number of records
+
+|`size`
+|`number` - specifies a max number of records to get
+
+|`start`
+|`string` - Start time filter for records
+
+|`end`
+|`string` - End time filter for records
+
+|`record_score` or `recordScore`
+|`number` - undefined
+
+|`sort`
+|`string` - Sort records by a particular field
+
+|`desc`
+|`boolean` - Set the sort direction
+
+|`body`
+|`object` - Record selection criteria
+
+|===
+=== ml.info
+[source,js]
+----
+client.ml.info([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|===
+=== ml.openJob
+[source,js]
+----
+client.ml.openJob([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job to open
+
+|`ignore_downtime` or `ignoreDowntime`
+|`boolean` - Controls if gaps in data are treated as anomalous or as a maintenance window after a job re-start
+
+|`timeout`
+|`string` - Controls the time to wait until a job has opened. Default to 30 minutes
+
+|===
+=== ml.postCalendarEvents
+[source,js]
+----
+client.ml.postCalendarEvents([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`calendar_id` or `calendarId`
+|`string` - The ID of the calendar to modify
+
+|`body`
+|`object` - A list of events
+
+|===
+=== ml.postData
+[source,js]
+----
+client.ml.postData([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The name of the job receiving the data
+
+|`reset_start` or `resetStart`
+|`string` - Optional parameter to specify the start of the bucket resetting range
+
+|`reset_end` or `resetEnd`
+|`string` - Optional parameter to specify the end of the bucket resetting range
+
+|`body`
+|`object` - The data to process
+
+|===
+=== ml.previewDatafeed
+[source,js]
+----
+client.ml.previewDatafeed([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html
+[cols=2*]
+|===
+|`datafeed_id` or `datafeedId`
+|`string` - The ID of the datafeed to preview
+
+|===
+=== ml.putCalendar
+[source,js]
+----
+client.ml.putCalendar([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`calendar_id` or `calendarId`
+|`string` - The ID of the calendar to create
+
+|`body`
+|`object` - The calendar details
+
+|===
+=== ml.putCalendarJob
+[source,js]
+----
+client.ml.putCalendarJob([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`calendar_id` or `calendarId`
+|`string` - The ID of the calendar to modify
+
+|`job_id` or `jobId`
+|`string` - The ID of the job to add to the calendar
+
+|===
+=== ml.putDatafeed
+[source,js]
+----
+client.ml.putDatafeed([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html
+[cols=2*]
+|===
+|`datafeed_id` or `datafeedId`
+|`string` - The ID of the datafeed to create
+
+|`body`
+|`object` - The datafeed config
+
+|===
+=== ml.putFilter
+[source,js]
+----
+client.ml.putFilter([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`filter_id` or `filterId`
+|`string` - The ID of the filter to create
+
+|`body`
+|`object` - The filter details
+
+|===
+=== ml.putJob
+[source,js]
+----
+client.ml.putJob([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job to create
+
+|`body`
+|`object` - The job
+
+|===
+=== ml.revertModelSnapshot
+[source,js]
+----
+client.ml.revertModelSnapshot([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job to fetch
+
+|`snapshot_id` or `snapshotId`
+|`string` - The ID of the snapshot to revert to
+
+|`delete_intervening_results` or `deleteInterveningResults`
+|`boolean` - Should we reset the results back to the time of the snapshot?
+
+|`body`
+|`object` - Reversion options
+
+|===
+=== ml.setUpgradeMode
+[source,js]
+----
+client.ml.setUpgradeMode([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html
+[cols=2*]
+|===
+|`enabled`
+|`boolean` - Whether to enable upgrade_mode ML setting or not. Defaults to false.
+
+|`timeout`
+|`string` - Controls the time to wait before action times out. Defaults to 30 seconds
+
+|===
+=== ml.startDatafeed
+[source,js]
+----
+client.ml.startDatafeed([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html
+[cols=2*]
+|===
+|`datafeed_id` or `datafeedId`
+|`string` - The ID of the datafeed to start
+
+|`start`
+|`string` - The start time from where the datafeed should begin
+
+|`end`
+|`string` - The end time when the datafeed should stop. When not set, the datafeed continues in real time
+
+|`timeout`
+|`string` - Controls the time to wait until a datafeed has started. Default to 20 seconds
+
+|`body`
+|`object` - The start datafeed parameters
+
+|===
+=== ml.stopDatafeed
+[source,js]
+----
+client.ml.stopDatafeed([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html
+[cols=2*]
+|===
+|`datafeed_id` or `datafeedId`
+|`string` - The ID of the datafeed to stop
+
+|`allow_no_datafeeds` or `allowNoDatafeeds`
+|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
+
+|`force`
+|`boolean` - True if the datafeed should be forcefully stopped.
+
+|`timeout`
+|`string` - Controls the time to wait until a datafeed has stopped. Default to 20 seconds
+
+|===
+=== ml.updateDatafeed
+[source,js]
+----
+client.ml.updateDatafeed([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html
+[cols=2*]
+|===
+|`datafeed_id` or `datafeedId`
+|`string` - The ID of the datafeed to update
+
+|`body`
+|`object` - The datafeed update settings
+
+|===
+=== ml.updateFilter
+[source,js]
+----
+client.ml.updateFilter([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`filter_id` or `filterId`
+|`string` - The ID of the filter to update
+
+|`body`
+|`object` - The filter update
+
+|===
+=== ml.updateJob
+[source,js]
+----
+client.ml.updateJob([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job to create
+
+|`body`
+|`object` - The job update settings
+
+|===
+=== ml.updateModelSnapshot
+[source,js]
+----
+client.ml.updateModelSnapshot([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html
+[cols=2*]
+|===
+|`job_id` or `jobId`
+|`string` - The ID of the job to fetch
+
+|`snapshot_id` or `snapshotId`
+|`string` - The ID of the snapshot to update
+
+|`body`
+|`object` - The model snapshot properties to update
+
+|===
+=== ml.validate
+[source,js]
+----
+client.ml.validate([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`body`
+|`object` - The job config
+
+|===
+=== ml.validateDetector
+[source,js]
+----
+client.ml.validateDetector([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`body`
+|`object` - The detector
+
+|===
+=== monitoring.bulk
+[source,js]
+----
+client.monitoring.bulk([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/monitoring/current/appendix-api-bulk.html
+[cols=2*]
+|===
+|`type`
+|`string` - Default document type for items which don't provide one
+
+|`system_id` or `systemId`
+|`string` - Identifier of the monitored system
+
+|`system_api_version` or `systemApiVersion`
+|`string` - API Version of the monitored system
+
+|`interval`
+|`string` - Collection interval (e.g., '10s' or '10000ms') of the payload
+
+|`body`
+|`object` - The operation definition and data (action-data pairs), separated by newlines
+
+|===
+=== security.authenticate
+[source,js]
+----
+client.security.authenticate([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html
+[cols=2*]
+|===
+|===
+=== security.changePassword
+[source,js]
+----
+client.security.changePassword([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html
+[cols=2*]
+|===
+|`username`
+|`string` - The username of the user to change the password for
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|`body`
+|`object` - the new password for the user
+
+|===
+=== security.clearCachedRealms
+[source,js]
+----
+client.security.clearCachedRealms([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html
+[cols=2*]
+|===
+|`realms`
+|`string, string[]` - Comma-separated list of realms to clear
+
+|`usernames`
+|`string, string[]` - Comma-separated list of usernames to clear from the cache
+
+|===
+=== security.clearCachedRoles
+[source,js]
+----
+client.security.clearCachedRoles([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html
+[cols=2*]
+|===
+|`name`
+|`string, string[]` - Role name
+
+|===
+=== security.createApiKey
+[source,js]
+----
+client.security.createApiKey([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
+[cols=2*]
+|===
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|`body`
+|`object` - The api key request to create an API key
+
+|===
+=== security.deletePrivileges
+[source,js]
+----
+client.security.deletePrivileges([params] [, options] [, callback])
+----
+TODO
+[cols=2*]
+|===
+|`application`
+|`string` - Application name
+
+|`name`
+|`string` - Privilege name
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|===
+=== security.deleteRole
+[source,js]
+----
+client.security.deleteRole([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html
+[cols=2*]
+|===
+|`name`
+|`string` - Role name
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|===
+=== security.deleteRoleMapping
+[source,js]
+----
+client.security.deleteRoleMapping([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html
+[cols=2*]
+|===
+|`name`
+|`string` - Role-mapping name
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|===
+=== security.deleteUser
+[source,js]
+----
+client.security.deleteUser([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html
+[cols=2*]
+|===
+|`username`
+|`string` - username
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|===
+=== security.disableUser
+[source,js]
+----
+client.security.disableUser([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html
+[cols=2*]
+|===
+|`username`
+|`string` - The username of the user to disable
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|===
+=== security.enableUser
+[source,js]
+----
+client.security.enableUser([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html
+[cols=2*]
+|===
+|`username`
+|`string` - The username of the user to enable
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|===
+=== security.getApiKey
+[source,js]
+----
+client.security.getApiKey([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html
+[cols=2*]
+|===
+|`id`
+|`string` - API key id of the API key to be retrieved
+
+|`name`
+|`string` - API key name of the API key to be retrieved
+
+|`username`
+|`string` - user name of the user who created this API key to be retrieved
+
+|`realm_name` or `realmName`
+|`string` - realm name of the user who created this API key to be retrieved
+
+|===
+=== security.getPrivileges
+[source,js]
+----
+client.security.getPrivileges([params] [, options] [, callback])
+----
+TODO
+[cols=2*]
+|===
+|`application`
+|`string` - Application name
+
+|`name`
+|`string` - Privilege name
+
+|===
+=== security.getRole
+[source,js]
+----
+client.security.getRole([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html
+[cols=2*]
+|===
+|`name`
+|`string` - Role name
+
+|===
+=== security.getRoleMapping
+[source,js]
+----
+client.security.getRoleMapping([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html
+[cols=2*]
+|===
+|`name`
+|`string` - Role-Mapping name
+
+|===
+=== security.getToken
+[source,js]
+----
+client.security.getToken([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html
+[cols=2*]
+|===
+|`body`
+|`object` - The token request to get
+
+|===
+=== security.getUser
+[source,js]
+----
+client.security.getUser([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html
+[cols=2*]
+|===
+|`username`
+|`string, string[]` - A comma-separated list of usernames
+
+|===
+=== security.getUserPrivileges
+[source,js]
+----
+client.security.getUserPrivileges([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html
+[cols=2*]
+|===
+|===
+=== security.hasPrivileges
+[source,js]
+----
+client.security.hasPrivileges([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html
+[cols=2*]
+|===
+|`user`
+|`string` - Username
+
+|`body`
+|`object` - The privileges to test
+
+|===
+=== security.invalidateApiKey
+[source,js]
+----
+client.security.invalidateApiKey([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html
+[cols=2*]
+|===
+|`body`
+|`object` - The api key request to invalidate API key(s)
+
+|===
+=== security.invalidateToken
+[source,js]
+----
+client.security.invalidateToken([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html
+[cols=2*]
+|===
+|`body`
+|`object` - The token to invalidate
+
+|===
+=== security.putPrivileges
+[source,js]
+----
+client.security.putPrivileges([params] [, options] [, callback])
+----
+TODO
+[cols=2*]
+|===
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|`body`
+|`object` - The privilege(s) to add
+
+|===
+=== security.putRole
+[source,js]
+----
+client.security.putRole([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html
+[cols=2*]
+|===
+|`name`
+|`string` - Role name
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|`body`
+|`object` - The role to add
+
+|===
+=== security.putRoleMapping
+[source,js]
+----
+client.security.putRoleMapping([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html
+[cols=2*]
+|===
+|`name`
+|`string` - Role-mapping name
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|`body`
+|`object` - The role to add
+
+|===
+=== security.putUser
+[source,js]
+----
+client.security.putUser([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html
+[cols=2*]
+|===
+|`username`
+|`string` - The username of the User
+
+|`refresh`
+|`'true', 'false', 'wait_for'` - If `true` (the default) 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` then do nothing with refreshes.
+
+|`body`
+|`object` - The user to add
+
+|===
+=== ssl.certificates
+[source,js]
+----
+client.ssl.certificates([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html
+[cols=2*]
+|===
+|===
+=== xpack.graph.explore
+[source,js]
+----
+client.xpack.graph.explore([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
+
+|`type`
+|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types
+
+|`routing`
+|`string` - Specific routing value
+
+|`timeout`
+|`string` - Explicit operation timeout
+
+|`body`
+|`object` - Graph Query DSL
+
+|===
+=== xpack.info
+[source,js]
+----
+client.xpack.info([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html
+[cols=2*]
+|===
+|`categories`
+|`string, string[]` - Comma-separated list of info categories. Can be any of: build, license, features
+
+|===
+=== xpack.license.delete
+[source,js]
+----
+client.xpack.license.delete([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/x-pack/current/license-management.html
+[cols=2*]
+|===
+|===
+=== xpack.license.get
+[source,js]
+----
+client.xpack.license.get([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/x-pack/current/license-management.html
+[cols=2*]
+|===
+|`local`
+|`boolean` - Return local information, do not retrieve the state from master node (default: false)
+
+|===
+=== xpack.license.getBasicStatus
+[source,js]
+----
+client.xpack.license.getBasicStatus([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/x-pack/current/license-management.html
+[cols=2*]
+|===
+|===
+=== xpack.license.getTrialStatus
+[source,js]
+----
+client.xpack.license.getTrialStatus([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/x-pack/current/license-management.html
+[cols=2*]
+|===
+|===
+=== xpack.license.post
+[source,js]
+----
+client.xpack.license.post([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/x-pack/current/license-management.html
+[cols=2*]
+|===
+|`acknowledge`
+|`boolean` - whether the user has acknowledged acknowledge messages (default: false)
+
+|`body`
+|`object` - licenses to be installed
+
+|===
+=== xpack.license.postStartBasic
+[source,js]
+----
+client.xpack.license.postStartBasic([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/x-pack/current/license-management.html
+[cols=2*]
+|===
+|`acknowledge`
+|`boolean` - whether the user has acknowledged acknowledge messages (default: false)
+
+|===
+=== xpack.license.postStartTrial
+[source,js]
+----
+client.xpack.license.postStartTrial([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/x-pack/current/license-management.html
+[cols=2*]
+|===
+|`type`
+|`string` - The type of trial license to generate (default: "trial")
+
+|`acknowledge`
+|`boolean` - whether the user has acknowledged acknowledge messages (default: false)
+
+|===
+=== xpack.migration.deprecations
+[source,js]
+----
+client.xpack.migration.deprecations([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html
+[cols=2*]
+|===
+|`index`
+|`string` - Index pattern
+
+|===
+=== xpack.migration.getAssistance
+[source,js]
+----
+client.xpack.migration.getAssistance([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html
+[cols=2*]
+|===
+|`index`
+|`string, string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
+
+|`allow_no_indices` or `allowNoIndices`
+|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+
+|`expand_wildcards` or `expandWildcards`
+|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
+ _Default:_ `open`
+
+|`ignore_unavailable` or `ignoreUnavailable`
+|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
+
+|===
+=== xpack.migration.upgrade
+[source,js]
+----
+client.xpack.migration.upgrade([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html
+[cols=2*]
+|===
+|`index`
+|`string` - The name of the index
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - Should the request block until the upgrade operation is completed +
+ _Default:_ `true`
+
+|===
+=== xpack.rollup.deleteJob
+[source,js]
+----
+client.xpack.rollup.deleteJob([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`id`
+|`string` - The ID of the job to delete
+
+|===
+=== xpack.rollup.getJobs
+[source,js]
+----
+client.xpack.rollup.getJobs([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`id`
+|`string` - The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs
+
+|===
+=== xpack.rollup.getRollupCaps
+[source,js]
+----
+client.xpack.rollup.getRollupCaps([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`id`
+|`string` - The ID of the index to check rollup capabilities on, or left blank for all jobs
+
+|===
+=== xpack.rollup.getRollupIndexCaps
+[source,js]
+----
+client.xpack.rollup.getRollupIndexCaps([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`index`
+|`string` - The rollup index or index pattern to obtain rollup capabilities from.
+
+|===
+=== xpack.rollup.putJob
+[source,js]
+----
+client.xpack.rollup.putJob([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`id`
+|`string` - The ID of the job to create
+
+|`body`
+|`object` - The job configuration
+
+|===
+=== xpack.rollup.rollupSearch
+[source,js]
+----
+client.xpack.rollup.rollupSearch([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`index`
+|`string` - The index or index-pattern (containing rollup or regular data) that should be searched
+
+|`type`
+|`string` - The doc type inside the index
+
+|`typed_keys` or `typedKeys`
+|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+
+|`rest_total_hits_as_int` or `restTotalHitsAsInt`
+|`boolean` - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
+
+|`body`
+|`object` - The search request body
+
+|===
+=== xpack.rollup.startJob
+[source,js]
+----
+client.xpack.rollup.startJob([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`id`
+|`string` - The ID of the job to start
+
+|===
+=== xpack.rollup.stopJob
+[source,js]
+----
+client.xpack.rollup.stopJob([params] [, options] [, callback])
+----
+
+[cols=2*]
+|===
+|`id`
+|`string` - The ID of the job to stop
+
+|`wait_for_completion` or `waitForCompletion`
+|`boolean` - True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false.
+
+|`timeout`
+|`string` - Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s.
+
+|===
+=== xpack.sql.clearCursor
+[source,js]
+----
+client.xpack.sql.clearCursor([params] [, options] [, callback])
+----
+Clear SQL cursor
+[cols=2*]
+|===
+|`body`
+|`object` - Specify the cursor value in the `cursor` element to clean the cursor.
+
+|===
+=== xpack.sql.query
+[source,js]
+----
+client.xpack.sql.query([params] [, options] [, callback])
+----
+Execute SQL
+[cols=2*]
+|===
+|`format`
+|`string` - a short version of the Accept header, e.g. json, yaml
+
+|`body`
+|`object` - Use the `query` element to start a query. Use the `cursor` element to continue a query.
+
+|===
+=== xpack.sql.translate
+[source,js]
+----
+client.xpack.sql.translate([params] [, options] [, callback])
+----
+Translate SQL into Elasticsearch queries
+[cols=2*]
+|===
+|`body`
+|`object` - Specify the query in the `query` element.
+
+|===
+=== xpack.usage
+[source,js]
+----
+client.xpack.usage([params] [, options] [, callback])
+----
+Retrieve information about xpack features usage
+[cols=2*]
+|===
+|`master_timeout` or `masterTimeout`
+|`string` - Specify timeout for watch write operation
+
+|===
+=== xpack.watcher.ackWatch
+[source,js]
+----
+client.xpack.watcher.ackWatch([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html
+[cols=2*]
+|===
+|`watch_id` or `watchId`
+|`string` - Watch ID
+
+|`action_id` or `actionId`
+|`string, string[]` - A comma-separated list of the action ids to be acked
+
+|===
+=== xpack.watcher.activateWatch
+[source,js]
+----
+client.xpack.watcher.activateWatch([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html
+[cols=2*]
+|===
+|`watch_id` or `watchId`
+|`string` - Watch ID
+
+|===
+=== xpack.watcher.deactivateWatch
+[source,js]
+----
+client.xpack.watcher.deactivateWatch([params] [, options] [, callback])
+----
+https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html
+[cols=2*]
+|===
+|`watch_id` or `watchId`
+|`string` - Watch ID
+
+|===
+=== xpack.watcher.deleteWatch
+[source,js]
+----
+client.xpack.watcher.deleteWatch([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html
+[cols=2*]
+|===
+|`id`
+|`string` - Watch ID
+
+|===
+=== xpack.watcher.executeWatch
+[source,js]
+----
+client.xpack.watcher.executeWatch([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html
+[cols=2*]
+|===
+|`id`
+|`string` - Watch ID
+
+|`debug`
+|`boolean` - indicates whether the watch should execute in debug mode
+
+|`body`
+|`object` - Execution control
+
+|===
+=== xpack.watcher.getWatch
+[source,js]
+----
+client.xpack.watcher.getWatch([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html
+[cols=2*]
+|===
+|`id`
+|`string` - Watch ID
+
+|===
+=== xpack.watcher.putWatch
+[source,js]
+----
+client.xpack.watcher.putWatch([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html
+[cols=2*]
+|===
+|`id`
+|`string` - Watch ID
+
+|`active`
+|`boolean` - Specify whether the watch is in/active by default
+
+|`version`
+|`number` - Explicit version number for concurrency control
+
+|`if_seq_no` or `ifSeqNo`
+|`number` - only update the watch if the last operation that has changed the watch has the specified sequence number
+
+|`if_primary_term` or `ifPrimaryTerm`
+|`number` - only update the watch if the last operation that has changed the watch has the specified primary term
+
+|`body`
+|`object` - The watch
+
+|===
+=== xpack.watcher.start
+[source,js]
+----
+client.xpack.watcher.start([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html
+[cols=2*]
+|===
+|===
+=== xpack.watcher.stats
+[source,js]
+----
+client.xpack.watcher.stats([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html
+[cols=2*]
+|===
+|`metric`
+|`'_all', 'queued_watches', 'current_watches', 'pending_watches'` - Controls what additional stat metrics should be include in the response
+
+|`metric`
+|`'_all', 'queued_watches', 'current_watches', 'pending_watches'` - Controls what additional stat metrics should be include in the response
+
+|`emit_stacktraces` or `emitStacktraces`
+|`boolean` - Emits stack traces of currently running watches
+
+|===
+=== xpack.watcher.stop
+[source,js]
+----
+client.xpack.watcher.stop([params] [, options] [, callback])
+----
+http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html
+[cols=2*]
+|===
+|===
\ No newline at end of file
diff --git a/docs/typescript.asciidoc b/docs/typescript.asciidoc
new file mode 100644
index 000000000..94148a5cd
--- /dev/null
+++ b/docs/typescript.asciidoc
@@ -0,0 +1,59 @@
+= TypeScript support
+
+The client offers a first-class support for TypeScript, since it ships the type definitions for every exposed API.
+
+While the client offers type definitions for Request parameters, Request bodies and responses are shipped with `any` because there is not an official spec that defines them, so we cannot make guarantees over them (but since they are shipped with `any`, you can easily override them with your own typing definitions).
+
+NOTE: If you are using TypeScript you will be required to use _snake_case_ style to define the API parameters instead of _camelCase_.
+
+== How to extend the provided typings?
+Extend the provided typings is very straightforward, you should declare a custom `.d.ts` file and then write inside your type extensions, following there is an example of how do it.
+[source,ts]
+----
+declare module '@elastic/elasticsearch' {
+ export interface ShardsResponse {
+ total: number;
+ successful: number;
+ failed: number;
+ skipped: number;
+ }
+
+ export interface Explanation {
+ value: number;
+ description: string;
+ details: Explanation[];
+ }
+
+ export interface SearchResponse {
+ took: number;
+ timed_out: boolean;
+ _scroll_id?: string;
+ _shards: ShardsResponse;
+ hits: {
+ total: number;
+ max_score: number;
+ hits: Array<{
+ _index: string;
+ _type: string;
+ _id: string;
+ _score: number;
+ _source: T;
+ _version?: number;
+ _explanation?: Explanation;
+ fields?: any;
+ highlight?: any;
+ inner_hits?: any;
+ matched_queries?: string[];
+ sort?: string[];
+ }>;
+ };
+ aggregations?: any;
+ }
+
+ export interface MSearchResponse {
+ responses?: Array>;
+ }
+}
+
+export {};
+----
diff --git a/docs/usage.asciidoc b/docs/usage.asciidoc
new file mode 100644
index 000000000..5ef2f63df
--- /dev/null
+++ b/docs/usage.asciidoc
@@ -0,0 +1,300 @@
+= Usage
+
+Use the client is pretty straightforward, it supports all the public APIs of Elasticsearch, and every method exposes the same signature.
+
+[source,js]
+----
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+// promise API
+const result = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+})
+
+// callback API
+client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, (err, result) => {
+ if (err) console.log(err)
+})
+----
+
+The returned value of every API call is formed as follows:
+
+[source,ts]
+----
+{
+ body: object | boolean
+ statusCode: number
+ headers: object
+ warnings: [string],
+ meta: object
+}
+----
+
+NOTE: The body will be a boolean value when using `HEAD` APIs.
+
+The above value will be returned even if there is an error during the execution of the request, this means that you can safely use the https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment[destructuring assignment].
+
+The `meta` key contains all the information regarding the request, such as attempt, options, and the connection that has been used.
+
+[source,js]
+----
+// promise API
+const { body } = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+})
+
+// callback API
+client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, (err, { body }) => {
+ if (err) console.log(err)
+})
+----
+
+=== Aborting a request
+
+When using the callback style API, the function will also return an object that allows you to abort the API request.
+
+[source,js]
+----
+// calback API
+const requesty = client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, {
+ ignore: [404],
+ maxRetries: 3
+}, (err, { body }) => {
+ if (err) console.log(err)
+})
+
+request.abort()
+----
+
+Aborting a request with the promise style API is not supported, but you can easily achieve that with convenience wrapper.
+
+[source,js]
+----
+function abortableRequest (params, options) {
+ var request = null
+ const promise = new Promise((resolve, reject) => {
+ request = client.search(params, options, (err, result) => {
+ err ? reject(err) : resolve(res)
+ })
+ })
+ return {
+ promise,
+ abort: () => request.abort()
+ }
+}
+
+const request = abortableRequest({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, {
+ ignore: [404],
+ maxRetries: 3
+})
+
+request.abort()
+// access the promise with `request.promise.[method]`
+----
+
+=== Request specific options
+If needed you can pass request specific options in a second object:
+[source,js]
+----
+// promise API
+const result = await client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, {
+ ignore: [404],
+ maxRetries: 3
+})
+
+// calback API
+client.search({
+ index: 'my-index',
+ body: { foo: 'bar' }
+}, {
+ ignore: [404],
+ maxRetries: 3
+}, (err, { body }) => {
+ if (err) console.log(err)
+})
+----
+
+The supported request specific options are:
+[cols=2*]
+|===
+|`ignore`
+|`[number]` - HTTP status codes which should not be considered errors for this request. +
+_Default:_ `null`
+
+|`requestTimeout`
+|`number` - Max request timeout for the request, it overrides the client default. +
+_Default:_ `30000`
+
+|`maxRetries`
+|`number` - Max number of retries for the request, it overrides the client default. +
+_Default:_ `3`
+
+|`compression`
+|`string, boolean` - Enables body compression for the request. +
+_Options:_ `false`, `'gzip'` +
+_Default:_ `false`
+
+|`asStream`
+|`boolean` - Instead of getting the parsed body back, you will get the raw Node.js stream of data. +
+_Default:_ `false`
+
+|`headers`
+|`object` - Custom headers for the request. +
+_Default:_ `null`
+|===
+
+=== Error handling
+The client exposes a variety of error objects, that you can use to enhance your error handling. +
+You can find all the error objects inside the `errors` key in the client.
+
+[source,js]
+----
+const { errors } = require('@elastic/elasticsearch')
+console.log(errors)
+----
+
+Following you can find the errors exported by the client.
+[cols=2*]
+|===
+|`ElasticsearchClientErrors`
+|Every error inherits from this class, it is the basic error generated by the client.
+
+|`TimeoutError`
+|Generated when a request exceeds the `requestTimeout` option.
+
+|`ConnectionError`
+|Generated when an error occurs during the reequest, it can be a connection error or a malformed stream of data.
+
+|`NoLivingConnectionsError`
+|Generated in case of all connections present in the connection pool are dead.
+
+|`SerializationError`
+|Generated if the serialization fails.
+
+|`DeserializationError`
+|Generated if the deserialization fails.
+
+|`ConfigurationError`
+|Generated if there is a malformed configuration or parameter.
+
+|`ResponseError`
+|Generated when in case of a `4xx` or `5xx` response.
+|===
+
+=== Events
+The client is an event emitter, this means that you can listen for its event and add additional logic to your code, without need to change the client internals or your normal usage. +
+You can find the events names by access the `events` key of the client.
+
+[source,js]
+----
+const { events } = require('@elastic/elasticsearch')
+console.log(events)
+----
+
+The event emitter functionality can be useful if you want to log every request, response and error that is happening during the use of the client.
+
+[source,js]
+----
+const logger = require('my-logger')()
+const { Client } = require('@elastic/elasticsearch')
+const client = new Client({ node: 'http://localhost:9200' })
+
+client.on('response', (err, req) => {
+ if (err) {
+ logger.error(err)
+ } else {
+ logger.info(req)
+ }
+})
+----
+
+The client emits the following events:
+[cols=2*]
+|===
+|`request`
+a|Emitted before to send the actual request to Elasticsearch.
+[source,js]
+----
+client.on('request', (err, req) => {
+ console.log(err, req)
+})
+----
+
+|`response`
+a|Emitted before to send the actual request to Elasticsearch.
+[source,js]
+----
+client.on('response', (err, req) => {
+ console.log(err, req)
+})
+----
+
+|`sniff`
+a|Emitted before to send the actual request to Elasticsearch.
+[source,js]
+----
+client.on('sniff', (err, req) => {
+ console.log(err, req)
+})
+----
+
+|`resurrect`
+a|Emitted before to send the actual request to Elasticsearch.
+[source,js]
+----
+client.on('resurrect', (err, req) => {
+ console.log(err, req)
+})
+----
+
+|===
+
+The values of `req` in `request`, `response` and `sniff` will be:
+[source,ts]
+----
+ body: any;
+ statusCode: number | null;
+ headers: anyObject | null;
+ warnings: string[] | null;
+ meta: {
+ request: {
+ params: TransportRequestParams;
+ options: TransportRequestOptions;
+ };
+ connection: Connection;
+ attempts: number;
+ aborted: boolean;
+ sniff?: {
+ hosts: any[];
+ reason: string;
+ };
+ };
+----
+
+While the `req` value in `resurrect` will be:
+[source,ts]
+----
+export interface ResurrectEvent {
+ strategy: string;
+ isAlive: boolean;
+ connection: Connection;
+}
+----
\ No newline at end of file
diff --git a/index.d.ts b/index.d.ts
new file mode 100644
index 000000000..dd7a4244f
--- /dev/null
+++ b/index.d.ts
@@ -0,0 +1,575 @@
+/*
+ * 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.
+ */
+
+///
+
+import { EventEmitter } from 'events';
+import { SecureContextOptions } from 'tls';
+import Transport, {
+ ApiResponse,
+ RequestEvent,
+ TransportRequestParams,
+ TransportRequestOptions,
+ nodeFilterFn,
+ nodeSelectorFn
+} from './lib/Transport';
+import Connection, { AgentOptions } from './lib/Connection';
+import ConnectionPool, { ResurrectEvent } from './lib/ConnectionPool';
+import Serializer from './lib/Serializer';
+import * as RequestParams from './api/requestParams';
+import * as errors from './lib/errors';
+
+declare type anyObject = {
+ [key: string]: any;
+};
+declare type callbackFn = (err: Error | null, result: ApiResponse) => void;
+
+interface ApiMethod {
+ (callback?: callbackFn): any;
+ (params: T, callback?: callbackFn): any;
+ (params: T, options: TransportRequestOptions, callback?: callbackFn): any;
+}
+
+// Extend API
+interface ClientExtendsCallbackOptions {
+ ConfigurationError: errors.ConfigurationError,
+ makeRequest(params: TransportRequestParams, options?: TransportRequestOptions): Promise | void;
+ result: {
+ body: null,
+ statusCode: null,
+ headers: null,
+ warnings: null
+ }
+}
+declare type extendsCallback = (options: ClientExtendsCallbackOptions) => any;
+interface ClientExtends {
+ (method: string, fn: extendsCallback): void;
+ (method: string, opts: { force: boolean }, fn: extendsCallback): void;
+}
+// /Extend API
+
+interface ClientOptions {
+ node?: string | string[];
+ nodes?: string | string[];
+ Connection?: typeof Connection;
+ ConnectionPool?: typeof ConnectionPool;
+ Transport?: typeof Transport;
+ Serializer?: typeof Serializer;
+ maxRetries?: number;
+ requestTimeout?: number;
+ pingTimeout?: number;
+ sniffInterval?: number;
+ sniffOnStart?: boolean;
+ sniffEndpoint?: string;
+ sniffOnConnectionFault?: boolean;
+ resurrectStrategy?: 'ping' | 'optimistic' | 'none';
+ suggestCompression?: boolean;
+ compression?: 'gzip';
+ ssl?: SecureContextOptions;
+ agent?: AgentOptions;
+ nodeFilter?: nodeFilterFn;
+ nodeSelector?: nodeSelectorFn | string;
+ headers?: anyObject;
+ cloud?: {
+ id: string;
+ username: string;
+ password: string;
+ }
+}
+
+declare class Client extends EventEmitter {
+ constructor(opts?: ClientOptions);
+ connectionPool: ConnectionPool;
+ transport: Transport;
+ serializer: Serializer;
+ extend: ClientExtends;
+ child(opts?: ClientOptions): Client;
+ close(callback?: Function): Promise | void;
+ bulk: ApiMethod
+ cat: {
+ aliases: ApiMethod
+ allocation: ApiMethod
+ count: ApiMethod
+ fielddata: ApiMethod
+ health: ApiMethod
+ help: ApiMethod
+ indices: ApiMethod
+ master: ApiMethod
+ nodeattrs: ApiMethod
+ nodes: ApiMethod
+ pending_tasks: ApiMethod
+ pendingTasks: ApiMethod
+ plugins: ApiMethod
+ recovery: ApiMethod
+ repositories: ApiMethod
+ segments: ApiMethod
+ shards: ApiMethod
+ snapshots: ApiMethod
+ tasks: ApiMethod
+ templates: ApiMethod
+ thread_pool: ApiMethod
+ threadPool: ApiMethod
+ }
+ ccr: {
+ delete_auto_follow_pattern: ApiMethod
+ deleteAutoFollowPattern: ApiMethod
+ follow: ApiMethod
+ follow_info: ApiMethod
+ followInfo: ApiMethod
+ follow_stats: ApiMethod
+ followStats: ApiMethod
+ get_auto_follow_pattern: ApiMethod
+ getAutoFollowPattern: ApiMethod
+ pause_follow: ApiMethod
+ pauseFollow: ApiMethod
+ put_auto_follow_pattern: ApiMethod
+ putAutoFollowPattern: ApiMethod
+ resume_follow: ApiMethod
+ resumeFollow: ApiMethod
+ stats: ApiMethod
+ unfollow: ApiMethod
+ }
+ clear_scroll: ApiMethod
+ clearScroll: ApiMethod
+ cluster: {
+ allocation_explain: ApiMethod
+ allocationExplain: ApiMethod
+ get_settings: ApiMethod
+ getSettings: ApiMethod
+ health: ApiMethod
+ pending_tasks: ApiMethod
+ pendingTasks: ApiMethod
+ put_settings: ApiMethod
+ putSettings: ApiMethod
+ remote_info: ApiMethod
+ remoteInfo: ApiMethod
+ reroute: ApiMethod
+ state: ApiMethod
+ stats: ApiMethod
+ }
+ count: ApiMethod
+ create: ApiMethod
+ delete: ApiMethod
+ delete_by_query: ApiMethod
+ deleteByQuery: ApiMethod
+ delete_by_query_rethrottle: ApiMethod
+ deleteByQueryRethrottle: ApiMethod
+ delete_script: ApiMethod
+ deleteScript: ApiMethod
+ exists: ApiMethod
+ exists_source: ApiMethod
+ existsSource: ApiMethod
+ explain: ApiMethod
+ field_caps: ApiMethod
+ fieldCaps: ApiMethod
+ get: ApiMethod
+ get_script: ApiMethod
+ getScript: ApiMethod
+ get_source: ApiMethod
+ getSource: ApiMethod
+ ilm: {
+ delete_lifecycle: ApiMethod
+ deleteLifecycle: ApiMethod
+ explain_lifecycle: ApiMethod
+ explainLifecycle: ApiMethod
+ get_lifecycle: ApiMethod
+ getLifecycle: ApiMethod
+ get_status: ApiMethod
+ getStatus: ApiMethod
+ move_to_step: ApiMethod
+ moveToStep: ApiMethod
+ put_lifecycle: ApiMethod
+ putLifecycle: ApiMethod
+ remove_policy: ApiMethod
+ removePolicy: ApiMethod
+ retry: ApiMethod
+ start: ApiMethod
+ stop: ApiMethod
+ }
+ index: ApiMethod
+ indices: {
+ analyze: ApiMethod
+ clear_cache: ApiMethod
+ clearCache: ApiMethod
+ close: ApiMethod
+ create: ApiMethod
+ delete: ApiMethod
+ delete_alias: ApiMethod
+ deleteAlias: ApiMethod
+ delete_template: ApiMethod
+ deleteTemplate: ApiMethod
+ exists: ApiMethod
+ exists_alias: ApiMethod
+ existsAlias: ApiMethod
+ exists_template: ApiMethod
+ existsTemplate: ApiMethod
+ exists_type: ApiMethod
+ existsType: ApiMethod
+ flush: ApiMethod
+ flush_synced: ApiMethod
+ flushSynced: ApiMethod
+ forcemerge: ApiMethod
+ freeze: ApiMethod
+ get: ApiMethod
+ get_alias: ApiMethod
+ getAlias: ApiMethod
+ get_field_mapping: ApiMethod
+ getFieldMapping: ApiMethod
+ get_mapping: ApiMethod
+ getMapping: ApiMethod
+ get_settings: ApiMethod
+ getSettings: ApiMethod
+ get_template: ApiMethod
+ getTemplate: ApiMethod
+ get_upgrade: ApiMethod
+ getUpgrade: ApiMethod
+ open: ApiMethod
+ put_alias: ApiMethod
+ putAlias: ApiMethod
+ put_mapping: ApiMethod
+ putMapping: ApiMethod
+ put_settings: ApiMethod
+ putSettings: ApiMethod
+ put_template: ApiMethod
+ putTemplate: ApiMethod
+ recovery: ApiMethod
+ refresh: ApiMethod
+ rollover: ApiMethod
+ segments: ApiMethod
+ shard_stores: ApiMethod
+ shardStores: ApiMethod
+ shrink: ApiMethod
+ split: ApiMethod
+ stats: ApiMethod
+ unfreeze: ApiMethod
+ update_aliases: ApiMethod
+ updateAliases: ApiMethod
+ upgrade: ApiMethod
+ validate_query: ApiMethod
+ validateQuery: ApiMethod
+ }
+ info: ApiMethod
+ ingest: {
+ delete_pipeline: ApiMethod
+ deletePipeline: ApiMethod
+ get_pipeline: ApiMethod
+ getPipeline: ApiMethod
+ processor_grok: ApiMethod
+ processorGrok: ApiMethod
+ put_pipeline: ApiMethod
+ putPipeline: ApiMethod
+ simulate: ApiMethod
+ }
+ mget: ApiMethod
+ ml: {
+ close_job: ApiMethod
+ closeJob: ApiMethod
+ delete_calendar: ApiMethod
+ deleteCalendar: ApiMethod
+ delete_calendar_event: ApiMethod
+ deleteCalendarEvent: ApiMethod
+ delete_calendar_job: ApiMethod
+ deleteCalendarJob: ApiMethod
+ delete_datafeed: ApiMethod
+ deleteDatafeed: ApiMethod
+ delete_expired_data: ApiMethod
+ deleteExpiredData: ApiMethod
+ delete_filter: ApiMethod
+ deleteFilter: ApiMethod
+ delete_forecast: ApiMethod
+ deleteForecast: ApiMethod
+ delete_job: ApiMethod
+ deleteJob: ApiMethod
+ delete_model_snapshot: ApiMethod
+ deleteModelSnapshot: ApiMethod
+ find_file_structure: ApiMethod
+ findFileStructure: ApiMethod
+ flush_job: ApiMethod
+ flushJob: ApiMethod
+ forecast: ApiMethod
+ get_buckets: ApiMethod
+ getBuckets: ApiMethod
+ get_calendar_events: ApiMethod
+ getCalendarEvents: ApiMethod
+ get_calendars: ApiMethod
+ getCalendars: ApiMethod
+ get_categories: ApiMethod
+ getCategories: ApiMethod
+ get_datafeed_stats: ApiMethod
+ getDatafeedStats: ApiMethod
+ get_datafeeds: ApiMethod
+ getDatafeeds: ApiMethod
+ get_filters: ApiMethod
+ getFilters: ApiMethod
+ get_influencers: ApiMethod
+ getInfluencers: ApiMethod
+ get_job_stats: ApiMethod
+ getJobStats: ApiMethod
+ get_jobs: ApiMethod
+ getJobs: ApiMethod
+ get_model_snapshots: ApiMethod
+ getModelSnapshots: ApiMethod
+ get_overall_buckets: ApiMethod
+ getOverallBuckets: ApiMethod
+ get_records: ApiMethod
+ getRecords: ApiMethod
+ info: ApiMethod
+ open_job: ApiMethod
+ openJob: ApiMethod
+ post_calendar_events: ApiMethod
+ postCalendarEvents: ApiMethod
+ post_data: ApiMethod
+ postData: ApiMethod
+ preview_datafeed: ApiMethod
+ previewDatafeed: ApiMethod
+ put_calendar: ApiMethod
+ putCalendar: ApiMethod
+ put_calendar_job: ApiMethod
+ putCalendarJob: ApiMethod
+ put_datafeed: ApiMethod
+ putDatafeed: ApiMethod
+ put_filter: ApiMethod
+ putFilter: ApiMethod
+ put_job: ApiMethod
+ putJob: ApiMethod
+ revert_model_snapshot: ApiMethod
+ revertModelSnapshot: ApiMethod
+ set_upgrade_mode: ApiMethod