Compare commits
131 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b390193dcc | |||
| df76154388 | |||
| 3e2a823a72 | |||
| 8a1bb2665e | |||
| 3acee8b266 | |||
| 60a1f298d7 | |||
| e7c40dd459 | |||
| 86361daea5 | |||
| 09c2ff8bf3 | |||
| 75d85cae19 | |||
| e30079f64d | |||
| 610bf851d2 | |||
| b91ff8a6cc | |||
| b39f29b2b0 | |||
| ef69bbd216 | |||
| 6194119e62 | |||
| a4bff1c2f0 | |||
| 8e86450aeb | |||
| 90be646658 | |||
| af8bef4892 | |||
| 2504563480 | |||
| 1e55d2a099 | |||
| 23fbc15e1a | |||
| 5b12e8a123 | |||
| c65119bd53 | |||
| 708f9abe3e | |||
| a55856c60b | |||
| 126c277496 | |||
| 23341d5f2a | |||
| c3993f9145 | |||
| c7dd19bfcf | |||
| a018d49442 | |||
| f2a0abf76a | |||
| 85731864bf | |||
| f6abf6e093 | |||
| d7fc4f7b03 | |||
| a9c054ff21 | |||
| 1810f5f0c3 | |||
| edfa527d2d | |||
| 05921b134d | |||
| aadf44bbf2 | |||
| bef1604a8d | |||
| 87fb0a2996 | |||
| 456fc19c94 | |||
| 4c118b9f9a | |||
| dc5c041b07 | |||
| 6774560444 | |||
| 3f1a15bc4e | |||
| 06b3a1ceb7 | |||
| a83cf7b26f | |||
| 30c3afe150 | |||
| 0efa0df934 | |||
| b2fbcfd8e2 | |||
| cfcff78a7e | |||
| bf482cf269 | |||
| f9e2d5f708 | |||
| ed8adba2ab | |||
| 098aef0a58 | |||
| 6d5b5f6af3 | |||
| 02ad9a9759 | |||
| 965536b369 | |||
| 5c144154ad | |||
| a52cf6be38 | |||
| c91ceb12d8 | |||
| c1eadd6e88 | |||
| d080f1bdad | |||
| 14fc908d4b | |||
| 7d810f8110 | |||
| 962e26f791 | |||
| ee36f7b43f | |||
| 8a85738258 | |||
| d06f67d881 | |||
| c67a5dfdc2 | |||
| 885147b889 | |||
| 3c99839e4a | |||
| 24da41e994 | |||
| 662e4d5ca7 | |||
| 1afa23b11d | |||
| 48c6ad15a6 | |||
| 48233503f7 | |||
| 11c7475566 | |||
| e530ed2313 | |||
| 59b9403fdc | |||
| 01ab682fb7 | |||
| b11e7ffc9f | |||
| 11da9a4650 | |||
| 352a2c3652 | |||
| 5ce9f55481 | |||
| e7f7993407 | |||
| baac03846e | |||
| 41050f23f5 | |||
| 2daa6d35c6 | |||
| 9bcfc08b20 | |||
| 45744762d3 | |||
| 516139c48e | |||
| 29091da864 | |||
| 4346bfd9a0 | |||
| ef2b025489 | |||
| 12101dc1ae | |||
| 1325471c45 | |||
| 59f88c22f9 | |||
| 8f131d5a6d | |||
| 81e09a71c2 | |||
| 41fa164611 | |||
| 9fa31a96c6 | |||
| eb95d6bda1 | |||
| 69844fa93f | |||
| 203e11f2f8 | |||
| 10d660c6dc | |||
| fcad02768b | |||
| 5cb51850c9 | |||
| a35c6e97b7 | |||
| 17fc9fb38e | |||
| dc5102d30b | |||
| 4d551319dd | |||
| 1acfd1b895 | |||
| 2458bb5721 | |||
| 5d8b2b0c26 | |||
| d5256e2fc1 | |||
| 55fd03942f | |||
| ead63b9e6d | |||
| 284a9deac7 | |||
| 3faac68c5b | |||
| 9bb4083a6e | |||
| 02299f7ec1 | |||
| a8c19984d6 | |||
| 0b739ea23c | |||
| 5c51bf7128 | |||
| 51ef62b4f1 | |||
| 5030efd2d0 | |||
| dd9707e42e |
94
.ci/docker-compose.yml
Normal file
94
.ci/docker-compose.yml
Normal file
@ -0,0 +1,94 @@
|
||||
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}
|
||||
CODECOV_TOKEN: ${CODECOV_TOKEN}
|
||||
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-oss:${ELASTICSEARCH_VERSION:-6.6.2}
|
||||
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
|
||||
# there is not need to run again also the unit test
|
||||
command: ["npm", "run", "test:integration"]
|
||||
|
||||
elasticsearch-platinum:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-6.6.2}
|
||||
ports:
|
||||
- "9200:9200"
|
||||
networks:
|
||||
- esnet-platinum
|
||||
environment:
|
||||
- "node.attr.testattr=test"
|
||||
- "path.repo=/tmp"
|
||||
- "repositories.url.allowed_urls=http://snapshot.*"
|
||||
- "discovery.type=single-node"
|
||||
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
|
||||
- "ELASTIC_PASSWORD=changeme"
|
||||
- "xpack.security.enabled=true"
|
||||
- "xpack.license.self_generated.type=trial"
|
||||
- "xpack.security.http.ssl.enabled=true"
|
||||
- "xpack.security.http.ssl.verification_mode=certificate"
|
||||
- "xpack.security.http.ssl.key=certs/testnode.key"
|
||||
- "xpack.security.http.ssl.certificate=certs/testnode.crt"
|
||||
- "xpack.security.http.ssl.certificate_authorities=certs/ca.crt"
|
||||
- "xpack.security.transport.ssl.enabled=true"
|
||||
- "xpack.security.transport.ssl.key=certs/testnode.key"
|
||||
- "xpack.security.transport.ssl.certificate=certs/testnode.crt"
|
||||
- "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt"
|
||||
volumes:
|
||||
- "./certs/testnode.crt:/usr/share/elasticsearch/config/certs/testnode.crt"
|
||||
- "./certs/testnode.key:/usr/share/elasticsearch/config/certs/testnode.key"
|
||||
- "./certs/ca.crt:/usr/share/elasticsearch/config/certs/ca.crt"
|
||||
|
||||
networks:
|
||||
# we need two networks otherwise the two ES instances will join each other
|
||||
esnet-oss:
|
||||
esnet-platinum:
|
||||
volumes:
|
||||
esvol:
|
||||
@ -1,14 +0,0 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+7.3
|
||||
display-name: 'elastic / elasticsearch-js # 7.3'
|
||||
description: Testing the elasticsearch-js 7.3 branch.
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/7.3
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: '@weekly'
|
||||
@ -90,8 +90,6 @@ docker network inspect "$NETWORK_NAME" > /dev/null 2>&1 || docker network create
|
||||
environment=($(cat <<-END
|
||||
--env node.name=$NODE_NAME
|
||||
--env cluster.name=$CLUSTER_NAME
|
||||
--env cluster.initial_master_nodes=$MASTER_NODE_NAME
|
||||
--env discovery.seed_hosts=$MASTER_NODE_NAME
|
||||
--env cluster.routing.allocation.disk.threshold_enabled=false
|
||||
--env bootstrap.memory_lock=true
|
||||
--env node.attr.testattr=test
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
ELASTICSEARCH_VERSION:
|
||||
- 7.5.0
|
||||
- 6.8.4
|
||||
|
||||
NODE_JS_VERSION:
|
||||
- 12
|
||||
|
||||
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@ -3,7 +3,7 @@
|
||||
#### You have already researched for similar issues?
|
||||
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
|
||||
|
||||
#### Are you sure this is an issue with `@elastic/elasticsearch` or are you just looking for some help?
|
||||
#### Are you sure this is an issue with @elastic/elasticsearch or are you just looking for some help?
|
||||
|
||||
Issues should only be posted in this repository after you have been able to reproduce them and confirm that they are a bug or incorrect/missing information in the [docs](https://github.com/elastic/elasticsearch-js/docs).
|
||||
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/bug.md
vendored
10
.github/ISSUE_TEMPLATE/bug.md
vendored
@ -23,14 +23,6 @@ Paste your code here:
|
||||
|
||||
```
|
||||
|
||||
<!--
|
||||
In some cases, it might be challenging to reproduce the bug in a few lines of code.
|
||||
You can fork the following repository, which contains all the configuration needed
|
||||
to spin up a three nodes Elasticsearch cluster with security enabled.
|
||||
The repository also contains a preconfigured client instance that you can use to reproduce the issue.
|
||||
https://github.com/delvedor/es-reproduce-issue
|
||||
--->
|
||||
|
||||
## Expected behavior
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
@ -44,6 +36,6 @@ Paste the results here:
|
||||
## Your Environment
|
||||
|
||||
- *node version*: 6,8,10
|
||||
- `@elastic/elasticsearch` *version*: >=7.0.0
|
||||
- *@elastic/elasticsearch version*: >=7.0.0
|
||||
- *os*: Mac, Windows, Linux
|
||||
- *any other relevant information*
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/regression.md
vendored
10
.github/ISSUE_TEMPLATE/regression.md
vendored
@ -29,14 +29,6 @@ Paste your code here:
|
||||
|
||||
```
|
||||
|
||||
<!--
|
||||
In some cases, it might be challenging to reproduce the bug in a few lines of code.
|
||||
You can fork the following repository, which contains all the configuration needed
|
||||
to spin up a three nodes Elasticsearch cluster with security enabled.
|
||||
The repository also contains a preconfigured client instance that you can use to reproduce the issue.
|
||||
https://github.com/delvedor/es-reproduce-issue
|
||||
--->
|
||||
|
||||
## Expected behavior
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
@ -50,6 +42,6 @@ Paste the results here:
|
||||
## Your Environment
|
||||
|
||||
- *node version*: 6,8,10
|
||||
- `@elastic/elasticsearch` *version*: >=7.0.0
|
||||
- *@elastic/elasticsearch version*: >=7.0.0
|
||||
- *os*: Mac, Windows, Linux
|
||||
- *any other relevant information*
|
||||
|
||||
1
.github/stale.yml
vendored
1
.github/stale.yml
vendored
@ -9,7 +9,6 @@ exemptLabels:
|
||||
- "discussion"
|
||||
- "feature request"
|
||||
- "bug"
|
||||
- "todo"
|
||||
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
|
||||
@ -10,6 +10,23 @@
|
||||
function buildBulk (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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} fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request
|
||||
* @param {list} _source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
|
||||
* @param {list} _source_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',
|
||||
@ -17,6 +34,7 @@ function buildBulk (opts) {
|
||||
'routing',
|
||||
'timeout',
|
||||
'type',
|
||||
'fields',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_exclude',
|
||||
@ -40,11 +58,6 @@ function buildBulk (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a bulk request
|
||||
* Allows to perform multiple index/update/delete operations in a single request.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html
|
||||
*/
|
||||
return function bulk (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -79,6 +92,10 @@ function buildBulk (opts) {
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -87,13 +104,10 @@ function buildBulk (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'
|
||||
} else if ((index) != null) {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_bulk'
|
||||
} else {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_bulk'
|
||||
}
|
||||
|
||||
|
||||
@ -10,10 +10,23 @@
|
||||
function buildCatAliases (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -26,15 +39,11 @@ function buildCatAliases (opts) {
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.aliases request
|
||||
* Shows information about currently configured aliases to indices including filter and routing infos.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html
|
||||
*/
|
||||
return function catAliases (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -47,6 +56,12 @@ function buildCatAliases (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -57,6 +72,10 @@ function buildCatAliases (opts) {
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -65,10 +84,8 @@ function buildCatAliases (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'aliases'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,19 @@
|
||||
function buildCatAllocation (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -33,11 +46,6 @@ function buildCatAllocation (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.allocation request
|
||||
* Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html
|
||||
*/
|
||||
return function catAllocation (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -50,6 +58,12 @@ function buildCatAllocation (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -60,6 +74,10 @@ function buildCatAllocation (opts) {
|
||||
var { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -68,10 +86,8 @@ function buildCatAllocation (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((node_id || nodeId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'allocation'
|
||||
}
|
||||
|
||||
|
||||
@ -10,9 +10,23 @@
|
||||
function buildCatCount (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -25,15 +39,11 @@ function buildCatCount (opts) {
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.count request
|
||||
* Provides quick access to the document count of the entire cluster, or individual indices.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html
|
||||
*/
|
||||
return function catCount (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -46,6 +56,12 @@ function buildCatCount (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -56,6 +72,10 @@ function buildCatCount (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -64,10 +84,8 @@ function buildCatCount (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'count'
|
||||
}
|
||||
|
||||
|
||||
@ -10,10 +10,26 @@
|
||||
function buildCatFielddata (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -27,15 +43,11 @@ function buildCatFielddata (opts) {
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.fielddata request
|
||||
* Shows how much heap memory is currently being used by fielddata on every data node in the cluster.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html
|
||||
*/
|
||||
return function catFielddata (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -48,6 +60,12 @@ function buildCatFielddata (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -58,6 +76,10 @@ function buildCatFielddata (opts) {
|
||||
var { method, body, fields, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -66,10 +88,8 @@ function buildCatFielddata (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((fields) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'fielddata'
|
||||
}
|
||||
|
||||
|
||||
@ -10,13 +10,26 @@
|
||||
function buildCatHealth (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
'time',
|
||||
'ts',
|
||||
'v',
|
||||
'pretty',
|
||||
@ -27,15 +40,11 @@ function buildCatHealth (opts) {
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.health request
|
||||
* Returns a concise representation of the cluster health.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html
|
||||
*/
|
||||
return function catHealth (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -48,6 +57,12 @@ function buildCatHealth (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -58,6 +73,10 @@ function buildCatHealth (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -65,7 +84,6 @@ function buildCatHealth (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'health'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildCatHelp (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -26,11 +32,6 @@ function buildCatHelp (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.help request
|
||||
* Returns help for the Cat APIs.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html
|
||||
*/
|
||||
return function catHelp (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -43,6 +44,12 @@ function buildCatHelp (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -53,6 +60,10 @@ function buildCatHelp (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -60,7 +71,6 @@ function buildCatHelp (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,21 @@
|
||||
function buildCatIndices (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -21,9 +36,7 @@ function buildCatIndices (opts) {
|
||||
'help',
|
||||
'pri',
|
||||
's',
|
||||
'time',
|
||||
'v',
|
||||
'include_unloaded_segments',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
@ -33,16 +46,10 @@ function buildCatIndices (opts) {
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
includeUnloadedSegments: 'include_unloaded_segments',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.indices request
|
||||
* Returns information about indices: number of primaries and replicas, document counts, disk size, ...
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html
|
||||
*/
|
||||
return function catIndices (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -55,6 +62,12 @@ function buildCatIndices (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -65,6 +78,10 @@ function buildCatIndices (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -73,10 +90,8 @@ function buildCatIndices (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'indices'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildCatMaster (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -32,11 +43,6 @@ function buildCatMaster (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.master request
|
||||
* Returns information about the master node.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html
|
||||
*/
|
||||
return function catMaster (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -49,6 +55,12 @@ function buildCatMaster (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -59,6 +71,10 @@ function buildCatMaster (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -66,7 +82,6 @@ function buildCatMaster (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'master'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildCatNodeattrs (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -32,11 +43,6 @@ function buildCatNodeattrs (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.nodeattrs request
|
||||
* Returns information about custom node attributes.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html
|
||||
*/
|
||||
return function catNodeattrs (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -49,6 +55,12 @@ function buildCatNodeattrs (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -59,6 +71,10 @@ function buildCatNodeattrs (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -66,7 +82,6 @@ function buildCatNodeattrs (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'nodeattrs'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,9 +10,20 @@
|
||||
function buildCatNodes (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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 = [
|
||||
'bytes',
|
||||
'format',
|
||||
'full_id',
|
||||
'local',
|
||||
@ -20,7 +31,6 @@ function buildCatNodes (opts) {
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'time',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
@ -36,11 +46,6 @@ function buildCatNodes (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.nodes request
|
||||
* Returns basic statistics about performance of cluster nodes.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html
|
||||
*/
|
||||
return function catNodes (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -53,6 +58,12 @@ function buildCatNodes (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -63,6 +74,10 @@ function buildCatNodes (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -70,7 +85,6 @@ function buildCatNodes (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'nodes'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildCatPendingTasks (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -18,7 +29,6 @@ function buildCatPendingTasks (opts) {
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'time',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
@ -33,11 +43,6 @@ function buildCatPendingTasks (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.pending_tasks request
|
||||
* Returns a concise representation of the cluster pending tasks.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html
|
||||
*/
|
||||
return function catPendingTasks (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -50,6 +55,12 @@ function buildCatPendingTasks (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -60,6 +71,10 @@ function buildCatPendingTasks (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -67,7 +82,6 @@ function buildCatPendingTasks (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'pending_tasks'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildCatPlugins (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -32,11 +43,6 @@ function buildCatPlugins (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.plugins request
|
||||
* Returns information about installed plugins across nodes node.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html
|
||||
*/
|
||||
return function catPlugins (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -49,6 +55,12 @@ function buildCatPlugins (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -59,6 +71,10 @@ function buildCatPlugins (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -66,7 +82,6 @@ function buildCatPlugins (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'plugins'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,17 +10,26 @@
|
||||
function buildCatRecovery (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
'active_only',
|
||||
'bytes',
|
||||
'detailed',
|
||||
'master_timeout',
|
||||
'h',
|
||||
'help',
|
||||
'index',
|
||||
's',
|
||||
'time',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
@ -30,16 +39,11 @@ function buildCatRecovery (opts) {
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
activeOnly: 'active_only',
|
||||
masterTimeout: 'master_timeout',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.recovery request
|
||||
* Returns information about index shard recoveries, both on-going completed.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html
|
||||
*/
|
||||
return function catRecovery (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -52,6 +56,12 @@ function buildCatRecovery (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -62,6 +72,10 @@ function buildCatRecovery (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -70,10 +84,8 @@ function buildCatRecovery (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'recovery'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildCatRepositories (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -32,11 +43,6 @@ function buildCatRepositories (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.repositories request
|
||||
* Returns information about snapshot repositories registered in the cluster.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html
|
||||
*/
|
||||
return function catRepositories (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -49,6 +55,12 @@ function buildCatRepositories (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -59,6 +71,10 @@ function buildCatRepositories (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -66,7 +82,6 @@ function buildCatRepositories (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'repositories'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildCatSegments (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -30,11 +41,6 @@ function buildCatSegments (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.segments request
|
||||
* Provides low-level information about the segments in the shards of an index.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html
|
||||
*/
|
||||
return function catSegments (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -47,6 +53,12 @@ function buildCatSegments (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -57,6 +69,10 @@ function buildCatSegments (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -65,10 +81,8 @@ function buildCatSegments (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'segments'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,19 @@
|
||||
function buildCatShards (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -19,7 +32,6 @@ function buildCatShards (opts) {
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'time',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
@ -34,11 +46,6 @@ function buildCatShards (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.shards request
|
||||
* Provides a detailed view of shard allocation on nodes.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html
|
||||
*/
|
||||
return function catShards (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -51,6 +58,12 @@ function buildCatShards (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -61,6 +74,10 @@ function buildCatShards (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -69,10 +86,8 @@ function buildCatShards (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'shards'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,18 @@
|
||||
function buildCatSnapshots (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -18,7 +30,6 @@ function buildCatSnapshots (opts) {
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'time',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
@ -34,11 +45,6 @@ function buildCatSnapshots (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.snapshots request
|
||||
* Returns all snapshots in a specific repository.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html
|
||||
*/
|
||||
return function catSnapshots (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -51,6 +57,12 @@ function buildCatSnapshots (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -61,6 +73,10 @@ function buildCatSnapshots (opts) {
|
||||
var { method, body, repository, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -69,10 +85,8 @@ function buildCatSnapshots (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((repository) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'snapshots'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,19 @@
|
||||
function buildCatTasks (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -20,7 +33,6 @@ function buildCatTasks (opts) {
|
||||
'h',
|
||||
'help',
|
||||
's',
|
||||
'time',
|
||||
'v',
|
||||
'pretty',
|
||||
'human',
|
||||
@ -36,11 +48,6 @@ function buildCatTasks (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.tasks request
|
||||
* Returns information about the tasks currently executing on one or more nodes in the cluster.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html
|
||||
*/
|
||||
return function catTasks (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -53,6 +60,12 @@ function buildCatTasks (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -63,6 +76,10 @@ function buildCatTasks (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -70,7 +87,6 @@ function buildCatTasks (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'tasks'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,18 @@
|
||||
function buildCatTemplates (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -32,11 +44,6 @@ function buildCatTemplates (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.templates request
|
||||
* Returns information about existing templates.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html
|
||||
*/
|
||||
return function catTemplates (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -49,6 +56,12 @@ function buildCatTemplates (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -59,6 +72,10 @@ function buildCatTemplates (opts) {
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -67,10 +84,8 @@ function buildCatTemplates (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'templates'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,19 @@
|
||||
function buildCatThreadPool (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -33,12 +46,6 @@ function buildCatThreadPool (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cat.thread_pool request
|
||||
* Returns cluster-wide thread pool statistics per node.
|
||||
By default the active, queue and rejected statistics are returned for all thread pools.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html
|
||||
*/
|
||||
return function catThreadPool (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -51,6 +58,12 @@ By default the active, queue and rejected statistics are returned for all thread
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -61,6 +74,10 @@ By default the active, queue and rejected statistics are returned for all thread
|
||||
var { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -69,10 +86,8 @@ By default the active, queue and rejected statistics are returned for all thread
|
||||
var path = ''
|
||||
|
||||
if ((thread_pool_patterns || threadPoolPatterns) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'thread_pool'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
function buildCcrDeleteAutoFollowPattern (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.delete_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html) request
|
||||
*
|
||||
* @param {string} name - The name of the auto follow pattern.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildCcrDeleteAutoFollowPattern (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.delete_auto_follow_pattern request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html
|
||||
*/
|
||||
return function ccrDeleteAutoFollowPattern (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -51,6 +52,10 @@ function buildCcrDeleteAutoFollowPattern (opts) {
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,7 +63,6 @@ function buildCcrDeleteAutoFollowPattern (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,13 @@
|
||||
function buildCcrFollow (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html) request
|
||||
*
|
||||
* @param {string} index - The name of the follower index
|
||||
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||
* @param {object} body - The name of the leader index and other optional ccr related parameters
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'wait_for_active_shards'
|
||||
@ -19,10 +26,6 @@ function buildCcrFollow (opts) {
|
||||
waitForActiveShards: 'wait_for_active_shards'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.follow request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html
|
||||
*/
|
||||
return function ccrFollow (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -55,6 +58,10 @@ function buildCcrFollow (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -62,7 +69,6 @@ function buildCcrFollow (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
function buildCcrFollowInfo (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.follow_info](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildCcrFollowInfo (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.follow_info request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html
|
||||
*/
|
||||
return function ccrFollowInfo (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -35,12 +36,6 @@ function buildCcrFollowInfo (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -51,6 +46,10 @@ function buildCcrFollowInfo (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,7 +57,6 @@ function buildCcrFollowInfo (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
function buildCcrFollowStats (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.follow_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html) request
|
||||
*
|
||||
* @param {list} index - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildCcrFollowStats (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.follow_stats request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html
|
||||
*/
|
||||
return function ccrFollowStats (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -35,12 +36,6 @@ function buildCcrFollowStats (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -51,6 +46,10 @@ function buildCcrFollowStats (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,7 +57,6 @@ function buildCcrFollowStats (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildCcrForgetFollower (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.forget_follower](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
|
||||
*
|
||||
* @param {string} index - the name of the leader index for which specified follower retention leases should be removed
|
||||
* @param {object} body - the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +25,6 @@ function buildCcrForgetFollower (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.forget_follower request
|
||||
* http://www.elastic.co/guide/en/elasticsearch/reference/current
|
||||
*/
|
||||
return function ccrForgetFollower (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -55,6 +57,10 @@ function buildCcrForgetFollower (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -62,7 +68,6 @@ function buildCcrForgetFollower (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
function buildCcrGetAutoFollowPattern (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.get_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html) request
|
||||
*
|
||||
* @param {string} name - The name of the auto follow pattern.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildCcrGetAutoFollowPattern (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.get_auto_follow_pattern request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html
|
||||
*/
|
||||
return function ccrGetAutoFollowPattern (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -45,6 +46,10 @@ function buildCcrGetAutoFollowPattern (opts) {
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -53,10 +58,8 @@ function buildCcrGetAutoFollowPattern (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ccr' + '/' + 'auto_follow'
|
||||
}
|
||||
|
||||
|
||||
@ -1,77 +0,0 @@
|
||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildCcrPauseAutoFollowPattern (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.pause_auto_follow_pattern request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html
|
||||
*/
|
||||
return function ccrPauseAutoFollowPattern (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['name'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'pause'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildCcrPauseAutoFollowPattern
|
||||
@ -10,6 +10,11 @@
|
||||
function buildCcrPauseFollow (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.pause_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html) request
|
||||
*
|
||||
* @param {string} index - The name of the follower index that should pause following its leader index.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildCcrPauseFollow (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.pause_follow request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html
|
||||
*/
|
||||
return function ccrPauseFollow (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -51,6 +52,10 @@ function buildCcrPauseFollow (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,7 +63,6 @@ function buildCcrPauseFollow (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildCcrPutAutoFollowPattern (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.put_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html) request
|
||||
*
|
||||
* @param {string} name - The name of the auto follow pattern.
|
||||
* @param {object} body - The specification of the auto follow pattern
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +25,6 @@ function buildCcrPutAutoFollowPattern (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.put_auto_follow_pattern request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html
|
||||
*/
|
||||
return function ccrPutAutoFollowPattern (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -55,6 +57,10 @@ function buildCcrPutAutoFollowPattern (opts) {
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -62,7 +68,6 @@ function buildCcrPutAutoFollowPattern (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildCcrResumeFollow (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.resume_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html) request
|
||||
*
|
||||
* @param {string} index - The name of the follow index to resume following.
|
||||
* @param {object} body - The name of the leader index and other optional ccr related parameters
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +25,6 @@ function buildCcrResumeFollow (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.resume_follow request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html
|
||||
*/
|
||||
return function ccrResumeFollow (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -51,6 +53,10 @@ function buildCcrResumeFollow (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,7 +64,6 @@ function buildCcrResumeFollow (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,10 @@
|
||||
function buildCcrStats (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html) request
|
||||
*
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +23,6 @@ function buildCcrStats (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.stats request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html
|
||||
*/
|
||||
return function ccrStats (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -45,6 +45,10 @@ function buildCcrStats (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -52,7 +56,6 @@ function buildCcrStats (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ccr' + '/' + 'stats'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
function buildCcrUnfollow (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ccr.unfollow](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
|
||||
*
|
||||
* @param {string} index - The name of the follower index that should be turned into a regular index.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildCcrUnfollow (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ccr.unfollow request
|
||||
* http://www.elastic.co/guide/en/elasticsearch/reference/current
|
||||
*/
|
||||
return function ccrUnfollow (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -51,6 +52,10 @@ function buildCcrUnfollow (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,7 +63,6 @@ function buildCcrUnfollow (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildClearScroll (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -24,11 +30,6 @@ function buildClearScroll (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a clear_scroll request
|
||||
* Explicitly clears the search context for a scroll.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api
|
||||
*/
|
||||
return function clearScroll (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -51,6 +52,10 @@ function buildClearScroll (opts) {
|
||||
var { method, body, scrollId, scroll_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -59,10 +64,8 @@ function buildClearScroll (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((scroll_id || scrollId) != null) {
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
|
||||
} else {
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_search' + '/' + 'scroll'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,13 @@
|
||||
function buildClusterAllocationExplain (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -28,11 +35,6 @@ function buildClusterAllocationExplain (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cluster.allocation_explain request
|
||||
* Provides explanations for shard allocations in the cluster.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html
|
||||
*/
|
||||
return function clusterAllocationExplain (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -55,6 +57,10 @@ function buildClusterAllocationExplain (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -62,7 +68,6 @@ function buildClusterAllocationExplain (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,14 @@
|
||||
function buildClusterGetSettings (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -31,11 +39,6 @@ function buildClusterGetSettings (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cluster.get_settings request
|
||||
* Returns cluster settings.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html
|
||||
*/
|
||||
return function clusterGetSettings (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -48,6 +51,12 @@ function buildClusterGetSettings (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -58,6 +67,10 @@ function buildClusterGetSettings (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -65,7 +78,6 @@ function buildClusterGetSettings (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cluster' + '/' + 'settings'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,9 +10,23 @@
|
||||
function buildClusterHealth (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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 = [
|
||||
'expand_wildcards',
|
||||
'level',
|
||||
'local',
|
||||
'master_timeout',
|
||||
@ -31,7 +45,6 @@ function buildClusterHealth (opts) {
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
expandWildcards: 'expand_wildcards',
|
||||
masterTimeout: 'master_timeout',
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
waitForNodes: 'wait_for_nodes',
|
||||
@ -43,11 +56,6 @@ function buildClusterHealth (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cluster.health request
|
||||
* Returns basic information about the health of the cluster.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html
|
||||
*/
|
||||
return function clusterHealth (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -60,6 +68,12 @@ function buildClusterHealth (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -70,6 +84,10 @@ function buildClusterHealth (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -78,10 +96,8 @@ function buildClusterHealth (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cluster' + '/' + 'health'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildClusterPendingTasks (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -27,12 +33,6 @@ function buildClusterPendingTasks (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cluster.pending_tasks request
|
||||
* Returns a list of any cluster-level changes (e.g. create index, update mapping,
|
||||
allocate or fail shard) which have not yet been executed.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html
|
||||
*/
|
||||
return function clusterPendingTasks (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -45,6 +45,12 @@ allocate or fail shard) which have not yet been executed.
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -55,6 +61,10 @@ allocate or fail shard) which have not yet been executed.
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -62,7 +72,6 @@ allocate or fail shard) which have not yet been executed.
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cluster' + '/' + 'pending_tasks'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,14 @@
|
||||
function buildClusterPutSettings (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -29,11 +37,6 @@ function buildClusterPutSettings (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cluster.put_settings request
|
||||
* Updates the cluster settings.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html
|
||||
*/
|
||||
return function clusterPutSettings (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -62,6 +65,10 @@ function buildClusterPutSettings (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -69,7 +76,6 @@ function buildClusterPutSettings (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_cluster' + '/' + 'settings'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,10 @@
|
||||
function buildClusterRemoteInfo (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [cluster.remote_info](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html) request
|
||||
*
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'pretty',
|
||||
@ -24,11 +28,6 @@ function buildClusterRemoteInfo (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cluster.remote_info request
|
||||
* Returns the information about configured remote clusters.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html
|
||||
*/
|
||||
return function clusterRemoteInfo (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -41,6 +40,12 @@ function buildClusterRemoteInfo (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -51,6 +56,10 @@ function buildClusterRemoteInfo (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,7 +67,6 @@ function buildClusterRemoteInfo (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_remote' + '/' + 'info'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildClusterReroute (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -33,11 +44,6 @@ function buildClusterReroute (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cluster.reroute request
|
||||
* Allows to manually change the allocation of individual shards in the cluster.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html
|
||||
*/
|
||||
return function clusterReroute (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -60,6 +66,10 @@ function buildClusterReroute (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -67,7 +77,6 @@ function buildClusterReroute (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_cluster' + '/' + 'reroute'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,20 @@
|
||||
function buildClusterState (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -39,11 +53,6 @@ function buildClusterState (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cluster.state request
|
||||
* Returns a comprehensive information about the state of the cluster.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html
|
||||
*/
|
||||
return function clusterState (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -56,6 +65,12 @@ function buildClusterState (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['index'] != null && (params['metric'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: metric')
|
||||
@ -69,9 +84,13 @@ function buildClusterState (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, metric, index, ...querystring } = params
|
||||
var { method, body, index, metric, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -80,13 +99,10 @@ function buildClusterState (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((metric) != null && (index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
|
||||
} else if ((metric) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cluster' + '/' + 'state'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,13 @@
|
||||
function buildClusterStats (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -27,11 +34,6 @@ function buildClusterStats (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a cluster.stats request
|
||||
* Returns high-level overview of cluster statistics.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html
|
||||
*/
|
||||
return function clusterStats (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -44,6 +46,12 @@ function buildClusterStats (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -54,6 +62,10 @@ function buildClusterStats (opts) {
|
||||
var { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -62,10 +74,8 @@ function buildClusterStats (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((node_id || nodeId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cluster' + '/' + 'stats'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,27 @@
|
||||
function buildCount (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -46,11 +67,6 @@ function buildCount (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a count request
|
||||
* Returns number of documents matching a query.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html
|
||||
*/
|
||||
return function count (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -79,6 +95,10 @@ function buildCount (opts) {
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -87,13 +107,10 @@ function buildCount (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count'
|
||||
} else if ((index) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_count'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_count'
|
||||
}
|
||||
|
||||
|
||||
@ -10,9 +10,26 @@
|
||||
function buildCreate (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -33,13 +50,6 @@ function buildCreate (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a create request
|
||||
* Creates a new document in the index.
|
||||
|
||||
Returns a 409 response when a document with a same ID already exists in the index.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html
|
||||
*/
|
||||
return function create (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -61,6 +71,10 @@ Returns a 409 response when a document with a same ID already exists in the inde
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['type'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: type')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
@ -76,6 +90,10 @@ Returns a 409 response when a document with a same ID already exists in the inde
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -83,13 +101,7 @@ Returns a 409 response when a document with a same ID already exists in the inde
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
|
||||
} else {
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
|
||||
@ -10,9 +10,26 @@
|
||||
function buildDelete (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -36,11 +53,6 @@ function buildDelete (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a delete request
|
||||
* Removes a document from the index.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html
|
||||
*/
|
||||
return function _delete (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -62,6 +74,23 @@ function buildDelete (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['type'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: type')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: type, index')
|
||||
return handleError(err, callback)
|
||||
} else if (params['type'] != null && (params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -73,6 +102,10 @@ function buildDelete (opts) {
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -80,19 +113,13 @@ function buildDelete (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
} else {
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,8 +10,48 @@
|
||||
function buildDeleteByQuery (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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 <field>:<direction> pairs
|
||||
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
|
||||
* @param {list} _source_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',
|
||||
@ -28,7 +68,6 @@ function buildDeleteByQuery (opts) {
|
||||
'search_type',
|
||||
'search_timeout',
|
||||
'size',
|
||||
'max_docs',
|
||||
'sort',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
@ -61,7 +100,6 @@ function buildDeleteByQuery (opts) {
|
||||
expandWildcards: 'expand_wildcards',
|
||||
searchType: 'search_type',
|
||||
searchTimeout: 'search_timeout',
|
||||
maxDocs: 'max_docs',
|
||||
_sourceExcludes: '_source_excludes',
|
||||
_sourceExclude: '_source_exclude',
|
||||
_sourceIncludes: '_source_includes',
|
||||
@ -76,11 +114,6 @@ function buildDeleteByQuery (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a delete_by_query request
|
||||
* Deletes documents matching the provided query.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html
|
||||
*/
|
||||
return function deleteByQuery (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -119,6 +152,10 @@ function buildDeleteByQuery (opts) {
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -127,10 +164,8 @@ function buildDeleteByQuery (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'
|
||||
} else {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildDeleteByQueryRethrottle (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [delete_by_query_rethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html) request
|
||||
*
|
||||
* @param {string} task_id - The task id to rethrottle
|
||||
* @param {number} requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'requests_per_second',
|
||||
@ -26,11 +32,6 @@ function buildDeleteByQueryRethrottle (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a delete_by_query_rethrottle request
|
||||
* Changes the number of requests per second for a particular Delete By Query operation.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
|
||||
*/
|
||||
return function deleteByQueryRethrottle (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -52,6 +53,10 @@ function buildDeleteByQueryRethrottle (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -63,6 +68,10 @@ function buildDeleteByQueryRethrottle (opts) {
|
||||
var { method, body, taskId, task_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -70,14 +79,13 @@ function buildDeleteByQueryRethrottle (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,13 @@
|
||||
function buildDeleteScript (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -27,11 +34,6 @@ function buildDeleteScript (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a delete_script request
|
||||
* Deletes a script.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
|
||||
*/
|
||||
return function deleteScript (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -49,6 +51,10 @@ function buildDeleteScript (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -60,6 +66,10 @@ function buildDeleteScript (opts) {
|
||||
var { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -67,14 +77,13 @@ function buildDeleteScript (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -1,76 +0,0 @@
|
||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildEnrichExecutePolicy (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'wait_for_completion'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
waitForCompletion: 'wait_for_completion'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a enrich.execute_policy request
|
||||
*/
|
||||
return function enrichExecutePolicy (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['name'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + '/' + '_execute'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildEnrichExecutePolicy
|
||||
@ -1,75 +0,0 @@
|
||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildEnrichGetPolicy (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a enrich.get_policy request
|
||||
*/
|
||||
return function enrichGetPolicy (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_enrich' + '/' + 'policy'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildEnrichGetPolicy
|
||||
@ -1,70 +0,0 @@
|
||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildEnrichStats (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a enrich.stats request
|
||||
*/
|
||||
return function enrichStats (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_enrich' + '/' + '_stats'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildEnrichStats
|
||||
@ -10,9 +10,28 @@
|
||||
function buildExists (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -42,11 +61,6 @@ function buildExists (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a exists request
|
||||
* Returns information about whether a document exists in an index.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
|
||||
*/
|
||||
return function exists (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -68,6 +82,14 @@ function buildExists (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['type'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: type')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -79,6 +101,10 @@ function buildExists (opts) {
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'HEAD'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -86,13 +112,7 @@ function buildExists (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
if (method == null) method = 'HEAD'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
} else {
|
||||
if (method == null) method = 'HEAD'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
|
||||
@ -10,8 +10,26 @@
|
||||
function buildExistsSource (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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; use `_all` to fetch the first document matching the ID across all types
|
||||
* @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',
|
||||
@ -40,11 +58,6 @@ function buildExistsSource (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a exists_source request
|
||||
* Returns information about whether a document source exists in an index.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
|
||||
*/
|
||||
return function existsSource (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -66,6 +79,14 @@ function buildExistsSource (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['type'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: type')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
|
||||
@ -86,6 +107,10 @@ function buildExistsSource (opts) {
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'HEAD'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -93,13 +118,7 @@ function buildExistsSource (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
if (method == null) method = 'HEAD'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
|
||||
} else {
|
||||
if (method == null) method = 'HEAD'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
|
||||
@ -10,6 +10,27 @@
|
||||
function buildExplain (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -18,6 +39,7 @@ function buildExplain (opts) {
|
||||
'df',
|
||||
'stored_fields',
|
||||
'lenient',
|
||||
'parent',
|
||||
'preference',
|
||||
'q',
|
||||
'routing',
|
||||
@ -45,11 +67,6 @@ function buildExplain (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a explain request
|
||||
* Returns information about why a specific matches (or doesn't match) a query.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html
|
||||
*/
|
||||
return function explain (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -71,6 +88,10 @@ function buildExplain (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['type'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: type')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -82,6 +103,10 @@ function buildExplain (opts) {
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -89,13 +114,7 @@ function buildExplain (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
|
||||
@ -10,13 +10,22 @@
|
||||
function buildFieldCaps (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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.
|
||||
* @param {object} body - Field json objects containing an array of field names
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'fields',
|
||||
'ignore_unavailable',
|
||||
'allow_no_indices',
|
||||
'expand_wildcards',
|
||||
'include_unmapped',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
@ -28,16 +37,10 @@ function buildFieldCaps (opts) {
|
||||
ignoreUnavailable: 'ignore_unavailable',
|
||||
allowNoIndices: 'allow_no_indices',
|
||||
expandWildcards: 'expand_wildcards',
|
||||
includeUnmapped: 'include_unmapped',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a field_caps request
|
||||
* Returns the information about the capabilities of fields among multiple indices.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html
|
||||
*/
|
||||
return function fieldCaps (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -60,6 +63,10 @@ function buildFieldCaps (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -68,10 +75,8 @@ function buildFieldCaps (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_field_caps'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_field_caps'
|
||||
}
|
||||
|
||||
|
||||
@ -10,9 +10,30 @@
|
||||
function buildGet (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -42,11 +63,6 @@ function buildGet (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a get request
|
||||
* Returns a document.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
|
||||
*/
|
||||
return function get (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -68,6 +84,14 @@ function buildGet (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['type'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: type')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -79,6 +103,10 @@ function buildGet (opts) {
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -86,13 +114,7 @@ function buildGet (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildGetScript (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -26,11 +32,6 @@ function buildGetScript (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a get_script request
|
||||
* Returns a script.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
|
||||
*/
|
||||
return function getScript (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -48,6 +49,10 @@ function buildGetScript (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -59,6 +64,10 @@ function buildGetScript (opts) {
|
||||
var { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -66,7 +75,6 @@ function buildGetScript (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,8 +10,26 @@
|
||||
function buildGetSource (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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; use `_all` to fetch the first document matching the ID across all types
|
||||
* @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',
|
||||
@ -40,11 +58,6 @@ function buildGetSource (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a get_source request
|
||||
* Returns the source of a document.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
|
||||
*/
|
||||
return function getSource (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -66,6 +79,14 @@ function buildGetSource (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['type'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: type')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -77,6 +98,10 @@ function buildGetSource (opts) {
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -84,13 +109,7 @@ function buildGetSource (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
|
||||
}
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
function buildIlmDeleteLifecycle (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.delete_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html) request
|
||||
*
|
||||
* @param {string} policy - The name of the index lifecycle policy
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildIlmDeleteLifecycle (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.delete_lifecycle request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html
|
||||
*/
|
||||
return function ilmDeleteLifecycle (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -36,8 +37,8 @@ function buildIlmDeleteLifecycle (opts) {
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['policy'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: policy')
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
@ -51,6 +52,10 @@ function buildIlmDeleteLifecycle (opts) {
|
||||
var { method, body, policy, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,14 +63,13 @@ function buildIlmDeleteLifecycle (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,21 +10,21 @@
|
||||
function buildIlmExplainLifecycle (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.explain_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html) request
|
||||
*
|
||||
* @param {string} index - The name of the index to explain
|
||||
* @param {boolean} human - Return data such as dates in a human readable format
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'only_managed',
|
||||
'only_errors'
|
||||
'human'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
onlyManaged: 'only_managed',
|
||||
onlyErrors: 'only_errors'
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.explain_lifecycle request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html
|
||||
*/
|
||||
return function ilmExplainLifecycle (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -38,8 +38,8 @@ function buildIlmExplainLifecycle (opts) {
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
@ -53,6 +53,10 @@ function buildIlmExplainLifecycle (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -60,7 +64,6 @@ function buildIlmExplainLifecycle (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'explain'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
function buildIlmGetLifecycle (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.get_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html) request
|
||||
*
|
||||
* @param {string} policy - The name of the index lifecycle policy
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildIlmGetLifecycle (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.get_lifecycle request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html
|
||||
*/
|
||||
return function ilmGetLifecycle (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -35,6 +36,12 @@ function buildIlmGetLifecycle (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -45,6 +52,10 @@ function buildIlmGetLifecycle (opts) {
|
||||
var { method, body, policy, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -53,10 +64,8 @@ function buildIlmGetLifecycle (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((policy) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ilm' + '/' + 'policy'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,10 @@
|
||||
function buildIlmGetStatus (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.get_status](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html) request
|
||||
*
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +23,6 @@ function buildIlmGetStatus (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.get_status request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html
|
||||
*/
|
||||
return function ilmGetStatus (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -35,6 +35,12 @@ function buildIlmGetStatus (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -45,6 +51,10 @@ function buildIlmGetStatus (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -52,7 +62,6 @@ function buildIlmGetStatus (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ilm' + '/' + 'status'
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildIlmMoveToStep (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.move_to_step](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html) request
|
||||
*
|
||||
* @param {string} index - The name of the index whose lifecycle step is to change
|
||||
* @param {object} body - The new lifecycle step to move to
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +25,6 @@ function buildIlmMoveToStep (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.move_to_step request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html
|
||||
*/
|
||||
return function ilmMoveToStep (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -35,12 +37,6 @@ function buildIlmMoveToStep (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -51,6 +47,10 @@ function buildIlmMoveToStep (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,7 +58,6 @@ function buildIlmMoveToStep (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ilm' + '/' + 'move' + '/' + encodeURIComponent(index)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
function buildIlmPutLifecycle (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.put_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html) request
|
||||
*
|
||||
* @param {string} policy - The name of the index lifecycle policy
|
||||
* @param {object} body - The lifecycle policy definition to register
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +25,6 @@ function buildIlmPutLifecycle (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.put_lifecycle request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html
|
||||
*/
|
||||
return function ilmPutLifecycle (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -35,12 +37,6 @@ function buildIlmPutLifecycle (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['policy'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: policy')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -51,6 +47,10 @@ function buildIlmPutLifecycle (opts) {
|
||||
var { method, body, policy, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,7 +58,6 @@ function buildIlmPutLifecycle (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
function buildIlmRemovePolicy (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.remove_policy](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html) request
|
||||
*
|
||||
* @param {string} index - The name of the index to remove policy on
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildIlmRemovePolicy (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.remove_policy request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html
|
||||
*/
|
||||
return function ilmRemovePolicy (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -36,8 +37,8 @@ function buildIlmRemovePolicy (opts) {
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
@ -51,6 +52,10 @@ function buildIlmRemovePolicy (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,14 +63,13 @@ function buildIlmRemovePolicy (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'remove'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
function buildIlmRetry (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.retry](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html) request
|
||||
*
|
||||
* @param {string} index - The name of the indices (comma-separated) whose failed lifecycle step is to be retry
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +24,6 @@ function buildIlmRetry (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.retry request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html
|
||||
*/
|
||||
return function ilmRetry (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -36,8 +37,8 @@ function buildIlmRetry (opts) {
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
@ -51,6 +52,10 @@ function buildIlmRetry (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -58,14 +63,13 @@ function buildIlmRetry (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'retry'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,10 @@
|
||||
function buildIlmStart (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.start](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html) request
|
||||
*
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +23,6 @@ function buildIlmStart (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.start request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html
|
||||
*/
|
||||
return function ilmStart (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -35,6 +35,12 @@ function buildIlmStart (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -45,6 +51,10 @@ function buildIlmStart (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -52,14 +62,13 @@ function buildIlmStart (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ilm' + '/' + 'start'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,10 @@
|
||||
function buildIlmStop (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
/**
|
||||
* Perform a [ilm.stop](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html) request
|
||||
*
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
@ -19,10 +23,6 @@ function buildIlmStop (opts) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ilm.stop request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html
|
||||
*/
|
||||
return function ilmStop (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -35,6 +35,12 @@ function buildIlmStop (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -45,6 +51,10 @@ function buildIlmStop (opts) {
|
||||
var { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -52,14 +62,13 @@ function buildIlmStop (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ilm' + '/' + 'stop'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,10 +10,30 @@
|
||||
function buildIndex (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -39,11 +59,6 @@ function buildIndex (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a index request
|
||||
* Creates or updates a document in an index.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html
|
||||
*/
|
||||
return function _index (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -61,11 +76,24 @@ function buildIndex (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['type'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: type')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: type, index')
|
||||
return handleError(err, callback)
|
||||
} else if (params['type'] != null && (params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -76,6 +104,10 @@ function buildIndex (opts) {
|
||||
var { method, body, id, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -84,17 +116,9 @@ function buildIndex (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (id) != null) {
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
|
||||
} else if ((index) != null && (id) != null) {
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
|
||||
} else if ((index) != null && (type) != null) {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type)
|
||||
} else {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_doc'
|
||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type)
|
||||
}
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,13 @@
|
||||
function buildIndicesAnalyze (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -25,11 +32,6 @@ function buildIndicesAnalyze (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.analyze request
|
||||
* Performs the analysis process on a text and return the tokens breakdown of the text.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html
|
||||
*/
|
||||
return function indicesAnalyze (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -52,6 +54,10 @@ function buildIndicesAnalyze (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -60,10 +66,8 @@ function buildIndicesAnalyze (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_analyze'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_analyze'
|
||||
}
|
||||
|
||||
|
||||
@ -10,8 +10,24 @@
|
||||
function buildIndicesClearCache (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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} field_data - Clear field data. This is deprecated. Prefer `fielddata`.
|
||||
* @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_cache - Clear request cache
|
||||
* @param {boolean} request - Clear request cache
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'field_data',
|
||||
'fielddata',
|
||||
'fields',
|
||||
'query',
|
||||
@ -19,6 +35,7 @@ function buildIndicesClearCache (opts) {
|
||||
'allow_no_indices',
|
||||
'expand_wildcards',
|
||||
'index',
|
||||
'request_cache',
|
||||
'request',
|
||||
'pretty',
|
||||
'human',
|
||||
@ -28,18 +45,15 @@ function buildIndicesClearCache (opts) {
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
fieldData: 'field_data',
|
||||
ignoreUnavailable: 'ignore_unavailable',
|
||||
allowNoIndices: 'allow_no_indices',
|
||||
expandWildcards: 'expand_wildcards',
|
||||
requestCache: 'request_cache',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.clear_cache request
|
||||
* Clears all or specific caches for one or more indices.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html
|
||||
*/
|
||||
return function indicesClearCache (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -52,6 +66,12 @@ function buildIndicesClearCache (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -62,6 +82,10 @@ function buildIndicesClearCache (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -70,10 +94,8 @@ function buildIndicesClearCache (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear'
|
||||
} else {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_cache' + '/' + 'clear'
|
||||
}
|
||||
|
||||
@ -81,7 +103,7 @@ function buildIndicesClearCache (opts) {
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -1,98 +0,0 @@
|
||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildIndicesClone (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'timeout',
|
||||
'master_timeout',
|
||||
'wait_for_active_shards',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
masterTimeout: 'master_timeout',
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.clone request
|
||||
* Clones an index
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html
|
||||
*/
|
||||
return function indicesClone (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['target'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: target')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['target'] != null && (params['index'] == null)) {
|
||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, index, target, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_clone' + '/' + encodeURIComponent(target)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildIndicesClone
|
||||
@ -10,6 +10,16 @@
|
||||
function buildIndicesClose (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -17,7 +27,6 @@ function buildIndicesClose (opts) {
|
||||
'ignore_unavailable',
|
||||
'allow_no_indices',
|
||||
'expand_wildcards',
|
||||
'wait_for_active_shards',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
@ -30,16 +39,10 @@ function buildIndicesClose (opts) {
|
||||
ignoreUnavailable: 'ignore_unavailable',
|
||||
allowNoIndices: 'allow_no_indices',
|
||||
expandWildcards: 'expand_wildcards',
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.close request
|
||||
* Closes an index.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
|
||||
*/
|
||||
return function indicesClose (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -57,6 +60,10 @@ function buildIndicesClose (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -68,6 +75,10 @@ function buildIndicesClose (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -75,14 +86,13 @@ function buildIndicesClose (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_close'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,12 +10,24 @@
|
||||
function buildIndicesCreate (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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 {boolean} update_all_types - Whether to update the mapping for all fields with the same name across all types or not
|
||||
* @param {object} body - The configuration for the index (`settings` and `mappings`)
|
||||
*/
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'include_type_name',
|
||||
'wait_for_active_shards',
|
||||
'timeout',
|
||||
'master_timeout',
|
||||
'update_all_types',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
@ -27,15 +39,11 @@ function buildIndicesCreate (opts) {
|
||||
includeTypeName: 'include_type_name',
|
||||
waitForActiveShards: 'wait_for_active_shards',
|
||||
masterTimeout: 'master_timeout',
|
||||
updateAllTypes: 'update_all_types',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.create request
|
||||
* Creates an index with optional settings and mappings.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html
|
||||
*/
|
||||
return function indicesCreate (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -64,6 +72,10 @@ function buildIndicesCreate (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'PUT'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -71,7 +83,6 @@ function buildIndicesCreate (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + encodeURIComponent(index)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,16 @@
|
||||
function buildIndicesDelete (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -33,11 +43,6 @@ function buildIndicesDelete (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.delete request
|
||||
* Deletes an index.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html
|
||||
*/
|
||||
return function indicesDelete (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -55,6 +60,10 @@ function buildIndicesDelete (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -66,6 +75,10 @@ function buildIndicesDelete (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -73,14 +86,13 @@ function buildIndicesDelete (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + encodeURIComponent(index)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,14 @@
|
||||
function buildIndicesDeleteAlias (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -27,11 +35,6 @@ function buildIndicesDeleteAlias (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.delete_alias request
|
||||
* Deletes an alias.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
|
||||
*/
|
||||
return function indicesDeleteAlias (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -53,6 +56,10 @@ function buildIndicesDeleteAlias (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['name'] != null && (params['index'] == null)) {
|
||||
@ -70,6 +77,10 @@ function buildIndicesDeleteAlias (opts) {
|
||||
var { method, body, index, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -78,10 +89,8 @@ function buildIndicesDeleteAlias (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (name) != null) {
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
|
||||
}
|
||||
|
||||
@ -89,7 +98,7 @@ function buildIndicesDeleteAlias (opts) {
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,13 @@
|
||||
function buildIndicesDeleteTemplate (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -27,11 +34,6 @@ function buildIndicesDeleteTemplate (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.delete_template request
|
||||
* Deletes an index template.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
|
||||
*/
|
||||
return function indicesDeleteTemplate (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -49,6 +51,10 @@ function buildIndicesDeleteTemplate (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -60,6 +66,10 @@ function buildIndicesDeleteTemplate (opts) {
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'DELETE'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -67,14 +77,13 @@ function buildIndicesDeleteTemplate (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_template' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildIndicesExists (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -35,11 +46,6 @@ function buildIndicesExists (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.exists request
|
||||
* Returns information about whether a particular index exists.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html
|
||||
*/
|
||||
return function indicesExists (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -57,6 +63,10 @@ function buildIndicesExists (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -68,6 +78,10 @@ function buildIndicesExists (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'HEAD'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -75,7 +89,6 @@ function buildIndicesExists (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'HEAD'
|
||||
path = '/' + encodeURIComponent(index)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,16 @@
|
||||
function buildIndicesExistsAlias (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -31,11 +41,6 @@ function buildIndicesExistsAlias (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.exists_alias request
|
||||
* Returns information about whether a particular alias exists.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
|
||||
*/
|
||||
return function indicesExistsAlias (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -53,6 +58,10 @@ function buildIndicesExistsAlias (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -61,9 +70,13 @@ function buildIndicesExistsAlias (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, index, ...querystring } = params
|
||||
var { method, body, index, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'HEAD'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -72,10 +85,8 @@ function buildIndicesExistsAlias (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (name) != null) {
|
||||
if (method == null) method = 'HEAD'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'HEAD'
|
||||
path = '/' + '_alias' + '/' + encodeURIComponent(name)
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,14 @@
|
||||
function buildIndicesExistsTemplate (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -29,11 +37,6 @@ function buildIndicesExistsTemplate (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.exists_template request
|
||||
* Returns information about whether a particular index template exists.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
|
||||
*/
|
||||
return function indicesExistsTemplate (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -51,6 +54,10 @@ function buildIndicesExistsTemplate (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -62,6 +69,10 @@ function buildIndicesExistsTemplate (opts) {
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'HEAD'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -69,7 +80,6 @@ function buildIndicesExistsTemplate (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'HEAD'
|
||||
path = '/' + '_template' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,16 @@
|
||||
function buildIndicesExistsType (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -31,11 +41,6 @@ function buildIndicesExistsType (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.exists_type request
|
||||
* Returns information about whether a particular document type exists. (DEPRECATED)
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html
|
||||
*/
|
||||
return function indicesExistsType (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -57,6 +62,10 @@ function buildIndicesExistsType (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: type')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params['type'] != null && (params['index'] == null)) {
|
||||
@ -74,6 +83,10 @@ function buildIndicesExistsType (opts) {
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'HEAD'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -81,7 +94,6 @@ function buildIndicesExistsType (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'HEAD'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,16 @@
|
||||
function buildIndicesFlush (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -33,11 +43,6 @@ function buildIndicesFlush (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.flush request
|
||||
* Performs the flush operation on one or more indices.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html
|
||||
*/
|
||||
return function indicesFlush (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -50,6 +55,12 @@ function buildIndicesFlush (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -60,6 +71,10 @@ function buildIndicesFlush (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -68,10 +83,8 @@ function buildIndicesFlush (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_flush'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_flush'
|
||||
}
|
||||
|
||||
@ -79,7 +92,7 @@ function buildIndicesFlush (opts) {
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,14 @@
|
||||
function buildIndicesFlushSynced (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -30,11 +38,6 @@ function buildIndicesFlushSynced (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.flush_synced request
|
||||
* Performs a synced flush operation on one or more indices.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html
|
||||
*/
|
||||
return function indicesFlushSynced (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -47,6 +50,12 @@ function buildIndicesFlushSynced (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -57,6 +66,10 @@ function buildIndicesFlushSynced (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = body == null ? 'GET' : 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -65,10 +78,8 @@ function buildIndicesFlushSynced (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_flush' + '/' + 'synced'
|
||||
}
|
||||
|
||||
@ -76,7 +87,7 @@ function buildIndicesFlushSynced (opts) {
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildIndicesForcemerge (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -35,11 +46,6 @@ function buildIndicesForcemerge (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.forcemerge request
|
||||
* Performs the force merge operation on one or more indices.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html
|
||||
*/
|
||||
return function indicesForcemerge (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -52,6 +58,12 @@ function buildIndicesForcemerge (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -62,6 +74,10 @@ function buildIndicesForcemerge (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -70,10 +86,8 @@ function buildIndicesForcemerge (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null) {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_forcemerge'
|
||||
} else {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_forcemerge'
|
||||
}
|
||||
|
||||
@ -81,7 +95,7 @@ function buildIndicesForcemerge (opts) {
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
function buildIndicesFreeze (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -28,10 +39,6 @@ function buildIndicesFreeze (opts) {
|
||||
waitForActiveShards: 'wait_for_active_shards'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.freeze request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html
|
||||
*/
|
||||
return function indicesFreeze (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -49,6 +56,10 @@ function buildIndicesFreeze (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -60,6 +71,10 @@ function buildIndicesFreeze (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'POST'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -67,14 +82,13 @@ function buildIndicesFreeze (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_freeze'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
body: '',
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,19 @@
|
||||
function buildIndicesGet (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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: true)
|
||||
* @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',
|
||||
@ -39,11 +52,6 @@ function buildIndicesGet (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.get request
|
||||
* Returns information about one or more indices.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html
|
||||
*/
|
||||
return function indicesGet (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -61,6 +69,10 @@ function buildIndicesGet (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -72,6 +84,10 @@ function buildIndicesGet (opts) {
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -79,7 +95,6 @@ function buildIndicesGet (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index)
|
||||
|
||||
// build request object
|
||||
|
||||
@ -10,6 +10,16 @@
|
||||
function buildIndicesGetAlias (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -31,11 +41,6 @@ function buildIndicesGetAlias (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.get_alias request
|
||||
* Returns an alias.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
|
||||
*/
|
||||
return function indicesGetAlias (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -48,6 +53,12 @@ function buildIndicesGetAlias (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -55,9 +66,13 @@ function buildIndicesGetAlias (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, name, index, ...querystring } = params
|
||||
var { method, body, index, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -66,16 +81,12 @@ function buildIndicesGetAlias (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
|
||||
} else if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_alias' + '/' + encodeURIComponent(name)
|
||||
} else if ((index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_alias'
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_alias'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,19 @@
|
||||
function buildIndicesGetFieldMapping (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -35,11 +48,6 @@ function buildIndicesGetFieldMapping (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.get_field_mapping request
|
||||
* Returns mapping for one or more fields.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html
|
||||
*/
|
||||
return function indicesGetFieldMapping (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -57,6 +65,10 @@ function buildIndicesGetFieldMapping (opts) {
|
||||
const err = new ConfigurationError('Missing required parameter: fields')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
@ -65,9 +77,13 @@ function buildIndicesGetFieldMapping (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, fields, index, type, ...querystring } = params
|
||||
var { method, body, index, type, fields, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -76,16 +92,12 @@ function buildIndicesGetFieldMapping (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null && (fields) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
|
||||
} else if ((index) != null && (fields) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
|
||||
} else if ((type) != null && (fields) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,18 @@
|
||||
function buildIndicesGetMapping (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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.
|
||||
* @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',
|
||||
@ -35,11 +47,6 @@ function buildIndicesGetMapping (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.get_mapping request
|
||||
* Returns mappings for one or more indices.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html
|
||||
*/
|
||||
return function indicesGetMapping (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -52,6 +59,12 @@ function buildIndicesGetMapping (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -62,6 +75,10 @@ function buildIndicesGetMapping (opts) {
|
||||
var { method, body, index, type, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -70,16 +87,12 @@ function buildIndicesGetMapping (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (type) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
|
||||
} else if ((index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_mapping'
|
||||
} else if ((type) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_mapping' + '/' + encodeURIComponent(type)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_mapping'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,19 @@
|
||||
function buildIndicesGetSettings (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -37,11 +50,6 @@ function buildIndicesGetSettings (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.get_settings request
|
||||
* Returns settings for one or more indices.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html
|
||||
*/
|
||||
return function indicesGetSettings (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -54,6 +62,12 @@ function buildIndicesGetSettings (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -64,6 +78,10 @@ function buildIndicesGetSettings (opts) {
|
||||
var { method, body, index, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -72,16 +90,12 @@ function buildIndicesGetSettings (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((index) != null && (name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name)
|
||||
} else if ((index) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_settings'
|
||||
} else if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_settings' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_settings'
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,15 @@
|
||||
function buildIndicesGetTemplate (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = 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',
|
||||
@ -31,11 +40,6 @@ function buildIndicesGetTemplate (opts) {
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a indices.get_template request
|
||||
* Returns an index template.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
|
||||
*/
|
||||
return function indicesGetTemplate (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
@ -48,6 +52,12 @@ function buildIndicesGetTemplate (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params.body != null) {
|
||||
const err = new ConfigurationError('This API does not require a body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
@ -58,6 +68,10 @@ function buildIndicesGetTemplate (opts) {
|
||||
var { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
if (method == null) {
|
||||
method = 'GET'
|
||||
}
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
@ -66,10 +80,8 @@ function buildIndicesGetTemplate (opts) {
|
||||
var path = ''
|
||||
|
||||
if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_template' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_template'
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user