Compare commits

..

57 Commits

Author SHA1 Message Date
96137788db Bumped v7.0.0-rc.3 2019-05-06 12:05:27 +02:00
8136846a78 API generation 2019-05-06 12:04:41 +02:00
62e9805311 Updated installation instructions (#840) 2019-05-06 12:02:08 +02:00
907f9d085c Added User-Agent header (#807)
* Added User-Agent header

* Updated test

* Updated user-agent format

* Updated test
2019-05-06 09:59:55 +02:00
0c1fb22631 API generation 2019-05-03 19:03:34 +02:00
132072b8ab Simplify API wrappers (#839)
* Updated code generation

* API generation

* Updated test

* Updated code generation

* API generation

* API generation
2019-05-03 19:03:09 +02:00
99ada00747 API generation 2019-05-03 17:26:07 +02:00
b1458e3511 Improve observability (#834)
* API generation

* Added correlation id support

* Updated docs

* Updated test

* Updated code generation

* API generation

* Updated code generation

* Added support for client name and custom context object

* Updated docs

* Updated test

* Fix docs

* Updated docs

* Added id support also for sniffing

* Updated test

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Apply suggestions

* Update docs/configuration.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/configuration.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Apply suggestions

* Updated README.md

* Fixed test

* Addressed suggestions
2019-05-03 17:25:25 +02:00
9dacd9d9ee Better handling of hostname/ip:port format (#837)
* Better handling of hostname/ip:port format

* Updated test
2019-05-03 17:25:04 +02:00
d6577b7fa1 Updated installation instructions (#835)
* Updated installation instructions

* Added a note about Elasticsearch master
2019-05-03 17:25:04 +02:00
ddb72d6e50 Fix resurrect timeout formula (#833)
* Fixes #827

* Updated test
2019-04-29 09:19:53 +02:00
9bb2d237e4 Node v12 and bumped dependencies (#832)
* Node v12

* Bumped dependencies

* Disable automatic code coverage
2019-04-26 17:26:14 +02:00
4099532617 Updated .travis.yml (#831) 2019-04-26 15:04:17 +02:00
37544399ce API generation 2019-04-26 15:03:20 +02:00
12e88d6f87 Support for deprecated paths (#828)
* Updated code generation

* API generation

* Updated test
2019-04-26 15:02:49 +02:00
dbfeb5d1a9 Update RequestEvent to use parameterized type T (#822)
Updated `RequestEvent` to use parameterized type `T`.  In reference to:

https://github.com/elastic/elasticsearch-js/pull/819#issuecomment-484594841
2019-04-19 10:07:17 +02:00
84a837ce11 Bumped v7.0.0-rc.2 2019-04-17 14:16:43 +02:00
dc009dc3a5 Use Elasticsearch 7.0.0 (#820) 2019-04-17 14:13:04 +02:00
d4f4b47d7e Updated typings (#819) 2019-04-17 11:24:28 +02:00
cfd4e70fb9 Drop Node.js v6 support (#818)
Node.js v6 will go EOL at the end of April 2019, and already two of the production dependencies of the client have already dropped support for it, and soon others will do *(as well as development dependencies)*.

Furthermore, since Node.js will go in EOL it will never get security patches, plus, also OpenSSL-1.0.2 will go EOL [this year](https://github.com/nodejs/Release#release-schedule); to avoid risks for the client users it is better to drop support for Node.js v6 right away.
2019-04-17 11:24:28 +02:00
68f8b7bb5f Fix a typo in usage example (#806) 2019-04-11 08:27:57 +02:00
777e438482 API generation 2019-04-10 11:44:12 +02:00
29beb44bf5 Improve typings (#813)
The ApiResponse now accepts a generics that defaults to any, same for every API method that might need a body.
2019-04-10 11:43:14 +02:00
ef3126b361 Custom http agent support (#810) 2019-04-10 11:42:51 +02:00
6cc2b21ce2 Use Elasticsearch 7.0.0-rc2 2019-04-09 12:10:10 +02:00
02c656c364 Support for publish_address as hostname/ip:port (#804) 2019-04-09 12:06:22 +02:00
77fcca871f Updated README.md 2019-04-01 09:50:23 +02:00
ca0b33a2b0 Handle bulk errors in examples 2019-04-01 09:08:58 +02:00
74c37e5b2d Generated reference 2019-03-29 18:08:28 +01:00
0e47cb88eb Docs: Fix ingest doc links (#801)
The ingest docs in Elasticsearch doing point to the actual ingest APIs.
This makes up generate links to the real APIs instead, fixing some
broken links in the 5.x docs in the process.
2019-03-29 18:07:55 +01:00
f97208214e Generated reference 2019-03-29 15:46:44 +01:00
6f4a8bbe6a Docs: Handle more funny cases from ES api spec (#800)
Handles a few "special" doc urls from ES's api spec files. These are
only a problem in 6.x but we'd like to keep the generateDocs script the
same across all branches for easier backporting.
2019-03-29 15:46:17 +01:00
c0264393a1 Update asciidoc config 2019-03-29 15:41:57 +01:00
92bcf46ab4 Generated reference 2019-03-29 08:51:54 +01:00
af544e8a55 Docs: Fix the API reference (#799) 2019-03-29 08:50:57 +01:00
fbf804869f Bumped v7.0.0-rc.1 2019-03-28 19:28:09 +01:00
f3422a6f43 Fix docs (#796)
Follow up of https://github.com/elastic/docs/pull/701.
2019-03-28 17:36:08 +01:00
f2c43a843b Updated CONTRIBUTING.md (#794)
As titled, also renamed the script files for a better DX.
2019-03-28 10:11:04 +01:00
1f6c68df9c v7.0.0-rc1 support 🚀 (#792)
Support for Elasticsearch `v7.0.0-rc1`
2019-03-28 08:32:24 +01:00
c7675708de Added CONTRIBUTING.md and CODE_OF_CONDUCT.md 2019-03-27 16:48:12 +01:00
e897d8f050 Improved integration test runner 2019-03-27 15:00:21 +01:00
4537308c38 Doc updates (#791)
Updates for better displaying the documentation in the website.
2019-03-27 07:45:31 +01:00
3a1bb9377a Merge branch 'master' into 7.x 2019-03-26 12:06:04 +01:00
e185a0b08c Remove url in jenkins job configuration 2019-03-21 11:16:21 -04:00
9b111ee664 CI config (#786)
* Updated ci config

* Minor fixes

* Minor fixes

* Added Node v11
2019-03-21 11:03:35 +01:00
367f16c0ba Updated ci config 2019-03-19 14:16:56 +01:00
1d61cba014 Inspect Connection (#784)
Handles `console.log` and `utils.inspect` invocations for a better debugging experience.

`agent` and `ssl` are hidden since they made the logs very hard to read.
The user can still access them with `instance.agent` and `instance.ssl`.
2019-03-19 09:53:43 +01:00
358474bca8 Feat: Support bundlers (#783)
With this change, we support code bundlers, such as webpack.
Fixes: https://github.com/elastic/elasticsearch-js/issues/781
2019-03-19 09:53:43 +01:00
c0027b3958 Added a note about the new client 2019-03-19 09:53:43 +01:00
68c4dd29fb feat: add support for querystring in options object (#779)
In very few cases, some API uses the same key for both url and query params, such as the bulk method.
The client is not designed to handle such cases since accepts both url and query keys in the same object, and the url parameter will always take precedence.
This pr fixes this edge case by adding a `querystring` key in the options object.

Fixes: https://github.com/elastic/elasticsearch-js/pull/778

```js
client.bulk({
  index: 'index',
  type: '_doc',
  body: [...]
}, {
  querystring: {
    type: '_doc'
  }
}, console.log)
```
2019-03-19 09:53:43 +01:00
a3e3d57247 Updated coverage script 2019-03-15 17:49:24 +01:00
c3966cacab Added codecov badge 2019-03-15 17:49:24 +01:00
048933f106 Updated ignore files 2019-03-15 17:49:24 +01:00
91935905b6 Added codecov (#777) 2019-03-15 17:49:24 +01:00
0f5ac8127c Updated README 2019-03-14 18:33:22 +01:00
99e1dc3b39 API generation 2019-03-13 14:13:53 +01:00
e98cab1a34 Revert d4d7d0bef5 2019-03-13 14:13:32 +01:00
158 changed files with 1711 additions and 2305 deletions

View File

@ -22,7 +22,7 @@ services:
- elasticsearch-oss
elasticsearch-oss:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:${ELASTICSEARCH_VERSION:-6.6.2}
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
volumes:
- esvol:/tmp
networks:
@ -58,7 +58,7 @@ services:
command: ["npm", "run", "test:integration"]
elasticsearch-platinum:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-6.6.2}
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
ports:
- "9200:9200"
networks:

View File

@ -1,6 +1,6 @@
---
ELASTICSEARCH_VERSION:
- 6.7.1
- 7.0.0
NODE_JS_VERSION:
- 12

View File

@ -35,7 +35,6 @@ function buildBulk (opts) {
* @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
@ -49,12 +48,9 @@ function buildBulk (opts) {
'routing',
'timeout',
'type',
'fields',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'pipeline',
'pretty',
'human',
@ -66,9 +62,7 @@ function buildBulk (opts) {
const snakeCase = {
waitForActiveShards: 'wait_for_active_shards',
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceInclude: '_source_include',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -51,6 +51,12 @@ 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}`)

View File

@ -86,10 +86,6 @@ function buildCreate (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)
@ -116,7 +112,11 @@ function buildCreate (opts) {
var path = ''
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id)
}
// build request object
const request = {

View File

@ -89,24 +89,11 @@ 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') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
@ -128,7 +115,11 @@ function buildDelete (opts) {
var path = ''
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {

View File

@ -86,9 +86,7 @@ function buildDeleteByQuery (opts) {
'sort',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'terminate_after',
'stats',
'version',
@ -116,9 +114,7 @@ function buildDeleteByQuery (opts) {
searchType: 'search_type',
searchTimeout: 'search_timeout',
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceInclude: '_source_include',
terminateAfter: 'terminate_after',
requestCache: 'request_cache',
waitForActiveShards: 'wait_for_active_shards',

View File

@ -53,9 +53,7 @@ function buildExists (opts) {
'routing',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'version',
'version_type',
'pretty',
@ -68,9 +66,7 @@ function buildExists (opts) {
const snakeCase = {
storedFields: 'stored_fields',
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceInclude: '_source_include',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
@ -97,10 +93,6 @@ 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)
@ -127,7 +119,11 @@ function buildExists (opts) {
var path = ''
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {

View File

@ -30,7 +30,7 @@ function buildExistsSource (opts) {
*
* @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} type - The type of the document; deprecated and optional starting with 7.0
* @param {string} parent - The ID of the parent document
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
* @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
@ -51,9 +51,7 @@ function buildExistsSource (opts) {
'routing',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'version',
'version_type',
'pretty',
@ -65,9 +63,7 @@ function buildExistsSource (opts) {
const snakeCase = {
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceInclude: '_source_include',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
@ -94,10 +90,6 @@ 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)
@ -133,7 +125,11 @@ function buildExistsSource (opts) {
var path = ''
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
// build request object
const request = {

View File

@ -60,9 +60,7 @@ function buildExplain (opts) {
'routing',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'pretty',
'human',
'error_trace',
@ -75,9 +73,7 @@ function buildExplain (opts) {
defaultOperator: 'default_operator',
storedFields: 'stored_fields',
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceInclude: '_source_include',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
@ -103,10 +99,6 @@ 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') {
@ -129,7 +121,11 @@ function buildExplain (opts) {
var path = ''
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
}
// build request object
const request = {

View File

@ -33,7 +33,6 @@ function buildFieldCaps (opts) {
* @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 = [
@ -68,6 +67,12 @@ function buildFieldCaps (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}`)
@ -99,7 +104,7 @@ function buildFieldCaps (opts) {
const request = {
method,
path,
body: body || '',
body: '',
querystring
}

View File

@ -55,9 +55,7 @@ function buildGet (opts) {
'routing',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'_source_exclude',
'_source_include',
'version',
@ -72,8 +70,8 @@ function buildGet (opts) {
const snakeCase = {
storedFields: 'stored_fields',
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceExclude: '_source_exclude',
_sourceInclude: '_source_include',
versionType: 'version_type',
errorTrace: 'error_trace',
@ -101,10 +99,6 @@ 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)
@ -131,7 +125,11 @@ function buildGet (opts) {
var path = ''
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {

View File

@ -30,7 +30,7 @@ function buildGetSource (opts) {
*
* @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} type - The type of the document; deprecated and optional starting with 7.0
* @param {string} parent - The ID of the parent document
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
* @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
@ -51,9 +51,7 @@ function buildGetSource (opts) {
'routing',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'version',
'version_type',
'pretty',
@ -65,9 +63,7 @@ function buildGetSource (opts) {
const snakeCase = {
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceInclude: '_source_include',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
@ -94,10 +90,6 @@ 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)
@ -124,7 +116,11 @@ function buildGetSource (opts) {
var path = ''
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
// build request object
const request = {

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackGraphExplore (opts) {
function buildGraphExplore (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.graph.explore](https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html) request
* Perform a [graph.explore](https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html) request
*
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
@ -44,7 +44,7 @@ function buildXpackGraphExplore (opts) {
}
return function xpackGraphExplore (params, options, callback) {
return function graphExplore (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -84,9 +84,9 @@ function buildXpackGraphExplore (opts) {
var path = ''
if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_xpack' + '/' + 'graph' + '/' + '_explore'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_xpack' + '/' + 'graph' + '/' + '_explore'
path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore'
}
// build request object
@ -102,4 +102,4 @@ function buildXpackGraphExplore (opts) {
}
}
module.exports = buildXpackGraphExplore
module.exports = buildGraphExplore

View File

@ -29,11 +29,10 @@ function buildIlmExplainLifecycle (opts) {
* Perform a [ilm.explain_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html) request
*
* @param {string} index - The name of the index to explain
* @param {boolean} human - Return data such as dates in a human readable format
*/
const acceptedQuerystring = [
'human'
]
const snakeCase = {

View File

@ -91,24 +91,11 @@ 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}`)
@ -132,8 +119,12 @@ function buildIndex (opts) {
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
} else if ((index) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
} else if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc'
}
// build request object

View File

@ -29,7 +29,6 @@ function buildIndicesClearCache (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
@ -37,12 +36,10 @@ function buildIndicesClearCache (opts) {
* @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',
@ -50,7 +47,6 @@ function buildIndicesClearCache (opts) {
'allow_no_indices',
'expand_wildcards',
'index',
'request_cache',
'request',
'pretty',
'human',
@ -60,11 +56,9 @@ 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'
}
@ -98,7 +92,7 @@ function buildIndicesClearCache (opts) {
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = body == null ? 'GET' : 'POST'
method = 'POST'
}
var ignore = options.ignore

View File

@ -33,7 +33,6 @@ function buildIndicesCreate (opts) {
* @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`)
*/
@ -42,7 +41,6 @@ function buildIndicesCreate (opts) {
'wait_for_active_shards',
'timeout',
'master_timeout',
'update_all_types',
'pretty',
'human',
'error_trace',
@ -54,7 +52,6 @@ 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'
}

View File

@ -29,7 +29,7 @@ function buildIndicesGet (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} include_type_name - Whether to add the type name to the response (default: false)
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {boolean} ignore_unavailable - Ignore unavailable indexes (default: false)
* @param {boolean} allow_no_indices - Ignore if a wildcard expression resolves to no concrete indices (default: false)

View File

@ -30,7 +30,7 @@ function buildIndicesGetMapping (opts) {
*
* @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} include_type_name - Whether to add the type name to the response (default: false)
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.

View File

@ -36,7 +36,6 @@ function buildIndicesPutMapping (opts) {
* @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} update_all_types - Whether to update the mapping for all fields with the same name across all types or not
* @param {object} body - The mapping definition
*/
@ -47,7 +46,6 @@ function buildIndicesPutMapping (opts) {
'ignore_unavailable',
'allow_no_indices',
'expand_wildcards',
'update_all_types',
'pretty',
'human',
'error_trace',
@ -61,7 +59,6 @@ function buildIndicesPutMapping (opts) {
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
updateAllTypes: 'update_all_types',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlDeleteExpiredData (opts) {
function buildLicenseDelete (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.delete_expired_data](undefined) request
* Perform a [license.delete](https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html) request
*
*/
@ -38,7 +38,7 @@ function buildXpackMlDeleteExpiredData (opts) {
}
return function xpackMlDeleteExpiredData (params, options, callback) {
return function licenseDelete (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -77,7 +77,7 @@ function buildXpackMlDeleteExpiredData (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + '_delete_expired_data'
path = '/' + '_license'
// build request object
const request = {
@ -92,4 +92,4 @@ function buildXpackMlDeleteExpiredData (opts) {
}
}
module.exports = buildXpackMlDeleteExpiredData
module.exports = buildLicenseDelete

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicenseGet (opts) {
function buildLicenseGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.license.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/get-license.html) request
* Perform a [license.get](https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html) request
*
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
*/
@ -39,7 +39,7 @@ function buildXpackLicenseGet (opts) {
}
return function xpackLicenseGet (params, options, callback) {
return function licenseGet (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -78,7 +78,7 @@ function buildXpackLicenseGet (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'license'
path = '/' + '_license'
// build request object
const request = {
@ -93,4 +93,4 @@ function buildXpackLicenseGet (opts) {
}
}
module.exports = buildXpackLicenseGet
module.exports = buildLicenseGet

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicenseGetTrialStatus (opts) {
function buildLicenseGetBasicStatus (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.license.get_trial_status](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/get-basic-status.html) request
* Perform a [license.get_basic_status](https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html) request
*
*/
@ -38,7 +38,7 @@ function buildXpackLicenseGetTrialStatus (opts) {
}
return function xpackLicenseGetTrialStatus (params, options, callback) {
return function licenseGetBasicStatus (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -77,7 +77,7 @@ function buildXpackLicenseGetTrialStatus (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'license' + '/' + 'trial_status'
path = '/' + '_license' + '/' + 'basic_status'
// build request object
const request = {
@ -92,4 +92,4 @@ function buildXpackLicenseGetTrialStatus (opts) {
}
}
module.exports = buildXpackLicenseGetTrialStatus
module.exports = buildLicenseGetBasicStatus

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicenseGetBasicStatus (opts) {
function buildLicenseGetTrialStatus (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.license.get_basic_status](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/get-trial-status.html) request
* Perform a [license.get_trial_status](https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html) request
*
*/
@ -38,7 +38,7 @@ function buildXpackLicenseGetBasicStatus (opts) {
}
return function xpackLicenseGetBasicStatus (params, options, callback) {
return function licenseGetTrialStatus (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -77,7 +77,7 @@ function buildXpackLicenseGetBasicStatus (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'license' + '/' + 'basic_status'
path = '/' + '_license' + '/' + 'trial_status'
// build request object
const request = {
@ -92,4 +92,4 @@ function buildXpackLicenseGetBasicStatus (opts) {
}
}
module.exports = buildXpackLicenseGetBasicStatus
module.exports = buildLicenseGetTrialStatus

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicensePost (opts) {
function buildLicensePost (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.license.post](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/update-license.html) request
* Perform a [license.post](https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html) request
*
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
* @param {object} body - licenses to be installed
@ -40,7 +40,7 @@ function buildXpackLicensePost (opts) {
}
return function xpackLicensePost (params, options, callback) {
return function licensePost (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -73,7 +73,7 @@ function buildXpackLicensePost (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'license'
path = '/' + '_license'
// build request object
const request = {
@ -88,4 +88,4 @@ function buildXpackLicensePost (opts) {
}
}
module.exports = buildXpackLicensePost
module.exports = buildLicensePost

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicensePostStartBasic (opts) {
function buildLicensePostStartBasic (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.license.post_start_basic](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/start-basic.html) request
* Perform a [license.post_start_basic](https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html) request
*
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
*/
@ -39,7 +39,7 @@ function buildXpackLicensePostStartBasic (opts) {
}
return function xpackLicensePostStartBasic (params, options, callback) {
return function licensePostStartBasic (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -78,7 +78,7 @@ function buildXpackLicensePostStartBasic (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'license' + '/' + 'start_basic'
path = '/' + '_license' + '/' + 'start_basic'
// build request object
const request = {
@ -93,4 +93,4 @@ function buildXpackLicensePostStartBasic (opts) {
}
}
module.exports = buildXpackLicensePostStartBasic
module.exports = buildLicensePostStartBasic

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicensePostStartTrial (opts) {
function buildLicensePostStartTrial (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.license.post_start_trial](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/start-trial.html) request
* Perform a [license.post_start_trial](https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html) request
*
* @param {string} type - The type of trial license to generate (default: "trial")
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
@ -41,7 +41,7 @@ function buildXpackLicensePostStartTrial (opts) {
}
return function xpackLicensePostStartTrial (params, options, callback) {
return function licensePostStartTrial (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,7 +80,7 @@ function buildXpackLicensePostStartTrial (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'license' + '/' + 'start_trial'
path = '/' + '_license' + '/' + 'start_trial'
// build request object
const request = {
@ -95,4 +95,4 @@ function buildXpackLicensePostStartTrial (opts) {
}
}
module.exports = buildXpackLicensePostStartTrial
module.exports = buildLicensePostStartTrial

View File

@ -49,9 +49,7 @@ function buildMget (opts) {
'routing',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'pretty',
'human',
'error_trace',
@ -62,9 +60,7 @@ function buildMget (opts) {
const snakeCase = {
storedFields: 'stored_fields',
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceInclude: '_source_include',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMigrationDeprecations (opts) {
function buildMigrationDeprecations (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.migration.deprecations](http://www.elastic.co/guide/en/elasticsearch/reference/6.7/migration-api-deprecation.html) request
* Perform a [migration.deprecations](http://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html) request
*
* @param {string} index - Index pattern
*/
@ -39,7 +39,7 @@ function buildXpackMigrationDeprecations (opts) {
}
return function xpackMigrationDeprecations (params, options, callback) {
return function migrationDeprecations (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -79,9 +79,9 @@ function buildXpackMigrationDeprecations (opts) {
var path = ''
if ((index) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_xpack' + '/' + 'migration' + '/' + 'deprecations'
path = '/' + encodeURIComponent(index) + '/' + '_migration' + '/' + 'deprecations'
} else {
path = '/' + '_xpack' + '/' + 'migration' + '/' + 'deprecations'
path = '/' + '_migration' + '/' + 'deprecations'
}
// build request object
@ -97,4 +97,4 @@ function buildXpackMigrationDeprecations (opts) {
}
}
module.exports = buildXpackMigrationDeprecations
module.exports = buildMigrationDeprecations

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlCloseJob (opts) {
function buildMlCloseJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.close_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html) request
* Perform a [ml.close_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html) request
*
* @param {string} job_id - The name of the job to close
* @param {boolean} allow_no_jobs - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
@ -46,7 +46,7 @@ function buildXpackMlCloseJob (opts) {
}
return function xpackMlCloseJob (params, options, callback) {
return function mlCloseJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -85,7 +85,7 @@ function buildXpackMlCloseJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_close'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_close'
// build request object
const request = {
@ -100,4 +100,4 @@ function buildXpackMlCloseJob (opts) {
}
}
module.exports = buildXpackMlCloseJob
module.exports = buildMlCloseJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlDeleteCalendar (opts) {
function buildMlDeleteCalendar (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.delete_calendar](undefined) request
* Perform a [ml.delete_calendar](undefined) request
*
* @param {string} calendar_id - The ID of the calendar to delete
*/
@ -39,7 +39,7 @@ function buildXpackMlDeleteCalendar (opts) {
}
return function xpackMlDeleteCalendar (params, options, callback) {
return function mlDeleteCalendar (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -82,7 +82,7 @@ function buildXpackMlDeleteCalendar (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
// build request object
const request = {
@ -97,4 +97,4 @@ function buildXpackMlDeleteCalendar (opts) {
}
}
module.exports = buildXpackMlDeleteCalendar
module.exports = buildMlDeleteCalendar

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlDeleteCalendarEvent (opts) {
function buildMlDeleteCalendarEvent (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.delete_calendar_event](undefined) request
* Perform a [ml.delete_calendar_event](undefined) request
*
* @param {string} calendar_id - The ID of the calendar to modify
* @param {string} event_id - The ID of the event to remove from the calendar
@ -40,7 +40,7 @@ function buildXpackMlDeleteCalendarEvent (opts) {
}
return function xpackMlDeleteCalendarEvent (params, options, callback) {
return function mlDeleteCalendarEvent (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -93,7 +93,7 @@ function buildXpackMlDeleteCalendarEvent (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events' + '/' + encodeURIComponent(event_id || eventId)
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events' + '/' + encodeURIComponent(event_id || eventId)
// build request object
const request = {
@ -108,4 +108,4 @@ function buildXpackMlDeleteCalendarEvent (opts) {
}
}
module.exports = buildXpackMlDeleteCalendarEvent
module.exports = buildMlDeleteCalendarEvent

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlDeleteCalendarJob (opts) {
function buildMlDeleteCalendarJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.delete_calendar_job](undefined) request
* Perform a [ml.delete_calendar_job](undefined) request
*
* @param {string} calendar_id - The ID of the calendar to modify
* @param {string} job_id - The ID of the job to remove from the calendar
@ -40,7 +40,7 @@ function buildXpackMlDeleteCalendarJob (opts) {
}
return function xpackMlDeleteCalendarJob (params, options, callback) {
return function mlDeleteCalendarJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -93,7 +93,7 @@ function buildXpackMlDeleteCalendarJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId)
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId)
// build request object
const request = {
@ -108,4 +108,4 @@ function buildXpackMlDeleteCalendarJob (opts) {
}
}
module.exports = buildXpackMlDeleteCalendarJob
module.exports = buildMlDeleteCalendarJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlDeleteDatafeed (opts) {
function buildMlDeleteDatafeed (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.delete_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html) request
* Perform a [ml.delete_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html) request
*
* @param {string} datafeed_id - The ID of the datafeed to delete
* @param {boolean} force - True if the datafeed should be forcefully deleted
@ -40,7 +40,7 @@ function buildXpackMlDeleteDatafeed (opts) {
}
return function xpackMlDeleteDatafeed (params, options, callback) {
return function mlDeleteDatafeed (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackMlDeleteDatafeed (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackMlDeleteDatafeed (opts) {
}
}
module.exports = buildXpackMlDeleteDatafeed
module.exports = buildMlDeleteDatafeed

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackLicenseDelete (opts) {
function buildMlDeleteExpiredData (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.license.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/delete-license.html) request
* Perform a [ml.delete_expired_data](undefined) request
*
*/
@ -38,7 +38,7 @@ function buildXpackLicenseDelete (opts) {
}
return function xpackLicenseDelete (params, options, callback) {
return function mlDeleteExpiredData (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -77,7 +77,7 @@ function buildXpackLicenseDelete (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'license'
path = '/' + '_ml' + '/' + '_delete_expired_data'
// build request object
const request = {
@ -92,4 +92,4 @@ function buildXpackLicenseDelete (opts) {
}
}
module.exports = buildXpackLicenseDelete
module.exports = buildMlDeleteExpiredData

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlDeleteFilter (opts) {
function buildMlDeleteFilter (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.delete_filter](undefined) request
* Perform a [ml.delete_filter](undefined) request
*
* @param {string} filter_id - The ID of the filter to delete
*/
@ -39,7 +39,7 @@ function buildXpackMlDeleteFilter (opts) {
}
return function xpackMlDeleteFilter (params, options, callback) {
return function mlDeleteFilter (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -82,7 +82,7 @@ function buildXpackMlDeleteFilter (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
// build request object
const request = {
@ -97,4 +97,4 @@ function buildXpackMlDeleteFilter (opts) {
}
}
module.exports = buildXpackMlDeleteFilter
module.exports = buildMlDeleteFilter

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlDeleteForecast (opts) {
function buildMlDeleteForecast (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.delete_forecast](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html) request
* Perform a [ml.delete_forecast](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html) request
*
* @param {string} job_id - The ID of the job from which to delete forecasts
* @param {string} forecast_id - The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all`
@ -44,7 +44,7 @@ function buildXpackMlDeleteForecast (opts) {
}
return function xpackMlDeleteForecast (params, options, callback) {
return function mlDeleteForecast (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -94,9 +94,9 @@ function buildXpackMlDeleteForecast (opts) {
var path = ''
if ((job_id || jobId) != null && (forecast_id || forecastId) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast' + '/' + encodeURIComponent(forecast_id || forecastId)
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast' + '/' + encodeURIComponent(forecast_id || forecastId)
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast'
}
// build request object
@ -112,4 +112,4 @@ function buildXpackMlDeleteForecast (opts) {
}
}
module.exports = buildXpackMlDeleteForecast
module.exports = buildMlDeleteForecast

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlDeleteJob (opts) {
function buildMlDeleteJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.delete_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html) request
* Perform a [ml.delete_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html) request
*
* @param {string} job_id - The ID of the job to delete
* @param {boolean} force - True if the job should be forcefully deleted
@ -42,7 +42,7 @@ function buildXpackMlDeleteJob (opts) {
waitForCompletion: 'wait_for_completion'
}
return function xpackMlDeleteJob (params, options, callback) {
return function mlDeleteJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -85,7 +85,7 @@ function buildXpackMlDeleteJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
// build request object
const request = {
@ -100,4 +100,4 @@ function buildXpackMlDeleteJob (opts) {
}
}
module.exports = buildXpackMlDeleteJob
module.exports = buildMlDeleteJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlDeleteModelSnapshot (opts) {
function buildMlDeleteModelSnapshot (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.delete_model_snapshot](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html) request
* Perform a [ml.delete_model_snapshot](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html) request
*
* @param {string} job_id - The ID of the job to fetch
* @param {string} snapshot_id - The ID of the snapshot to delete
@ -40,7 +40,7 @@ function buildXpackMlDeleteModelSnapshot (opts) {
}
return function xpackMlDeleteModelSnapshot (params, options, callback) {
return function mlDeleteModelSnapshot (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -93,7 +93,7 @@ function buildXpackMlDeleteModelSnapshot (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId)
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId)
// build request object
const request = {
@ -108,4 +108,4 @@ function buildXpackMlDeleteModelSnapshot (opts) {
}
}
module.exports = buildXpackMlDeleteModelSnapshot
module.exports = buildMlDeleteModelSnapshot

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlFindFileStructure (opts) {
function buildMlFindFileStructure (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.find_file_structure](http://www.elastic.co/guide/en/elasticsearch/reference/6.7/ml-find-file-structure.html) request
* Perform a [ml.find_file_structure](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html) request
*
* @param {int} lines_to_sample - How many lines of the file should be included in the analysis
* @param {time} timeout - Timeout after which the analysis will be aborted
@ -71,7 +71,7 @@ function buildXpackMlFindFileStructure (opts) {
}
return function xpackMlFindFileStructure (params, options, callback) {
return function mlFindFileStructure (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -110,7 +110,7 @@ function buildXpackMlFindFileStructure (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'find_file_structure'
path = '/' + '_ml' + '/' + 'find_file_structure'
// build request object
const request = {
@ -125,4 +125,4 @@ function buildXpackMlFindFileStructure (opts) {
}
}
module.exports = buildXpackMlFindFileStructure
module.exports = buildMlFindFileStructure

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlFlushJob (opts) {
function buildMlFlushJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.flush_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html) request
* Perform a [ml.flush_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html) request
*
* @param {string} job_id - The name of the job to flush
* @param {boolean} calc_interim - Calculates interim results for the most recent bucket or all buckets within the latency period
@ -51,7 +51,7 @@ function buildXpackMlFlushJob (opts) {
skipTime: 'skip_time'
}
return function xpackMlFlushJob (params, options, callback) {
return function mlFlushJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -90,7 +90,7 @@ function buildXpackMlFlushJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_flush'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_flush'
// build request object
const request = {
@ -105,4 +105,4 @@ function buildXpackMlFlushJob (opts) {
}
}
module.exports = buildXpackMlFlushJob
module.exports = buildMlFlushJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlForecast (opts) {
function buildMlForecast (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.forecast](undefined) request
* Perform a [ml.forecast](undefined) request
*
* @param {string} job_id - The ID of the job to forecast for
* @param {time} duration - The duration of the forecast
@ -42,7 +42,7 @@ function buildXpackMlForecast (opts) {
expiresIn: 'expires_in'
}
return function xpackMlForecast (params, options, callback) {
return function mlForecast (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -85,7 +85,7 @@ function buildXpackMlForecast (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast'
// build request object
const request = {
@ -100,4 +100,4 @@ function buildXpackMlForecast (opts) {
}
}
module.exports = buildXpackMlForecast
module.exports = buildMlForecast

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetBuckets (opts) {
function buildMlGetBuckets (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_buckets](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html) request
* Perform a [ml.get_buckets](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html) request
*
* @param {string} job_id - ID of the job to get bucket results from
* @param {string} timestamp - The timestamp of the desired single bucket result
@ -60,7 +60,7 @@ function buildXpackMlGetBuckets (opts) {
}
return function xpackMlGetBuckets (params, options, callback) {
return function mlGetBuckets (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -106,9 +106,9 @@ function buildXpackMlGetBuckets (opts) {
var path = ''
if ((job_id || jobId) != null && (timestamp) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets' + '/' + encodeURIComponent(timestamp)
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets' + '/' + encodeURIComponent(timestamp)
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets'
}
// build request object
@ -124,4 +124,4 @@ function buildXpackMlGetBuckets (opts) {
}
}
module.exports = buildXpackMlGetBuckets
module.exports = buildMlGetBuckets

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetCalendarEvents (opts) {
function buildMlGetCalendarEvents (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_calendar_events](undefined) request
* Perform a [ml.get_calendar_events](undefined) request
*
* @param {string} calendar_id - The ID of the calendar containing the events
* @param {string} job_id - Get events for the job. When this option is used calendar_id must be '_all'
@ -49,7 +49,7 @@ function buildXpackMlGetCalendarEvents (opts) {
}
return function xpackMlGetCalendarEvents (params, options, callback) {
return function mlGetCalendarEvents (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -92,7 +92,7 @@ function buildXpackMlGetCalendarEvents (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
// build request object
const request = {
@ -107,4 +107,4 @@ function buildXpackMlGetCalendarEvents (opts) {
}
}
module.exports = buildXpackMlGetCalendarEvents
module.exports = buildMlGetCalendarEvents

View File

@ -22,15 +22,16 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetCalendars (opts) {
function buildMlGetCalendars (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_calendars](undefined) request
* Perform a [ml.get_calendars](undefined) request
*
* @param {string} calendar_id - The ID of the calendar to fetch
* @param {int} from - skips a number of calendars
* @param {int} size - specifies a max number of calendars to get
* @param {object} body - The from and size parameters optionally sent in the body
*/
const acceptedQuerystring = [
@ -42,7 +43,7 @@ function buildXpackMlGetCalendars (opts) {
}
return function xpackMlGetCalendars (params, options, callback) {
return function mlGetCalendars (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -54,12 +55,6 @@ function buildXpackMlGetCalendars (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}`)
@ -82,16 +77,16 @@ function buildXpackMlGetCalendars (opts) {
var path = ''
if ((calendar_id || calendarId) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars'
path = '/' + '_ml' + '/' + 'calendars'
}
// build request object
const request = {
method,
path,
body: '',
body: body || '',
querystring
}
@ -100,4 +95,4 @@ function buildXpackMlGetCalendars (opts) {
}
}
module.exports = buildXpackMlGetCalendars
module.exports = buildMlGetCalendars

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetCategories (opts) {
function buildMlGetCategories (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_categories](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html) request
* Perform a [ml.get_categories](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html) request
*
* @param {string} job_id - The name of the job
* @param {long} category_id - The identifier of the category definition of interest
@ -44,7 +44,7 @@ function buildXpackMlGetCategories (opts) {
}
return function xpackMlGetCategories (params, options, callback) {
return function mlGetCategories (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -84,9 +84,9 @@ function buildXpackMlGetCategories (opts) {
var path = ''
if ((job_id || jobId) != null && (category_id || categoryId) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories' + '/' + encodeURIComponent(category_id || categoryId)
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories' + '/' + encodeURIComponent(category_id || categoryId)
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories'
}
// build request object
@ -102,4 +102,4 @@ function buildXpackMlGetCategories (opts) {
}
}
module.exports = buildXpackMlGetCategories
module.exports = buildMlGetCategories

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetDatafeedStats (opts) {
function buildMlGetDatafeedStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_datafeed_stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html) request
* Perform a [ml.get_datafeed_stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html) request
*
* @param {string} datafeed_id - The ID of the datafeeds stats to fetch
* @param {boolean} allow_no_datafeeds - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
@ -40,7 +40,7 @@ function buildXpackMlGetDatafeedStats (opts) {
allowNoDatafeeds: 'allow_no_datafeeds'
}
return function xpackMlGetDatafeedStats (params, options, callback) {
return function mlGetDatafeedStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,9 +80,9 @@ function buildXpackMlGetDatafeedStats (opts) {
var path = ''
if ((datafeed_id || datafeedId) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stats'
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stats'
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + '_stats'
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + '_stats'
}
// build request object
@ -98,4 +98,4 @@ function buildXpackMlGetDatafeedStats (opts) {
}
}
module.exports = buildXpackMlGetDatafeedStats
module.exports = buildMlGetDatafeedStats

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetDatafeeds (opts) {
function buildMlGetDatafeeds (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_datafeeds](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html) request
* Perform a [ml.get_datafeeds](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html) request
*
* @param {string} datafeed_id - The ID of the datafeeds to fetch
* @param {boolean} allow_no_datafeeds - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
@ -40,7 +40,7 @@ function buildXpackMlGetDatafeeds (opts) {
allowNoDatafeeds: 'allow_no_datafeeds'
}
return function xpackMlGetDatafeeds (params, options, callback) {
return function mlGetDatafeeds (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,9 +80,9 @@ function buildXpackMlGetDatafeeds (opts) {
var path = ''
if ((datafeed_id || datafeedId) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds'
path = '/' + '_ml' + '/' + 'datafeeds'
}
// build request object
@ -98,4 +98,4 @@ function buildXpackMlGetDatafeeds (opts) {
}
}
module.exports = buildXpackMlGetDatafeeds
module.exports = buildMlGetDatafeeds

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetFilters (opts) {
function buildMlGetFilters (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_filters](undefined) request
* Perform a [ml.get_filters](undefined) request
*
* @param {string} filter_id - The ID of the filter to fetch
* @param {int} from - skips a number of filters
@ -42,7 +42,7 @@ function buildXpackMlGetFilters (opts) {
}
return function xpackMlGetFilters (params, options, callback) {
return function mlGetFilters (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -82,9 +82,9 @@ function buildXpackMlGetFilters (opts) {
var path = ''
if ((filter_id || filterId) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'filters'
path = '/' + '_ml' + '/' + 'filters'
}
// build request object
@ -100,4 +100,4 @@ function buildXpackMlGetFilters (opts) {
}
}
module.exports = buildXpackMlGetFilters
module.exports = buildMlGetFilters

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetInfluencers (opts) {
function buildMlGetInfluencers (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_influencers](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html) request
* Perform a [ml.get_influencers](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html) request
*
* @param {string} job_id -
* @param {boolean} exclude_interim - Exclude interim results
@ -57,7 +57,7 @@ function buildXpackMlGetInfluencers (opts) {
}
return function xpackMlGetInfluencers (params, options, callback) {
return function mlGetInfluencers (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -96,7 +96,7 @@ function buildXpackMlGetInfluencers (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'influencers'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'influencers'
// build request object
const request = {
@ -111,4 +111,4 @@ function buildXpackMlGetInfluencers (opts) {
}
}
module.exports = buildXpackMlGetInfluencers
module.exports = buildMlGetInfluencers

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetJobStats (opts) {
function buildMlGetJobStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_job_stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html) request
* Perform a [ml.get_job_stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html) request
*
* @param {string} job_id - The ID of the jobs stats to fetch
* @param {boolean} allow_no_jobs - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
@ -40,7 +40,7 @@ function buildXpackMlGetJobStats (opts) {
allowNoJobs: 'allow_no_jobs'
}
return function xpackMlGetJobStats (params, options, callback) {
return function mlGetJobStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,9 +80,9 @@ function buildXpackMlGetJobStats (opts) {
var path = ''
if ((job_id || jobId) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_stats'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_stats'
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + '_stats'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_stats'
}
// build request object
@ -98,4 +98,4 @@ function buildXpackMlGetJobStats (opts) {
}
}
module.exports = buildXpackMlGetJobStats
module.exports = buildMlGetJobStats

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetJobs (opts) {
function buildMlGetJobs (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_jobs](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html) request
* Perform a [ml.get_jobs](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html) request
*
* @param {string} job_id - The ID of the jobs to fetch
* @param {boolean} allow_no_jobs - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
@ -40,7 +40,7 @@ function buildXpackMlGetJobs (opts) {
allowNoJobs: 'allow_no_jobs'
}
return function xpackMlGetJobs (params, options, callback) {
return function mlGetJobs (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,9 +80,9 @@ function buildXpackMlGetJobs (opts) {
var path = ''
if ((job_id || jobId) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors'
path = '/' + '_ml' + '/' + 'anomaly_detectors'
}
// build request object
@ -98,4 +98,4 @@ function buildXpackMlGetJobs (opts) {
}
}
module.exports = buildXpackMlGetJobs
module.exports = buildMlGetJobs

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetModelSnapshots (opts) {
function buildMlGetModelSnapshots (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_model_snapshots](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html) request
* Perform a [ml.get_model_snapshots](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html) request
*
* @param {string} job_id - The ID of the job to fetch
* @param {string} snapshot_id - The ID of the snapshot to fetch
@ -52,7 +52,7 @@ function buildXpackMlGetModelSnapshots (opts) {
}
return function xpackMlGetModelSnapshots (params, options, callback) {
return function mlGetModelSnapshots (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -98,9 +98,9 @@ function buildXpackMlGetModelSnapshots (opts) {
var path = ''
if ((job_id || jobId) != null && (snapshot_id || snapshotId) != null) {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId)
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId)
} else {
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots'
}
// build request object
@ -116,4 +116,4 @@ function buildXpackMlGetModelSnapshots (opts) {
}
}
module.exports = buildXpackMlGetModelSnapshots
module.exports = buildMlGetModelSnapshots

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetOverallBuckets (opts) {
function buildMlGetOverallBuckets (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_overall_buckets](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html) request
* Perform a [ml.get_overall_buckets](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html) request
*
* @param {string} job_id - The job IDs for which to calculate overall bucket results
* @param {int} top_n - The number of top job bucket scores to be used in the overall_score calculation
@ -57,7 +57,7 @@ function buildXpackMlGetOverallBuckets (opts) {
allowNoJobs: 'allow_no_jobs'
}
return function xpackMlGetOverallBuckets (params, options, callback) {
return function mlGetOverallBuckets (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -96,7 +96,7 @@ function buildXpackMlGetOverallBuckets (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'overall_buckets'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'overall_buckets'
// build request object
const request = {
@ -111,4 +111,4 @@ function buildXpackMlGetOverallBuckets (opts) {
}
}
module.exports = buildXpackMlGetOverallBuckets
module.exports = buildMlGetOverallBuckets

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlGetRecords (opts) {
function buildMlGetRecords (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.get_records](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html) request
* Perform a [ml.get_records](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html) request
*
* @param {string} job_id -
* @param {boolean} exclude_interim - Exclude interim results
@ -57,7 +57,7 @@ function buildXpackMlGetRecords (opts) {
}
return function xpackMlGetRecords (params, options, callback) {
return function mlGetRecords (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -96,7 +96,7 @@ function buildXpackMlGetRecords (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'records'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'records'
// build request object
const request = {
@ -111,4 +111,4 @@ function buildXpackMlGetRecords (opts) {
}
}
module.exports = buildXpackMlGetRecords
module.exports = buildMlGetRecords

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlInfo (opts) {
function buildMlInfo (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.info](undefined) request
* Perform a [ml.info](undefined) request
*
*/
@ -38,7 +38,7 @@ function buildXpackMlInfo (opts) {
}
return function xpackMlInfo (params, options, callback) {
return function mlInfo (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -71,7 +71,7 @@ function buildXpackMlInfo (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'info'
path = '/' + '_ml' + '/' + 'info'
// build request object
const request = {
@ -86,4 +86,4 @@ function buildXpackMlInfo (opts) {
}
}
module.exports = buildXpackMlInfo
module.exports = buildMlInfo

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlOpenJob (opts) {
function buildMlOpenJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.open_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html) request
* Perform a [ml.open_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html) request
*
* @param {string} job_id - The ID of the job to open
* @param {boolean} ignore_downtime - Controls if gaps in data are treated as anomalous or as a maintenance window after a job re-start
@ -41,7 +41,7 @@ function buildXpackMlOpenJob (opts) {
}
return function xpackMlOpenJob (params, options, callback) {
return function mlOpenJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -84,7 +84,7 @@ function buildXpackMlOpenJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_open'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_open'
// build request object
const request = {
@ -99,4 +99,4 @@ function buildXpackMlOpenJob (opts) {
}
}
module.exports = buildXpackMlOpenJob
module.exports = buildMlOpenJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlPostCalendarEvents (opts) {
function buildMlPostCalendarEvents (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.post_calendar_events](undefined) request
* Perform a [ml.post_calendar_events](undefined) request
*
* @param {string} calendar_id - The ID of the calendar to modify
* @param {object} body - A list of events
@ -40,7 +40,7 @@ function buildXpackMlPostCalendarEvents (opts) {
}
return function xpackMlPostCalendarEvents (params, options, callback) {
return function mlPostCalendarEvents (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackMlPostCalendarEvents (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackMlPostCalendarEvents (opts) {
}
}
module.exports = buildXpackMlPostCalendarEvents
module.exports = buildMlPostCalendarEvents

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlPostData (opts) {
function buildMlPostData (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.post_data](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html) request
* Perform a [ml.post_data](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html) request
*
* @param {string} job_id - The name of the job receiving the data
* @param {string} reset_start - Optional parameter to specify the start of the bucket resetting range
@ -44,7 +44,7 @@ function buildXpackMlPostData (opts) {
resetEnd: 'reset_end'
}
return function xpackMlPostData (params, options, callback) {
return function mlPostData (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -87,7 +87,7 @@ function buildXpackMlPostData (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_data'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_data'
// build request object
const request = {
@ -102,4 +102,4 @@ function buildXpackMlPostData (opts) {
}
}
module.exports = buildXpackMlPostData
module.exports = buildMlPostData

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlPreviewDatafeed (opts) {
function buildMlPreviewDatafeed (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.preview_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html) request
* Perform a [ml.preview_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html) request
*
* @param {string} datafeed_id - The ID of the datafeed to preview
*/
@ -39,7 +39,7 @@ function buildXpackMlPreviewDatafeed (opts) {
}
return function xpackMlPreviewDatafeed (params, options, callback) {
return function mlPreviewDatafeed (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -82,7 +82,7 @@ function buildXpackMlPreviewDatafeed (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_preview'
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_preview'
// build request object
const request = {
@ -97,4 +97,4 @@ function buildXpackMlPreviewDatafeed (opts) {
}
}
module.exports = buildXpackMlPreviewDatafeed
module.exports = buildMlPreviewDatafeed

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlPutCalendar (opts) {
function buildMlPutCalendar (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.put_calendar](undefined) request
* Perform a [ml.put_calendar](undefined) request
*
* @param {string} calendar_id - The ID of the calendar to create
* @param {object} body - The calendar details
@ -40,7 +40,7 @@ function buildXpackMlPutCalendar (opts) {
}
return function xpackMlPutCalendar (params, options, callback) {
return function mlPutCalendar (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -79,7 +79,7 @@ function buildXpackMlPutCalendar (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
// build request object
const request = {
@ -94,4 +94,4 @@ function buildXpackMlPutCalendar (opts) {
}
}
module.exports = buildXpackMlPutCalendar
module.exports = buildMlPutCalendar

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlPutCalendarJob (opts) {
function buildMlPutCalendarJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.put_calendar_job](undefined) request
* Perform a [ml.put_calendar_job](undefined) request
*
* @param {string} calendar_id - The ID of the calendar to modify
* @param {string} job_id - The ID of the job to add to the calendar
@ -40,7 +40,7 @@ function buildXpackMlPutCalendarJob (opts) {
}
return function xpackMlPutCalendarJob (params, options, callback) {
return function mlPutCalendarJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -93,7 +93,7 @@ function buildXpackMlPutCalendarJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId)
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId)
// build request object
const request = {
@ -108,4 +108,4 @@ function buildXpackMlPutCalendarJob (opts) {
}
}
module.exports = buildXpackMlPutCalendarJob
module.exports = buildMlPutCalendarJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlPutDatafeed (opts) {
function buildMlPutDatafeed (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.put_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html) request
* Perform a [ml.put_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html) request
*
* @param {string} datafeed_id - The ID of the datafeed to create
* @param {object} body - The datafeed config
@ -40,7 +40,7 @@ function buildXpackMlPutDatafeed (opts) {
}
return function xpackMlPutDatafeed (params, options, callback) {
return function mlPutDatafeed (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackMlPutDatafeed (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackMlPutDatafeed (opts) {
}
}
module.exports = buildXpackMlPutDatafeed
module.exports = buildMlPutDatafeed

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlPutFilter (opts) {
function buildMlPutFilter (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.put_filter](undefined) request
* Perform a [ml.put_filter](undefined) request
*
* @param {string} filter_id - The ID of the filter to create
* @param {object} body - The filter details
@ -40,7 +40,7 @@ function buildXpackMlPutFilter (opts) {
}
return function xpackMlPutFilter (params, options, callback) {
return function mlPutFilter (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackMlPutFilter (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackMlPutFilter (opts) {
}
}
module.exports = buildXpackMlPutFilter
module.exports = buildMlPutFilter

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlPutJob (opts) {
function buildMlPutJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.put_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html) request
* Perform a [ml.put_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html) request
*
* @param {string} job_id - The ID of the job to create
* @param {object} body - The job
@ -40,7 +40,7 @@ function buildXpackMlPutJob (opts) {
}
return function xpackMlPutJob (params, options, callback) {
return function mlPutJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackMlPutJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackMlPutJob (opts) {
}
}
module.exports = buildXpackMlPutJob
module.exports = buildMlPutJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlRevertModelSnapshot (opts) {
function buildMlRevertModelSnapshot (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.revert_model_snapshot](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html) request
* Perform a [ml.revert_model_snapshot](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html) request
*
* @param {string} job_id - The ID of the job to fetch
* @param {string} snapshot_id - The ID of the snapshot to revert to
@ -42,7 +42,7 @@ function buildXpackMlRevertModelSnapshot (opts) {
deleteInterveningResults: 'delete_intervening_results'
}
return function xpackMlRevertModelSnapshot (params, options, callback) {
return function mlRevertModelSnapshot (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -91,7 +91,7 @@ function buildXpackMlRevertModelSnapshot (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_revert'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_revert'
// build request object
const request = {
@ -106,4 +106,4 @@ function buildXpackMlRevertModelSnapshot (opts) {
}
}
module.exports = buildXpackMlRevertModelSnapshot
module.exports = buildMlRevertModelSnapshot

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlSetUpgradeMode (opts) {
function buildMlSetUpgradeMode (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.set_upgrade_mode](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html) request
* Perform a [ml.set_upgrade_mode](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html) request
*
* @param {boolean} enabled - Whether to enable upgrade_mode ML setting or not. Defaults to false.
* @param {time} timeout - Controls the time to wait before action times out. Defaults to 30 seconds
@ -41,7 +41,7 @@ function buildXpackMlSetUpgradeMode (opts) {
}
return function xpackMlSetUpgradeMode (params, options, callback) {
return function mlSetUpgradeMode (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,7 +80,7 @@ function buildXpackMlSetUpgradeMode (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'set_upgrade_mode'
path = '/' + '_ml' + '/' + 'set_upgrade_mode'
// build request object
const request = {
@ -95,4 +95,4 @@ function buildXpackMlSetUpgradeMode (opts) {
}
}
module.exports = buildXpackMlSetUpgradeMode
module.exports = buildMlSetUpgradeMode

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlStartDatafeed (opts) {
function buildMlStartDatafeed (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.start_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html) request
* Perform a [ml.start_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html) request
*
* @param {string} datafeed_id - The ID of the datafeed to start
* @param {string} start - The start time from where the datafeed should begin
@ -45,7 +45,7 @@ function buildXpackMlStartDatafeed (opts) {
}
return function xpackMlStartDatafeed (params, options, callback) {
return function mlStartDatafeed (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -84,7 +84,7 @@ function buildXpackMlStartDatafeed (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_start'
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_start'
// build request object
const request = {
@ -99,4 +99,4 @@ function buildXpackMlStartDatafeed (opts) {
}
}
module.exports = buildXpackMlStartDatafeed
module.exports = buildMlStartDatafeed

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlStopDatafeed (opts) {
function buildMlStopDatafeed (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.stop_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html) request
* Perform a [ml.stop_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html) request
*
* @param {string} datafeed_id - The ID of the datafeed to stop
* @param {boolean} allow_no_datafeeds - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
@ -45,7 +45,7 @@ function buildXpackMlStopDatafeed (opts) {
}
return function xpackMlStopDatafeed (params, options, callback) {
return function mlStopDatafeed (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -84,7 +84,7 @@ function buildXpackMlStopDatafeed (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stop'
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stop'
// build request object
const request = {
@ -99,4 +99,4 @@ function buildXpackMlStopDatafeed (opts) {
}
}
module.exports = buildXpackMlStopDatafeed
module.exports = buildMlStopDatafeed

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlUpdateDatafeed (opts) {
function buildMlUpdateDatafeed (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.update_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html) request
* Perform a [ml.update_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html) request
*
* @param {string} datafeed_id - The ID of the datafeed to update
* @param {object} body - The datafeed update settings
@ -40,7 +40,7 @@ function buildXpackMlUpdateDatafeed (opts) {
}
return function xpackMlUpdateDatafeed (params, options, callback) {
return function mlUpdateDatafeed (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackMlUpdateDatafeed (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_update'
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_update'
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackMlUpdateDatafeed (opts) {
}
}
module.exports = buildXpackMlUpdateDatafeed
module.exports = buildMlUpdateDatafeed

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlUpdateFilter (opts) {
function buildMlUpdateFilter (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.update_filter](undefined) request
* Perform a [ml.update_filter](undefined) request
*
* @param {string} filter_id - The ID of the filter to update
* @param {object} body - The filter update
@ -40,7 +40,7 @@ function buildXpackMlUpdateFilter (opts) {
}
return function xpackMlUpdateFilter (params, options, callback) {
return function mlUpdateFilter (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackMlUpdateFilter (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId) + '/' + '_update'
path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId) + '/' + '_update'
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackMlUpdateFilter (opts) {
}
}
module.exports = buildXpackMlUpdateFilter
module.exports = buildMlUpdateFilter

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlUpdateJob (opts) {
function buildMlUpdateJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.update_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html) request
* Perform a [ml.update_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html) request
*
* @param {string} job_id - The ID of the job to create
* @param {object} body - The job update settings
@ -40,7 +40,7 @@ function buildXpackMlUpdateJob (opts) {
}
return function xpackMlUpdateJob (params, options, callback) {
return function mlUpdateJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackMlUpdateJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_update'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_update'
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackMlUpdateJob (opts) {
}
}
module.exports = buildXpackMlUpdateJob
module.exports = buildMlUpdateJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlUpdateModelSnapshot (opts) {
function buildMlUpdateModelSnapshot (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.update_model_snapshot](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html) request
* Perform a [ml.update_model_snapshot](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html) request
*
* @param {string} job_id - The ID of the job to fetch
* @param {string} snapshot_id - The ID of the snapshot to update
@ -41,7 +41,7 @@ function buildXpackMlUpdateModelSnapshot (opts) {
}
return function xpackMlUpdateModelSnapshot (params, options, callback) {
return function mlUpdateModelSnapshot (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -94,7 +94,7 @@ function buildXpackMlUpdateModelSnapshot (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_update'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_update'
// build request object
const request = {
@ -109,4 +109,4 @@ function buildXpackMlUpdateModelSnapshot (opts) {
}
}
module.exports = buildXpackMlUpdateModelSnapshot
module.exports = buildMlUpdateModelSnapshot

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlValidate (opts) {
function buildMlValidate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.validate](undefined) request
* Perform a [ml.validate](undefined) request
*
* @param {object} body - The job config
*/
@ -39,7 +39,7 @@ function buildXpackMlValidate (opts) {
}
return function xpackMlValidate (params, options, callback) {
return function mlValidate (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -78,7 +78,7 @@ function buildXpackMlValidate (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + '_validate'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_validate'
// build request object
const request = {
@ -93,4 +93,4 @@ function buildXpackMlValidate (opts) {
}
}
module.exports = buildXpackMlValidate
module.exports = buildMlValidate

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMlValidateDetector (opts) {
function buildMlValidateDetector (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ml.validate_detector](undefined) request
* Perform a [ml.validate_detector](undefined) request
*
* @param {object} body - The detector
*/
@ -39,7 +39,7 @@ function buildXpackMlValidateDetector (opts) {
}
return function xpackMlValidateDetector (params, options, callback) {
return function mlValidateDetector (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -78,7 +78,7 @@ function buildXpackMlValidateDetector (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + '_validate' + '/' + 'detector'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_validate' + '/' + 'detector'
// build request object
const request = {
@ -93,4 +93,4 @@ function buildXpackMlValidateDetector (opts) {
}
}
module.exports = buildXpackMlValidateDetector
module.exports = buildMlValidateDetector

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMonitoringBulk (opts) {
function buildMonitoringBulk (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.monitoring.bulk](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/es-monitoring.html) request
* Perform a [monitoring.bulk](https://www.elastic.co/guide/en/elasticsearch/reference/master/es-monitoring.html) request
*
* @param {string} type - Default document type for items which don't provide one
* @param {string} system_id - Identifier of the monitored system
@ -47,7 +47,7 @@ function buildXpackMonitoringBulk (opts) {
}
return function xpackMonitoringBulk (params, options, callback) {
return function monitoringBulk (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -87,9 +87,9 @@ function buildXpackMonitoringBulk (opts) {
var path = ''
if ((type) != null) {
path = '/' + '_xpack' + '/' + 'monitoring' + '/' + encodeURIComponent(type) + '/' + '_bulk'
path = '/' + '_monitoring' + '/' + encodeURIComponent(type) + '/' + 'bulk'
} else {
path = '/' + '_xpack' + '/' + 'monitoring' + '/' + '_bulk'
path = '/' + '_monitoring' + '/' + 'bulk'
}
// build request object
@ -105,4 +105,4 @@ function buildXpackMonitoringBulk (opts) {
}
}
module.exports = buildXpackMonitoringBulk
module.exports = buildMonitoringBulk

View File

@ -35,7 +35,8 @@ function buildMsearch (opts) {
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
* @param {number} pre_filter_shard_size - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
* @param {number} max_concurrent_shard_requests - The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
* @param {boolean} rest_total_hits_as_int - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number
* @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
* @param {boolean} ccs_minimize_roundtrips - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
* @param {object} body - The request definitions (metadata-search request definition pairs), separated by newlines
*/
@ -46,6 +47,7 @@ function buildMsearch (opts) {
'pre_filter_shard_size',
'max_concurrent_shard_requests',
'rest_total_hits_as_int',
'ccs_minimize_roundtrips',
'pretty',
'human',
'error_trace',
@ -60,6 +62,7 @@ function buildMsearch (opts) {
preFilterShardSize: 'pre_filter_shard_size',
maxConcurrentShardRequests: 'max_concurrent_shard_requests',
restTotalHitsAsInt: 'rest_total_hits_as_int',
ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -33,7 +33,8 @@ function buildMsearchTemplate (opts) {
* @param {enum} search_type - Search operation type
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
* @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute
* @param {boolean} rest_total_hits_as_int - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number
* @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
* @param {boolean} ccs_minimize_roundtrips - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
* @param {object} body - The request definitions (metadata-search request definition pairs), separated by newlines
*/
@ -42,6 +43,7 @@ function buildMsearchTemplate (opts) {
'typed_keys',
'max_concurrent_searches',
'rest_total_hits_as_int',
'ccs_minimize_roundtrips',
'pretty',
'human',
'error_trace',
@ -54,6 +56,7 @@ function buildMsearchTemplate (opts) {
typedKeys: 'typed_keys',
maxConcurrentSearches: 'max_concurrent_searches',
restTotalHitsAsInt: 'rest_total_hits_as_int',
ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -26,7 +26,7 @@ function buildNodesReloadSecureSettings (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [nodes.reload_secure_settings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/secure-settings.html#reloadable-secure-settings) request
* Perform a [nodes.reload_secure_settings](https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings) request
*
* @param {list} node_id - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
* @param {time} timeout - Explicit operation timeout

View File

@ -33,6 +33,7 @@ function buildReindex (opts) {
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
* @param {boolean} wait_for_completion - Should the request should block until the reindex is complete.
* @param {number} requests_per_second - The throttle to set on this request in sub-requests per second. -1 means no throttle.
* @param {time} scroll - Control how long to keep the search context alive
* @param {number} slices - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
* @param {object} body - The search definition using the Query DSL and the prototype for the index request.
*/
@ -43,6 +44,7 @@ function buildReindex (opts) {
'wait_for_active_shards',
'wait_for_completion',
'requests_per_second',
'scroll',
'slices',
'pretty',
'human',

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupDeleteJob (opts) {
function buildRollupDeleteJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.rollup.delete_job]() request
* Perform a [rollup.delete_job]() request
*
* @param {string} id - The ID of the job to delete
*/
@ -39,7 +39,7 @@ function buildXpackRollupDeleteJob (opts) {
}
return function xpackRollupDeleteJob (params, options, callback) {
return function rollupDeleteJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -78,7 +78,7 @@ function buildXpackRollupDeleteJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
// build request object
const request = {
@ -93,4 +93,4 @@ function buildXpackRollupDeleteJob (opts) {
}
}
module.exports = buildXpackRollupDeleteJob
module.exports = buildRollupDeleteJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupGetJobs (opts) {
function buildRollupGetJobs (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.rollup.get_jobs]() request
* Perform a [rollup.get_jobs]() request
*
* @param {string} id - The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs
*/
@ -39,7 +39,7 @@ function buildXpackRollupGetJobs (opts) {
}
return function xpackRollupGetJobs (params, options, callback) {
return function rollupGetJobs (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -73,9 +73,9 @@ function buildXpackRollupGetJobs (opts) {
var path = ''
if ((id) != null) {
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
} else {
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job'
path = '/' + '_rollup' + '/' + 'job'
}
// build request object
@ -91,4 +91,4 @@ function buildXpackRollupGetJobs (opts) {
}
}
module.exports = buildXpackRollupGetJobs
module.exports = buildRollupGetJobs

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupGetRollupCaps (opts) {
function buildRollupGetRollupCaps (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.rollup.get_rollup_caps]() request
* Perform a [rollup.get_rollup_caps]() request
*
* @param {string} id - The ID of the index to check rollup capabilities on, or left blank for all jobs
*/
@ -39,7 +39,7 @@ function buildXpackRollupGetRollupCaps (opts) {
}
return function xpackRollupGetRollupCaps (params, options, callback) {
return function rollupGetRollupCaps (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -73,9 +73,9 @@ function buildXpackRollupGetRollupCaps (opts) {
var path = ''
if ((id) != null) {
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'data' + '/' + encodeURIComponent(id)
path = '/' + '_rollup' + '/' + 'data' + '/' + encodeURIComponent(id)
} else {
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'data'
path = '/' + '_rollup' + '/' + 'data'
}
// build request object
@ -91,4 +91,4 @@ function buildXpackRollupGetRollupCaps (opts) {
}
}
module.exports = buildXpackRollupGetRollupCaps
module.exports = buildRollupGetRollupCaps

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupGetRollupIndexCaps (opts) {
function buildRollupGetRollupIndexCaps (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.rollup.get_rollup_index_caps]() request
* Perform a [rollup.get_rollup_index_caps]() request
*
* @param {string} index - The rollup index or index pattern to obtain rollup capabilities from.
*/
@ -39,7 +39,7 @@ function buildXpackRollupGetRollupIndexCaps (opts) {
}
return function xpackRollupGetRollupIndexCaps (params, options, callback) {
return function rollupGetRollupIndexCaps (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -78,7 +78,7 @@ function buildXpackRollupGetRollupIndexCaps (opts) {
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_xpack' + '/' + 'rollup' + '/' + 'data'
path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + 'data'
// build request object
const request = {
@ -93,4 +93,4 @@ function buildXpackRollupGetRollupIndexCaps (opts) {
}
}
module.exports = buildXpackRollupGetRollupIndexCaps
module.exports = buildRollupGetRollupIndexCaps

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupPutJob (opts) {
function buildRollupPutJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.rollup.put_job]() request
* Perform a [rollup.put_job]() request
*
* @param {string} id - The ID of the job to create
* @param {object} body - The job configuration
@ -40,7 +40,7 @@ function buildXpackRollupPutJob (opts) {
}
return function xpackRollupPutJob (params, options, callback) {
return function rollupPutJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackRollupPutJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackRollupPutJob (opts) {
}
}
module.exports = buildXpackRollupPutJob
module.exports = buildRollupPutJob

View File

@ -22,27 +22,30 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupRollupSearch (opts) {
function buildRollupRollupSearch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.rollup.rollup_search]() request
* Perform a [rollup.rollup_search]() request
*
* @param {string} index - The index or index-pattern (containing rollup or regular data) that should be searched
* @param {list} index - The indices or index-pattern(s) (containing rollup or regular data) that should be searched
* @param {string} type - The doc type inside the index
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
* @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
* @param {object} body - The search request body
*/
const acceptedQuerystring = [
'typed_keys'
'typed_keys',
'rest_total_hits_as_int'
]
const snakeCase = {
typedKeys: 'typed_keys'
typedKeys: 'typed_keys',
restTotalHitsAsInt: 'rest_total_hits_as_int'
}
return function xpackRollupRollupSearch (params, options, callback) {
return function rollupRollupSearch (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -110,4 +113,4 @@ function buildXpackRollupRollupSearch (opts) {
}
}
module.exports = buildXpackRollupRollupSearch
module.exports = buildRollupRollupSearch

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupStartJob (opts) {
function buildRollupStartJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.rollup.start_job]() request
* Perform a [rollup.start_job]() request
*
* @param {string} id - The ID of the job to start
*/
@ -39,7 +39,7 @@ function buildXpackRollupStartJob (opts) {
}
return function xpackRollupStartJob (params, options, callback) {
return function rollupStartJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -78,7 +78,7 @@ function buildXpackRollupStartJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_start'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_start'
// build request object
const request = {
@ -93,4 +93,4 @@ function buildXpackRollupStartJob (opts) {
}
}
module.exports = buildXpackRollupStartJob
module.exports = buildRollupStartJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackRollupStopJob (opts) {
function buildRollupStopJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.rollup.stop_job]() request
* Perform a [rollup.stop_job]() request
*
* @param {string} id - The ID of the job to stop
* @param {boolean} wait_for_completion - True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false.
@ -43,7 +43,7 @@ function buildXpackRollupStopJob (opts) {
}
return function xpackRollupStopJob (params, options, callback) {
return function rollupStopJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -82,7 +82,7 @@ function buildXpackRollupStopJob (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_stop'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_stop'
// build request object
const request = {
@ -97,4 +97,4 @@ function buildXpackRollupStopJob (opts) {
}
}
module.exports = buildXpackRollupStopJob
module.exports = buildRollupStopJob

View File

@ -31,7 +31,7 @@ function buildScroll (opts) {
* @param {string} scroll_id - The scroll ID
* @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
* @param {string} scroll_id - The scroll ID for scrolled search
* @param {boolean} rest_total_hits_as_int - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number
* @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
* @param {object} body - The scroll ID if not passed by URL or query parameter.
*/

View File

@ -32,6 +32,7 @@ function buildSearch (opts) {
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
* @param {string} analyzer - The analyzer to use for the query string
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
* @param {boolean} ccs_minimize_roundtrips - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
* @param {enum} default_operator - The default operator for query string query (AND or OR)
* @param {string} df - The field to use as default where no field prefix is given in the query string
* @param {boolean} explain - Specify whether to return detailed information about score computation as part of a hit
@ -68,15 +69,16 @@ function buildSearch (opts) {
* @param {boolean} seq_no_primary_term - Specify whether to return sequence number and primary term of the last modification of each hit
* @param {boolean} request_cache - Specify if request cache should be used for this request or not, defaults to index level setting
* @param {number} batched_reduce_size - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
* @param {number} max_concurrent_shard_requests - The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
* @param {number} max_concurrent_shard_requests - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
* @param {number} pre_filter_shard_size - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
* @param {boolean} rest_total_hits_as_int - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number
* @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
* @param {object} body - The search definition using the Query DSL
*/
const acceptedQuerystring = [
'analyzer',
'analyze_wildcard',
'ccs_minimize_roundtrips',
'default_operator',
'df',
'explain',
@ -97,9 +99,7 @@ function buildSearch (opts) {
'sort',
'_source',
'_source_excludes',
'_source_exclude',
'_source_includes',
'_source_include',
'terminate_after',
'stats',
'suggest_field',
@ -127,6 +127,7 @@ function buildSearch (opts) {
const snakeCase = {
analyzeWildcard: 'analyze_wildcard',
ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
defaultOperator: 'default_operator',
storedFields: 'stored_fields',
docvalueFields: 'docvalue_fields',
@ -136,9 +137,7 @@ function buildSearch (opts) {
expandWildcards: 'expand_wildcards',
searchType: 'search_type',
_sourceExcludes: '_source_excludes',
_sourceExclude: '_source_exclude',
_sourceIncludes: '_source_includes',
_sourceInclude: '_source_include',
terminateAfter: 'terminate_after',
suggestField: 'suggest_field',
suggestMode: 'suggest_mode',

View File

@ -41,7 +41,8 @@ function buildSearchTemplate (opts) {
* @param {boolean} explain - Specify whether to return detailed information about score computation as part of a hit
* @param {boolean} profile - Specify whether to profile the query execution
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
* @param {boolean} rest_total_hits_as_int - This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number
* @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
* @param {boolean} ccs_minimize_roundtrips - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
* @param {object} body - The search definition template and its params
*/
@ -58,6 +59,7 @@ function buildSearchTemplate (opts) {
'profile',
'typed_keys',
'rest_total_hits_as_int',
'ccs_minimize_roundtrips',
'pretty',
'human',
'error_trace',
@ -73,6 +75,7 @@ function buildSearchTemplate (opts) {
searchType: 'search_type',
typedKeys: 'typed_keys',
restTotalHitsAsInt: 'rest_total_hits_as_int',
ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSslCertificates (opts) {
function buildSecurityAuthenticate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.ssl.certificates](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html) request
* Perform a [security.authenticate](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html) request
*
*/
@ -38,7 +38,7 @@ function buildXpackSslCertificates (opts) {
}
return function xpackSslCertificates (params, options, callback) {
return function securityAuthenticate (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -77,7 +77,7 @@ function buildXpackSslCertificates (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'ssl' + '/' + 'certificates'
path = '/' + '_security' + '/' + '_authenticate'
// build request object
const request = {
@ -92,4 +92,4 @@ function buildXpackSslCertificates (opts) {
}
}
module.exports = buildXpackSslCertificates
module.exports = buildSecurityAuthenticate

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSecurityChangePassword (opts) {
function buildSecurityChangePassword (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.security.change_password](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html) request
* Perform a [security.change_password](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html) request
*
* @param {string} username - The username of the user to change the password for
* @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
@ -41,7 +41,7 @@ function buildXpackSecurityChangePassword (opts) {
}
return function xpackSecurityChangePassword (params, options, callback) {
return function securityChangePassword (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -81,9 +81,9 @@ function buildXpackSecurityChangePassword (opts) {
var path = ''
if ((username) != null) {
path = '/' + '_xpack' + '/' + 'security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_password'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_password'
} else {
path = '/' + '_xpack' + '/' + 'security' + '/' + 'user' + '/' + '_password'
path = '/' + '_security' + '/' + 'user' + '/' + '_password'
}
// build request object
@ -99,4 +99,4 @@ function buildXpackSecurityChangePassword (opts) {
}
}
module.exports = buildXpackSecurityChangePassword
module.exports = buildSecurityChangePassword

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSecurityClearCachedRealms (opts) {
function buildSecurityClearCachedRealms (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.security.clear_cached_realms](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html) request
* Perform a [security.clear_cached_realms](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html) request
*
* @param {list} realms - Comma-separated list of realms to clear
* @param {list} usernames - Comma-separated list of usernames to clear from the cache
@ -40,7 +40,7 @@ function buildXpackSecurityClearCachedRealms (opts) {
}
return function xpackSecurityClearCachedRealms (params, options, callback) {
return function securityClearCachedRealms (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackSecurityClearCachedRealms (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'security' + '/' + 'realm' + '/' + encodeURIComponent(realms) + '/' + '_clear_cache'
path = '/' + '_security' + '/' + 'realm' + '/' + encodeURIComponent(realms) + '/' + '_clear_cache'
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackSecurityClearCachedRealms (opts) {
}
}
module.exports = buildXpackSecurityClearCachedRealms
module.exports = buildSecurityClearCachedRealms

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSecurityClearCachedRoles (opts) {
function buildSecurityClearCachedRoles (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.security.clear_cached_roles](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html) request
* Perform a [security.clear_cached_roles](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html) request
*
* @param {list} name - Role name
*/
@ -39,7 +39,7 @@ function buildXpackSecurityClearCachedRoles (opts) {
}
return function xpackSecurityClearCachedRoles (params, options, callback) {
return function securityClearCachedRoles (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -82,7 +82,7 @@ function buildXpackSecurityClearCachedRoles (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'security' + '/' + 'role' + '/' + encodeURIComponent(name) + '/' + '_clear_cache'
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name) + '/' + '_clear_cache'
// build request object
const request = {
@ -97,4 +97,4 @@ function buildXpackSecurityClearCachedRoles (opts) {
}
}
module.exports = buildXpackSecurityClearCachedRoles
module.exports = buildSecurityClearCachedRoles

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSecurityDeletePrivileges (opts) {
function buildSecurityDeletePrivileges (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.security.delete_privileges](TODO) request
* Perform a [security.delete_privileges](TODO) request
*
* @param {string} application - Application name
* @param {string} name - Privilege name
@ -41,7 +41,7 @@ function buildXpackSecurityDeletePrivileges (opts) {
}
return function xpackSecurityDeletePrivileges (params, options, callback) {
return function securityDeletePrivileges (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -94,7 +94,7 @@ function buildXpackSecurityDeletePrivileges (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
// build request object
const request = {
@ -109,4 +109,4 @@ function buildXpackSecurityDeletePrivileges (opts) {
}
}
module.exports = buildXpackSecurityDeletePrivileges
module.exports = buildSecurityDeletePrivileges

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSecurityDeleteRole (opts) {
function buildSecurityDeleteRole (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.security.delete_role](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html) request
* Perform a [security.delete_role](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html) request
*
* @param {string} name - Role name
* @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
@ -40,7 +40,7 @@ function buildXpackSecurityDeleteRole (opts) {
}
return function xpackSecurityDeleteRole (params, options, callback) {
return function securityDeleteRole (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackSecurityDeleteRole (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'security' + '/' + 'role' + '/' + encodeURIComponent(name)
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackSecurityDeleteRole (opts) {
}
}
module.exports = buildXpackSecurityDeleteRole
module.exports = buildSecurityDeleteRole

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSecurityDeleteRoleMapping (opts) {
function buildSecurityDeleteRoleMapping (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.security.delete_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html) request
* Perform a [security.delete_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html) request
*
* @param {string} name - Role-mapping name
* @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
@ -40,7 +40,7 @@ function buildXpackSecurityDeleteRoleMapping (opts) {
}
return function xpackSecurityDeleteRoleMapping (params, options, callback) {
return function securityDeleteRoleMapping (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackSecurityDeleteRoleMapping (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackSecurityDeleteRoleMapping (opts) {
}
}
module.exports = buildXpackSecurityDeleteRoleMapping
module.exports = buildSecurityDeleteRoleMapping

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackSecurityDeleteUser (opts) {
function buildSecurityDeleteUser (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.security.delete_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html) request
* Perform a [security.delete_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html) request
*
* @param {string} username - username
* @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
@ -40,7 +40,7 @@ function buildXpackSecurityDeleteUser (opts) {
}
return function xpackSecurityDeleteUser (params, options, callback) {
return function securityDeleteUser (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildXpackSecurityDeleteUser (opts) {
var path = ''
path = '/' + '_xpack' + '/' + 'security' + '/' + 'user' + '/' + encodeURIComponent(username)
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildXpackSecurityDeleteUser (opts) {
}
}
module.exports = buildXpackSecurityDeleteUser
module.exports = buildSecurityDeleteUser

Some files were not shown because too many files have changed in this diff Show More