Compare commits

..

92 Commits

Author SHA1 Message Date
05921b134d Bumped v6.8.1 2019-07-05 11:40:00 +02:00
aadf44bbf2 Remove auth data from inspect and toJSON in connection class (#887)
* Remove auth data from inspect and toJSON in connection class

* Updated test
2019-07-04 14:43:38 +02:00
bef1604a8d Updated type definitions (#882)
* Updated type definitions

* Updated test
2019-06-19 09:15:43 +02:00
87fb0a2996 Support branch for code generation (#883) 2019-06-18 15:46:57 +02:00
456fc19c94 Added cloud configuration example (#880)
* Added cloud configuration example

* Used cloud example from auth docs and added link
2019-06-14 10:13:47 +02:00
4c118b9f9a [DOCS] Fixes typo (#877) 2019-06-12 08:42:12 +02:00
dc5c041b07 Docs: added missing configuration options (#870) 2019-06-03 12:29:12 +02:00
6774560444 Added ES 6.8 2019-05-22 17:53:52 +02:00
3f1a15bc4e Bumped v6.8.0 2019-05-22 12:20:10 +02:00
06b3a1ceb7 Support for non-friendly chars in url username and password (#858)
* Support for non-friendly chars in url username and password
- Added auth option to Connection class
- Updated pool.addConnection

* Updated test
2019-05-20 17:10:31 +02:00
a83cf7b26f Patch #855 2019-05-17 09:07:40 -04:00
30c3afe150 API generation 2019-05-16 16:54:53 -04:00
0efa0df934 Patch deprecated parameters (#851)
* Updated code generation

* API generation

* API generation

* Updated code generation
2019-05-16 16:54:27 -04:00
b2fbcfd8e2 missing comma (#854) 2019-05-16 09:39:51 -04:00
cfcff78a7e Bumped v6.7.1 2019-05-14 17:50:16 -04:00
bf482cf269 Added toJSON method to Connection class (#849)
* Added toJSON method to Connection class

* Updated test

* Updated typings
2019-05-14 12:01:32 -04:00
f9e2d5f708 Fix #803 (#846) 2019-05-14 12:01:32 -04:00
ed8adba2ab Fix 843 (#845)
* Fix #843

* Updated test
2019-05-10 10:56:20 +02:00
098aef0a58 Bumped v6.7.0 2019-05-09 15:34:48 +02:00
6d5b5f6af3 Fix 841 (#842)
* Added errors to exported members

* Updated test
2019-05-09 14:57:51 +02:00
02ad9a9759 Bumped v6.7.0-rc.3 2019-05-06 12:06:45 +02:00
965536b369 API generation 2019-05-06 12:06:21 +02:00
5c144154ad Updated installation instructions (#840) 2019-05-06 12:02:25 +02:00
a52cf6be38 Added User-Agent header (#807)
* Added User-Agent header

* Updated test

* Updated user-agent format

* Updated test
2019-05-06 10:00:16 +02:00
c91ceb12d8 API generation 2019-05-03 19:04:18 +02:00
c1eadd6e88 Simplify API wrappers (#839)
* Updated code generation

* API generation

* Updated test

* Updated code generation

* API generation

* API generation
2019-05-03 19:03:56 +02:00
d080f1bdad API generation 2019-05-03 17:27:09 +02:00
14fc908d4b 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:26:40 +02:00
7d810f8110 Better handling of hostname/ip:port format (#837)
* Better handling of hostname/ip:port format

* Updated test
2019-05-03 17:26:33 +02:00
962e26f791 Updated installation instructions (#835)
* Updated installation instructions

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

* Updated test
2019-04-29 09:20:32 +02:00
8a85738258 Node v12 and bumped dependencies (#832)
* Node v12

* Bumped dependencies

* Disable automatic code coverage
2019-04-26 17:26:54 +02:00
d06f67d881 Updated .travis.yml (#831) 2019-04-26 15:04:55 +02:00
c67a5dfdc2 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:28 +02:00
885147b889 Bumped v6.7.0-rc.2 2019-04-17 14:17:06 +02:00
3c99839e4a Updated typings (#819) 2019-04-17 11:25:06 +02:00
24da41e994 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:25:06 +02:00
662e4d5ca7 Fix a typo in usage example (#806) 2019-04-11 16:38:16 +02:00
1afa23b11d API generation 2019-04-10 11:45:50 +02:00
48c6ad15a6 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:44:47 +02:00
48233503f7 Custom http agent support (#810) 2019-04-10 11:44:33 +02:00
11c7475566 Use Elasticsearch 6.7.1 2019-04-09 12:13:07 +02:00
e530ed2313 Support for publish_address as hostname/ip:port (#804) 2019-04-09 12:06:41 +02:00
59b9403fdc Updated README.md 2019-04-01 09:50:33 +02:00
01ab682fb7 Handle bulk errors in examples 2019-04-01 09:09:10 +02:00
b11e7ffc9f Generated reference 2019-03-29 18:09:00 +01:00
11da9a4650 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:08:40 +01:00
352a2c3652 Docs: Set the stack version to 6.7 2019-03-29 11:23:53 -04:00
5ce9f55481 Generated reference 2019-03-29 15:47:32 +01:00
e7f7993407 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:54 +01:00
baac03846e Update asciidoc config 2019-03-29 15:42:24 +01:00
41050f23f5 Generated reference 2019-03-29 08:52:44 +01:00
2daa6d35c6 Docs: Fix the API reference (#799) 2019-03-29 08:52:18 +01:00
9bcfc08b20 Bumped v6.7.0-rc.1 2019-03-28 19:29:10 +01:00
45744762d3 Fix docs (#796)
Follow up of https://github.com/elastic/docs/pull/701.
2019-03-28 17:36:52 +01:00
516139c48e Updated CONTRIBUTING.md (#794)
As titled, also renamed the script files for a better DX.
2019-03-28 10:11:32 +01:00
29091da864 API generation 2019-03-27 19:24:27 +01:00
4346bfd9a0 Follow-up #790 2019-03-27 19:23:35 +01:00
ef2b025489 Added CONTRIBUTING.md and CODE_OF_CONDUCT.md 2019-03-27 16:48:16 +01:00
12101dc1ae Improved integration test runner 2019-03-27 15:05:52 +01:00
1325471c45 Test: updated platinum skip list 2019-03-27 11:48:34 +01:00
59f88c22f9 Use ES 6.7 2019-03-27 07:51:30 +01:00
8f131d5a6d API generation 2019-03-27 07:50:42 +01:00
81e09a71c2 Regenerate doc 2019-03-27 07:47:03 +01:00
41fa164611 Doc updates (#791)
Updates for better displaying the documentation in the website.
2019-03-27 07:46:03 +01:00
9fa31a96c6 Merge branch '6.x' of https://github.com/elastic/elasticsearch-js into 6.x 2019-03-26 12:09:30 +01:00
eb95d6bda1 API generation 2019-03-26 12:09:20 +01:00
69844fa93f Merge branch 'master' into 6.x 2019-03-26 12:08:00 +01:00
203e11f2f8 Remove url in jenkins job configuration 2019-03-21 11:16:33 -04:00
10d660c6dc CI config (#786)
* Updated ci config

* Minor fixes

* Minor fixes

* Added Node v11
2019-03-21 11:03:48 +01:00
fcad02768b Use elasticsearch-oss for oss test 2019-03-20 08:38:34 +01:00
5cb51850c9 Revert "Revert "Updated ci config""
This reverts commit a35c6e97b7.
2019-03-19 19:47:36 +01:00
a35c6e97b7 Revert "Updated ci config"
This reverts commit 17fc9fb38e.
2019-03-19 19:04:44 +01:00
17fc9fb38e Updated ci config 2019-03-19 14:16:05 +01:00
dc5102d30b 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 10:33:50 +01:00
4d551319dd Updated travis 2019-03-19 10:33:17 +01:00
1acfd1b895 API generation 2019-03-19 10:04:35 +01:00
2458bb5721 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:56:07 +01:00
5d8b2b0c26 Added a note about the new client 2019-03-19 09:55:40 +01:00
d5256e2fc1 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:55:35 +01:00
55fd03942f Updated coverage script 2019-03-15 17:49:35 +01:00
ead63b9e6d Added codecov badge 2019-03-15 17:49:35 +01:00
284a9deac7 Updated ignore files 2019-03-15 17:49:35 +01:00
3faac68c5b Added codecov (#777) 2019-03-15 17:49:35 +01:00
9bb4083a6e Updated README 2019-03-14 18:33:33 +01:00
02299f7ec1 Updated code generation 2019-03-13 16:12:59 +01:00
a8c19984d6 Updated test 2019-03-13 16:11:47 +01:00
0b739ea23c regenerated typings and reference 2019-03-13 16:11:14 +01:00
5c51bf7128 Updated scripts 2019-03-13 16:10:09 +01:00
51ef62b4f1 API generation 2019-03-13 16:09:29 +01:00
5030efd2d0 Revert d4d7d0bef5 2019-03-13 14:14:06 +01:00
dd9707e42e CI: use Elasticsearch 6 2019-03-13 14:09:37 +01:00
152 changed files with 2107 additions and 1620 deletions

View File

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

View File

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

View File

@ -35,6 +35,7 @@ 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
@ -48,6 +49,7 @@ function buildBulk (opts) {
'routing',
'timeout',
'type',
'fields',
'_source',
'_source_excludes',
'_source_exclude',

View File

@ -51,12 +51,6 @@ function buildCcrFollowStats (opts) {
options = {}
}
// check required parameters
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)

View File

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

View File

@ -89,11 +89,24 @@ 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}`)
@ -115,11 +128,7 @@ function buildDelete (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -97,6 +97,10 @@ 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)
@ -123,11 +127,7 @@ function buildExists (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + 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; deprecated and optional starting with 7.0
* @param {string} type - The type of the document; use `_all` to fetch the first document matching the ID across all types
* @param {string} parent - The ID of the parent document
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
* @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
@ -94,6 +94,10 @@ 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)
@ -129,11 +133,7 @@ function buildExistsSource (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
// build request object
const request = {

View File

@ -103,6 +103,10 @@ function buildExplain (opts) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['type'] == null) {
const err = new ConfigurationError('Missing required parameter: type')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
@ -125,11 +129,7 @@ function buildExplain (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
// build request object
const request = {

View File

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

View File

@ -101,6 +101,10 @@ 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)
@ -127,11 +131,7 @@ function buildGet (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + 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; deprecated and optional starting with 7.0
* @param {string} type - The type of the document; use `_all` to fetch the first document matching the ID across all types
* @param {string} parent - The ID of the parent document
* @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
* @param {boolean} realtime - Specify whether to perform the operation in realtime or search mode
@ -94,6 +94,10 @@ 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)
@ -120,11 +124,7 @@ function buildGetSource (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
// build request object
const request = {

View File

@ -29,10 +29,11 @@ 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,11 +91,24 @@ function buildIndex (opts) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['type'] == null) {
const err = new ConfigurationError('Missing required parameter: type')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: type, index')
return handleError(err, callback)
} else if (params['type'] != null && (params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
@ -119,12 +132,8 @@ function buildIndex (opts) {
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else if ((index) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
} else if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type)
} else {
path = '/' + encodeURIComponent(index) + '/' + '_doc'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type)
}
// build request object

View File

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

View File

@ -33,6 +33,7 @@ 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`)
*/
@ -41,6 +42,7 @@ function buildIndicesCreate (opts) {
'wait_for_active_shards',
'timeout',
'master_timeout',
'update_all_types',
'pretty',
'human',
'error_trace',
@ -52,6 +54,7 @@ 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: false)
* @param {boolean} include_type_name - Whether to add the type name to the response (default: true)
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {boolean} ignore_unavailable - Ignore unavailable indexes (default: false)
* @param {boolean} allow_no_indices - Ignore if a wildcard expression resolves to no concrete indices (default: false)

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

View File

@ -36,6 +36,7 @@ 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
*/
@ -46,6 +47,7 @@ function buildIndicesPutMapping (opts) {
'ignore_unavailable',
'allow_no_indices',
'expand_wildcards',
'update_all_types',
'pretty',
'human',
'error_trace',
@ -59,6 +61,7 @@ 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

@ -35,8 +35,7 @@ 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 - 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 {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 {object} body - The request definitions (metadata-search request definition pairs), separated by newlines
*/
@ -47,7 +46,6 @@ function buildMsearch (opts) {
'pre_filter_shard_size',
'max_concurrent_shard_requests',
'rest_total_hits_as_int',
'ccs_minimize_roundtrips',
'pretty',
'human',
'error_trace',
@ -62,7 +60,6 @@ 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,8 +33,7 @@ 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 - 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 {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 {object} body - The request definitions (metadata-search request definition pairs), separated by newlines
*/
@ -43,7 +42,6 @@ function buildMsearchTemplate (opts) {
'typed_keys',
'max_concurrent_searches',
'rest_total_hits_as_int',
'ccs_minimize_roundtrips',
'pretty',
'human',
'error_trace',
@ -56,7 +54,6 @@ 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/master/secure-settings.html#reloadable-secure-settings) request
* Perform a [nodes.reload_secure_settings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/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,7 +33,6 @@ 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.
*/
@ -44,7 +43,6 @@ function buildReindex (opts) {
'wait_for_active_shards',
'wait_for_completion',
'requests_per_second',
'scroll',
'slices',
'pretty',
'human',

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 - Indicates whether hits.total should be rendered as an integer or an object in the rest search 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 {object} body - The scroll ID if not passed by URL or query parameter.
*/

View File

@ -32,7 +32,6 @@ 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
@ -69,16 +68,15 @@ 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 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} 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} pre_filter_shard_size - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
* @param {boolean} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
* @param {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 {object} body - The search definition using the Query DSL
*/
const acceptedQuerystring = [
'analyzer',
'analyze_wildcard',
'ccs_minimize_roundtrips',
'default_operator',
'df',
'explain',
@ -129,7 +127,6 @@ function buildSearch (opts) {
const snakeCase = {
analyzeWildcard: 'analyze_wildcard',
ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
defaultOperator: 'default_operator',
storedFields: 'stored_fields',
docvalueFields: 'docvalue_fields',

View File

@ -41,8 +41,7 @@ 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 - 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 {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 {object} body - The search definition template and its params
*/
@ -59,7 +58,6 @@ function buildSearchTemplate (opts) {
'profile',
'typed_keys',
'rest_total_hits_as_int',
'ccs_minimize_roundtrips',
'pretty',
'human',
'error_trace',
@ -75,7 +73,6 @@ 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

@ -91,6 +91,10 @@ function buildTermvectors (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') {
@ -115,12 +119,8 @@ function buildTermvectors (opts) {
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors'
} else if ((index) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_termvectors' + '/' + encodeURIComponent(id)
} else if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_termvectors'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors'
}
// build request object

View File

@ -32,6 +32,7 @@ function buildUpdate (opts) {
* @param {string} index - The name of the index
* @param {string} type - The type of the document
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
* @param {list} fields - A comma-separated list of fields to return in the response
* @param {list} _source - True or false to return the _source field or not, or a list of fields to return
* @param {list} _source_excludes - A list of fields to exclude from the returned _source field
* @param {list} _source_includes - A list of fields to extract and return from the _source field
@ -43,11 +44,14 @@ function buildUpdate (opts) {
* @param {time} timeout - Explicit operation timeout
* @param {number} if_seq_no - only perform the update operation if the last operation that has changed the document has the specified sequence number
* @param {number} if_primary_term - only perform the update operation if the last operation that has changed the document has the specified primary term
* @param {number} version - Explicit version number for concurrency control
* @param {enum} version_type - Specific version type
* @param {object} body - The request definition requires either `script` or partial `doc`
*/
const acceptedQuerystring = [
'wait_for_active_shards',
'fields',
'_source',
'_source_excludes',
'_source_exclude',
@ -61,6 +65,8 @@ function buildUpdate (opts) {
'timeout',
'if_seq_no',
'if_primary_term',
'version',
'version_type',
'pretty',
'human',
'error_trace',
@ -77,6 +83,7 @@ function buildUpdate (opts) {
retryOnConflict: 'retry_on_conflict',
ifSeqNo: 'if_seq_no',
ifPrimaryTerm: 'if_primary_term',
versionType: 'version_type',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
@ -102,6 +109,10 @@ function buildUpdate (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)
@ -128,11 +139,7 @@ function buildUpdate (opts) {
var path = ''
if ((index) != null && (type) != null && (id) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_update'
} else {
path = '/' + encodeURIComponent(index) + '/' + '_update' + '/' + encodeURIComponent(id)
}
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_update'
// build request object
const request = {

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildLicenseGet (opts) {
function buildXpackLicenseGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [license.get](https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html) request
* Perform a [xpack.license.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/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 buildLicenseGet (opts) {
}
return function licenseGet (params, options, callback) {
return function xpackLicenseGet (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -78,7 +78,7 @@ function buildLicenseGet (opts) {
var path = ''
path = '/' + '_license'
path = '/' + '_xpack' + '/' + 'license'
// build request object
const request = {
@ -93,4 +93,4 @@ function buildLicenseGet (opts) {
}
}
module.exports = buildLicenseGet
module.exports = buildXpackLicenseGet

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildLicensePost (opts) {
function buildXpackLicensePost (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [license.post](https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html) request
* Perform a [xpack.license.post](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/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 buildLicensePost (opts) {
}
return function licensePost (params, options, callback) {
return function xpackLicensePost (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -73,7 +73,7 @@ function buildLicensePost (opts) {
var path = ''
path = '/' + '_license'
path = '/' + '_xpack' + '/' + 'license'
// build request object
const request = {
@ -88,4 +88,4 @@ function buildLicensePost (opts) {
}
}
module.exports = buildLicensePost
module.exports = buildXpackLicensePost

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildLicensePostStartTrial (opts) {
function buildXpackLicensePostStartTrial (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [license.post_start_trial](https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html) request
* Perform a [xpack.license.post_start_trial](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/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 buildLicensePostStartTrial (opts) {
}
return function licensePostStartTrial (params, options, callback) {
return function xpackLicensePostStartTrial (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,7 +80,7 @@ function buildLicensePostStartTrial (opts) {
var path = ''
path = '/' + '_license' + '/' + 'start_trial'
path = '/' + '_xpack' + '/' + 'license' + '/' + 'start_trial'
// build request object
const request = {
@ -95,4 +95,4 @@ function buildLicensePostStartTrial (opts) {
}
}
module.exports = buildLicensePostStartTrial
module.exports = buildXpackLicensePostStartTrial

View File

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

View File

@ -0,0 +1,101 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMigrationGetAssistance (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.migration.get_assistance](https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html) request
*
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
*/
const acceptedQuerystring = [
'allow_no_indices',
'expand_wildcards',
'ignore_unavailable'
]
const snakeCase = {
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
ignoreUnavailable: 'ignore_unavailable'
}
return function xpackMigrationGetAssistance (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'GET'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((index) != null) {
path = '/' + '_xpack' + '/' + 'migration' + '/' + 'assistance' + '/' + encodeURIComponent(index)
} else {
path = '/' + '_xpack' + '/' + 'migration' + '/' + 'assistance'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildXpackMigrationGetAssistance

View File

@ -0,0 +1,97 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildXpackMigrationUpgrade (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [xpack.migration.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html) request
*
* @param {string} index - The name of the index
* @param {boolean} wait_for_completion - Should the request block until the upgrade operation is completed
*/
const acceptedQuerystring = [
'wait_for_completion'
]
const snakeCase = {
waitForCompletion: 'wait_for_completion'
}
return function xpackMigrationUpgrade (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'POST'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
path = '/' + '_xpack' + '/' + 'migration' + '/' + 'upgrade' + '/' + encodeURIComponent(index)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildXpackMigrationUpgrade

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlCloseJob (opts) {
function buildXpackMlCloseJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.close_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html) request
* Perform a [xpack.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 buildMlCloseJob (opts) {
}
return function mlCloseJob (params, options, callback) {
return function xpackMlCloseJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -85,7 +85,7 @@ function buildMlCloseJob (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_close'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_close'
// build request object
const request = {
@ -100,4 +100,4 @@ function buildMlCloseJob (opts) {
}
}
module.exports = buildMlCloseJob
module.exports = buildXpackMlCloseJob

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlDeleteCalendarEvent (opts) {
function buildXpackMlDeleteCalendarEvent (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.delete_calendar_event](undefined) request
* Perform a [xpack.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 buildMlDeleteCalendarEvent (opts) {
}
return function mlDeleteCalendarEvent (params, options, callback) {
return function xpackMlDeleteCalendarEvent (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -93,7 +93,7 @@ function buildMlDeleteCalendarEvent (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events' + '/' + encodeURIComponent(event_id || eventId)
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events' + '/' + encodeURIComponent(event_id || eventId)
// build request object
const request = {
@ -108,4 +108,4 @@ function buildMlDeleteCalendarEvent (opts) {
}
}
module.exports = buildMlDeleteCalendarEvent
module.exports = buildXpackMlDeleteCalendarEvent

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlDeleteCalendarJob (opts) {
function buildXpackMlDeleteCalendarJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.delete_calendar_job](undefined) request
* Perform a [xpack.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 buildMlDeleteCalendarJob (opts) {
}
return function mlDeleteCalendarJob (params, options, callback) {
return function xpackMlDeleteCalendarJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -93,7 +93,7 @@ function buildMlDeleteCalendarJob (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId)
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId)
// build request object
const request = {
@ -108,4 +108,4 @@ function buildMlDeleteCalendarJob (opts) {
}
}
module.exports = buildMlDeleteCalendarJob
module.exports = buildXpackMlDeleteCalendarJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlDeleteDatafeed (opts) {
function buildXpackMlDeleteDatafeed (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.delete_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html) request
* Perform a [xpack.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 buildMlDeleteDatafeed (opts) {
}
return function mlDeleteDatafeed (params, options, callback) {
return function xpackMlDeleteDatafeed (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildMlDeleteDatafeed (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildMlDeleteDatafeed (opts) {
}
}
module.exports = buildMlDeleteDatafeed
module.exports = buildXpackMlDeleteDatafeed

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlDeleteForecast (opts) {
function buildXpackMlDeleteForecast (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.delete_forecast](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html) request
* Perform a [xpack.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 buildMlDeleteForecast (opts) {
}
return function mlDeleteForecast (params, options, callback) {
return function xpackMlDeleteForecast (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -94,9 +94,9 @@ function buildMlDeleteForecast (opts) {
var path = ''
if ((job_id || jobId) != null && (forecast_id || forecastId) != null) {
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast' + '/' + encodeURIComponent(forecast_id || forecastId)
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast' + '/' + encodeURIComponent(forecast_id || forecastId)
} else {
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast'
}
// build request object
@ -112,4 +112,4 @@ function buildMlDeleteForecast (opts) {
}
}
module.exports = buildMlDeleteForecast
module.exports = buildXpackMlDeleteForecast

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlFindFileStructure (opts) {
function buildXpackMlFindFileStructure (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.find_file_structure](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html) request
* Perform a [xpack.ml.find_file_structure](http://www.elastic.co/guide/en/elasticsearch/reference/6.7/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 buildMlFindFileStructure (opts) {
}
return function mlFindFileStructure (params, options, callback) {
return function xpackMlFindFileStructure (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -110,7 +110,7 @@ function buildMlFindFileStructure (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'find_file_structure'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'find_file_structure'
// build request object
const request = {
@ -125,4 +125,4 @@ function buildMlFindFileStructure (opts) {
}
}
module.exports = buildMlFindFileStructure
module.exports = buildXpackMlFindFileStructure

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlFlushJob (opts) {
function buildXpackMlFlushJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.flush_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html) request
* Perform a [xpack.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 buildMlFlushJob (opts) {
skipTime: 'skip_time'
}
return function mlFlushJob (params, options, callback) {
return function xpackMlFlushJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -90,7 +90,7 @@ function buildMlFlushJob (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_flush'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_flush'
// build request object
const request = {
@ -105,4 +105,4 @@ function buildMlFlushJob (opts) {
}
}
module.exports = buildMlFlushJob
module.exports = buildXpackMlFlushJob

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetCalendarEvents (opts) {
function buildXpackMlGetCalendarEvents (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_calendar_events](undefined) request
* Perform a [xpack.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 buildMlGetCalendarEvents (opts) {
}
return function mlGetCalendarEvents (params, options, callback) {
return function xpackMlGetCalendarEvents (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -92,7 +92,7 @@ function buildMlGetCalendarEvents (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
// build request object
const request = {
@ -107,4 +107,4 @@ function buildMlGetCalendarEvents (opts) {
}
}
module.exports = buildMlGetCalendarEvents
module.exports = buildXpackMlGetCalendarEvents

View File

@ -22,16 +22,15 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetCalendars (opts) {
function buildXpackMlGetCalendars (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_calendars](undefined) request
* Perform a [xpack.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 = [
@ -43,7 +42,7 @@ function buildMlGetCalendars (opts) {
}
return function mlGetCalendars (params, options, callback) {
return function xpackMlGetCalendars (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -55,6 +54,12 @@ function buildMlGetCalendars (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}`)
@ -77,16 +82,16 @@ function buildMlGetCalendars (opts) {
var path = ''
if ((calendar_id || calendarId) != null) {
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
} else {
path = '/' + '_ml' + '/' + 'calendars'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars'
}
// build request object
const request = {
method,
path,
body: body || '',
body: '',
querystring
}
@ -95,4 +100,4 @@ function buildMlGetCalendars (opts) {
}
}
module.exports = buildMlGetCalendars
module.exports = buildXpackMlGetCalendars

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetDatafeedStats (opts) {
function buildXpackMlGetDatafeedStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_datafeed_stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html) request
* Perform a [xpack.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 buildMlGetDatafeedStats (opts) {
allowNoDatafeeds: 'allow_no_datafeeds'
}
return function mlGetDatafeedStats (params, options, callback) {
return function xpackMlGetDatafeedStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,9 +80,9 @@ function buildMlGetDatafeedStats (opts) {
var path = ''
if ((datafeed_id || datafeedId) != null) {
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stats'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stats'
} else {
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + '_stats'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + '_stats'
}
// build request object
@ -98,4 +98,4 @@ function buildMlGetDatafeedStats (opts) {
}
}
module.exports = buildMlGetDatafeedStats
module.exports = buildXpackMlGetDatafeedStats

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetDatafeeds (opts) {
function buildXpackMlGetDatafeeds (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_datafeeds](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html) request
* Perform a [xpack.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 buildMlGetDatafeeds (opts) {
allowNoDatafeeds: 'allow_no_datafeeds'
}
return function mlGetDatafeeds (params, options, callback) {
return function xpackMlGetDatafeeds (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,9 +80,9 @@ function buildMlGetDatafeeds (opts) {
var path = ''
if ((datafeed_id || datafeedId) != null) {
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
} else {
path = '/' + '_ml' + '/' + 'datafeeds'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds'
}
// build request object
@ -98,4 +98,4 @@ function buildMlGetDatafeeds (opts) {
}
}
module.exports = buildMlGetDatafeeds
module.exports = buildXpackMlGetDatafeeds

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetFilters (opts) {
function buildXpackMlGetFilters (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_filters](undefined) request
* Perform a [xpack.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 buildMlGetFilters (opts) {
}
return function mlGetFilters (params, options, callback) {
return function xpackMlGetFilters (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -82,9 +82,9 @@ function buildMlGetFilters (opts) {
var path = ''
if ((filter_id || filterId) != null) {
path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId)
} else {
path = '/' + '_ml' + '/' + 'filters'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'filters'
}
// build request object
@ -100,4 +100,4 @@ function buildMlGetFilters (opts) {
}
}
module.exports = buildMlGetFilters
module.exports = buildXpackMlGetFilters

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetJobStats (opts) {
function buildXpackMlGetJobStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_job_stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html) request
* Perform a [xpack.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 buildMlGetJobStats (opts) {
allowNoJobs: 'allow_no_jobs'
}
return function mlGetJobStats (params, options, callback) {
return function xpackMlGetJobStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,9 +80,9 @@ function buildMlGetJobStats (opts) {
var path = ''
if ((job_id || jobId) != null) {
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_stats'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_stats'
} else {
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_stats'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + '_stats'
}
// build request object
@ -98,4 +98,4 @@ function buildMlGetJobStats (opts) {
}
}
module.exports = buildMlGetJobStats
module.exports = buildXpackMlGetJobStats

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetJobs (opts) {
function buildXpackMlGetJobs (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_jobs](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html) request
* Perform a [xpack.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 buildMlGetJobs (opts) {
allowNoJobs: 'allow_no_jobs'
}
return function mlGetJobs (params, options, callback) {
return function xpackMlGetJobs (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,9 +80,9 @@ function buildMlGetJobs (opts) {
var path = ''
if ((job_id || jobId) != null) {
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
} else {
path = '/' + '_ml' + '/' + 'anomaly_detectors'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors'
}
// build request object
@ -98,4 +98,4 @@ function buildMlGetJobs (opts) {
}
}
module.exports = buildMlGetJobs
module.exports = buildXpackMlGetJobs

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlGetOverallBuckets (opts) {
function buildXpackMlGetOverallBuckets (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_overall_buckets](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html) request
* Perform a [xpack.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 buildMlGetOverallBuckets (opts) {
allowNoJobs: 'allow_no_jobs'
}
return function mlGetOverallBuckets (params, options, callback) {
return function xpackMlGetOverallBuckets (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -96,7 +96,7 @@ function buildMlGetOverallBuckets (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'overall_buckets'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'overall_buckets'
// build request object
const request = {
@ -111,4 +111,4 @@ function buildMlGetOverallBuckets (opts) {
}
}
module.exports = buildMlGetOverallBuckets
module.exports = buildXpackMlGetOverallBuckets

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlOpenJob (opts) {
function buildXpackMlOpenJob (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.open_job](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html) request
* Perform a [xpack.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 buildMlOpenJob (opts) {
}
return function mlOpenJob (params, options, callback) {
return function xpackMlOpenJob (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -84,7 +84,7 @@ function buildMlOpenJob (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_open'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_open'
// build request object
const request = {
@ -99,4 +99,4 @@ function buildMlOpenJob (opts) {
}
}
module.exports = buildMlOpenJob
module.exports = buildXpackMlOpenJob

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlPostCalendarEvents (opts) {
function buildXpackMlPostCalendarEvents (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.post_calendar_events](undefined) request
* Perform a [xpack.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 buildMlPostCalendarEvents (opts) {
}
return function mlPostCalendarEvents (params, options, callback) {
return function xpackMlPostCalendarEvents (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildMlPostCalendarEvents (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
// build request object
const request = {
@ -98,4 +98,4 @@ function buildMlPostCalendarEvents (opts) {
}
}
module.exports = buildMlPostCalendarEvents
module.exports = buildXpackMlPostCalendarEvents

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlPostData (opts) {
function buildXpackMlPostData (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.post_data](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html) request
* Perform a [xpack.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 buildMlPostData (opts) {
resetEnd: 'reset_end'
}
return function mlPostData (params, options, callback) {
return function xpackMlPostData (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -87,7 +87,7 @@ function buildMlPostData (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_data'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_data'
// build request object
const request = {
@ -102,4 +102,4 @@ function buildMlPostData (opts) {
}
}
module.exports = buildMlPostData
module.exports = buildXpackMlPostData

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlSetUpgradeMode (opts) {
function buildXpackMlSetUpgradeMode (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.set_upgrade_mode](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html) request
* Perform a [xpack.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 buildMlSetUpgradeMode (opts) {
}
return function mlSetUpgradeMode (params, options, callback) {
return function xpackMlSetUpgradeMode (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -80,7 +80,7 @@ function buildMlSetUpgradeMode (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'set_upgrade_mode'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'set_upgrade_mode'
// build request object
const request = {
@ -95,4 +95,4 @@ function buildMlSetUpgradeMode (opts) {
}
}
module.exports = buildMlSetUpgradeMode
module.exports = buildXpackMlSetUpgradeMode

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMlStopDatafeed (opts) {
function buildXpackMlStopDatafeed (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.stop_datafeed](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html) request
* Perform a [xpack.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 buildMlStopDatafeed (opts) {
}
return function mlStopDatafeed (params, options, callback) {
return function xpackMlStopDatafeed (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -84,7 +84,7 @@ function buildMlStopDatafeed (opts) {
var path = ''
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stop'
path = '/' + '_xpack' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stop'
// build request object
const request = {
@ -99,4 +99,4 @@ function buildMlStopDatafeed (opts) {
}
}
module.exports = buildMlStopDatafeed
module.exports = buildXpackMlStopDatafeed

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildMonitoringBulk (opts) {
function buildXpackMonitoringBulk (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [monitoring.bulk](https://www.elastic.co/guide/en/elasticsearch/reference/master/es-monitoring.html) request
* Perform a [xpack.monitoring.bulk](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/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 buildMonitoringBulk (opts) {
}
return function monitoringBulk (params, options, callback) {
return function xpackMonitoringBulk (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -87,9 +87,9 @@ function buildMonitoringBulk (opts) {
var path = ''
if ((type) != null) {
path = '/' + '_monitoring' + '/' + encodeURIComponent(type) + '/' + 'bulk'
path = '/' + '_xpack' + '/' + 'monitoring' + '/' + encodeURIComponent(type) + '/' + '_bulk'
} else {
path = '/' + '_monitoring' + '/' + 'bulk'
path = '/' + '_xpack' + '/' + 'monitoring' + '/' + '_bulk'
}
// build request object
@ -105,4 +105,4 @@ function buildMonitoringBulk (opts) {
}
}
module.exports = buildMonitoringBulk
module.exports = buildXpackMonitoringBulk

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildSecurityChangePassword (opts) {
function buildXpackSecurityChangePassword (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [security.change_password](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html) request
* Perform a [xpack.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 buildSecurityChangePassword (opts) {
}
return function securityChangePassword (params, options, callback) {
return function xpackSecurityChangePassword (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -81,9 +81,9 @@ function buildSecurityChangePassword (opts) {
var path = ''
if ((username) != null) {
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_password'
path = '/' + '_xpack' + '/' + 'security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_password'
} else {
path = '/' + '_security' + '/' + 'user' + '/' + '_password'
path = '/' + '_xpack' + '/' + 'security' + '/' + 'user' + '/' + '_password'
}
// build request object
@ -99,4 +99,4 @@ function buildSecurityChangePassword (opts) {
}
}
module.exports = buildSecurityChangePassword
module.exports = buildXpackSecurityChangePassword

View File

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

View File

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

View File

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

View File

@ -22,11 +22,11 @@
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildSecurityDeleteRole (opts) {
function buildXpackSecurityDeleteRole (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [security.delete_role](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html) request
* Perform a [xpack.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 buildSecurityDeleteRole (opts) {
}
return function securityDeleteRole (params, options, callback) {
return function xpackSecurityDeleteRole (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
@ -83,7 +83,7 @@ function buildSecurityDeleteRole (opts) {
var path = ''
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
path = '/' + '_xpack' + '/' + 'security' + '/' + 'role' + '/' + encodeURIComponent(name)
// build request object
const request = {
@ -98,4 +98,4 @@ function buildSecurityDeleteRole (opts) {
}
}
module.exports = buildSecurityDeleteRole
module.exports = buildXpackSecurityDeleteRole

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