Compare commits

...

58 Commits

Author SHA1 Message Date
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
183 changed files with 3757 additions and 2630 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,11 +1,10 @@
---
ELASTICSEARCH_VERSION:
- 7.0.0-beta1
- 6.7.1
NODE_JS_VERSION:
- 11
- 10
- 8
- 6
exclude: ~

View File

@ -67,3 +67,6 @@ scripts
.ci
.travis.yml
certs
.github
CODE_OF_CONDUCT.md
CONTRIBUTING.md

View File

@ -5,18 +5,18 @@ sudo: required
language: node_js
node_js:
- "11"
- "10"
- "8"
- "6"
env:
global:
- ELASTICSEARCH_VERSION=7.0.0-beta1
- ELASTICSEARCH_VERSION=6.7.1
- QUIET=true
before_install:
- wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}-linux-x86_64.tar.gz
- tar -xzf elasticsearch-${ELASTICSEARCH_VERSION}-linux-x86_64.tar.gz
- wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz
- tar -xzf elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz
- ./elasticsearch-${ELASTICSEARCH_VERSION}/bin/elasticsearch -Enode.attr.testattr=test -Epath.repo=/tmp -Erepositories.url.allowed_urls='http://snapshot.*' &> /dev/null &
install:

3
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,3 @@
303 See Other
Location: https://www.elastic.co/community/codeofconduct

100
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,100 @@
# Contributing to the Elasticsearch Node.js client
The Elasticsearch Node.js client is open source and we love to receive contributions from our community — you!
There are many ways to contribute,
from writing tutorials or blog posts,
improving the documentation,
submitting bug reports and feature requests or writing code.
## Repository structure
The `master` branch is considered unstable, and it's compatible with Elasticsearch master. Unless you are patching an issue, new features should always be sent to the `master` branch, in case of a bugfix, it depends if the bug affects all the release lines.<br/>
There is a branch for every supported release line, such as `7.x` or `6.x`. We release bugfixes as soon as possible, while minor and major releases are published at the same time of the Elastic Stack.
Usually for every release line there will be a *published* version and a *next* version. Eg: the `7.x` branch contains the version published on npm, and bugfixes should be sent there, while `7.2` *(assuming that 7.1.x is released)* contains the next version, and new features should be sent there.
## Code contributions
If you have a bugfix or new feature that you would like to contribute,
please find or open an issue about it first.
Talk about what you would like to do.
It may be that somebody is already working on it,
or that there are particular issues that you should know about before implementing the change.
Note that we strictly follow the [Elastic EOL schedule](https://www.elastic.co/support/eol).
### Submitting your changes
Generally, we require that you test any code you are adding or modifying.
Once your changes are ready to submit for review:
1. Test your changes
Run the test suite to make sure that nothing is broken.
Usually run `npm test` is enough, our CI will take care of running the integration test. If you want to run the integration test yourself, see the *Testing* section below.
2. Submit a pull request
Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests).
In the pull request,
choose a title which sums up the changes that you have made,
and in the body provide more details about what your changes do.
Also mention the number of the issue where discussion has taken place,
eg "Closes #123".
3. Sign the Contributor License Agreement
Please make sure you have signed our [Contributor License Agreement](https://www.elastic.co/contributor-agreement/).
We are not asking you to assign copyright to us,
but to give us the right to distribute your code without restriction.
We ask this of all contributors in order to assure our users of the origin and continuing existence of the code.
You only need to sign the CLA once.
4. Be patient
We might not be able to review your code as fast as we would like to,
but we'll do our best to dedicate it the attention it deserves.
Your effort is much appreciated!
### Code generation
The entire content of the API folder is generated as well as the `docs/reference.asciidoc` file.<br/>
If you want to run the code generation you should run the following command:
```sh
node scripts/generate --tag <tag name>
# or
node scripts/generate --branch <branch name>
```
Then you should copy the content of `api/generated.d.ts` into the `index.d.ts` file *(automate this step would be a nice pr!)*.
### Testing
There are different test scripts, usually during development you only need to run `npm test`, but if you want you can run just a part of the suite, following you will find all the testing scripts and what they do.
| Script | Description |
|---|---|
| `npm run test:unit` | Runs the content of the `test/unit` folder. |
| `npm run test:behavior` | Runs the content of the `test/behavior` folder. |
| `npm run test:types` | Runs the content of the `test/types` folder. |
| `npm run test:unit -- --cov --coverage-report=html` | Runs the content of the `test/unit` folder and calculates the code coverage. |
| `npm run test:integration` | Runs the integration test runner.<br/>*Note: it requires a living instance of Elasticsearch.* |
| `npm run lint` | Run the [linter](https://standardjs.com/). |
| `npm run lint:fix` | Fixes the lint errors. |
| `npm test` | Runs lint, unit, behavior, and types test. |
#### Integration test
The integration test are generated on the fly by the runner you will find inside `test/integration`, once you execute it, it will clone the Elasticsearch repository and checkout the correct version to grab the [OSS yaml files](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/test) and the [Elastic licensed yaml files](https://github.com/elastic/elasticsearch/tree/master/x-pack/plugin/src/test/resources/rest-api-spec/test) that will be used for generating the test.
Usually this step is executed by CI since it takes some time, but you can easily run this yourself! Just follow this steps:
1. Boot an Elasticsearch instance, you can do that by running `./scripts/es-docker.sh` or `./scripts/es-docker-platinum.sh`, the first one will work only with the OSS APIs, while the second will work also with the Elastic licensed APIs;
1. If you are running the OSS test, you should use `npm run test:integration`, otherwise use `TEST_ES_SERVER=https://elastic:changeme@localhost:9200 npm run test:integration`. You can also pass a `-b` parameter if you want the test to bail out at the first failure: `npm run test:integration -- -b`;
1. Grab a coffee, it will take some time ;)
### Releasing
If you have access to make releases, the process is as follows:
1. Update the version in `package.json` according to the scale of the change. (major, minor or patch)
1. Commit changes with message `Bumped vx.y.z` where `x.y.z` is the version in `package.json`
1. Create a release via the GitHub UI.
1. Wait for CI to finish running the test.
1. Publish to npm with `npm publish` *(see [publish](https://docs.npmjs.com/cli/publish) and [dist-tag](https://docs.npmjs.com/cli/dist-tag) docs)*

View File

@ -6,8 +6,7 @@
---
**Note:** In the past months we have worked on the new Elasticsearch Node.js client, we will announce it soon!
If you want you can already try it by following the instructions below, while if you're going to use the legacy one or report an issue, please check out [elastic/elasticsearch-js-legacy](https://github.com/elastic/elasticsearch-js-legacy).
**Note:** In the past months we have worked on the new Elasticsearch Node.js client, and if you want you can already try it by following the instructions below, while if you're going to use the legacy one or report an issue, please check out [elastic/elasticsearch-js-legacy](https://github.com/elastic/elasticsearch-js-legacy).
---
@ -28,11 +27,7 @@ npm install @elastic/elasticsearch
### Compatibility
---
**Warning:** currently on npm you will only find a beta release that works with Elasticsearch 7, we will add the support for Elasticsearch 5, 6, and 7 once we release the final version of this library.
---
The minimum supported version of Node.js is `v8`.
The library is compatible with all Elasticsearch versions since 5.x, but you should use the same major version of the Elasticsearch instance that you are using.
```
@ -47,7 +42,9 @@ The library is compatible with all Elasticsearch versions since 5.x, but you sho
```
## Usage
You can find the full documentation in the [docs](https://github.com/elastic/elasticsearch-js/tree/master/docs) folder.
You can find the full documentation in our [docs](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html) website.
```js
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
@ -77,7 +74,9 @@ The returned value of **every** API call is formed as follows:
}
```
### Client options
The client is designed to be easily configured as you see fit for your needs, following you can see all the possible options that you can use to configure it.
```ts
{
// the Elasticsearch endpoint to use

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_includes',

View File

@ -0,0 +1,127 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrForgetFollower (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.forget_follower](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
*
* @param {string} index - the name of the leader index for which specified follower retention leases should be removed
* @param {object} body - the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrForgetFollower (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrForgetFollower

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,13 +89,20 @@ 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['index'] == null)) {
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)
}
@ -121,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

@ -93,6 +93,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)
@ -119,11 +123,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
@ -90,6 +90,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)
@ -125,11 +129,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

@ -99,6 +99,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') {
@ -121,11 +125,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

@ -99,6 +99,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)
@ -125,11 +129,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
@ -90,6 +90,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)
@ -116,11 +120,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

@ -91,13 +91,20 @@ 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['index'] == null)) {
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)
}
@ -125,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) {
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'POST'
method = body == null ? 'GET' : 'POST'
}
var ignore = options.ignore || null

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 } = 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

@ -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',
@ -127,7 +125,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_includes',
@ -59,6 +63,8 @@ function buildUpdate (opts) {
'timeout',
'if_seq_no',
'if_primary_term',
'version',
'version_type',
'pretty',
'human',
'error_trace',
@ -73,6 +79,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'
}
@ -98,6 +105,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)
@ -124,11 +135,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

@ -84,9 +84,9 @@ function buildXpackGraphExplore (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

View File

@ -77,7 +77,7 @@ function buildXpackLicenseDelete (opts) {
var path = ''
path = '/' + '_license'
path = '/' + '_xpack' + '/' + 'license'
// build request object
const request = {

View File

@ -78,7 +78,7 @@ function buildXpackLicenseGet (opts) {
var path = ''
path = '/' + '_license'
path = '/' + '_xpack' + '/' + 'license'
// build request object
const request = {

View File

@ -77,7 +77,7 @@ function buildXpackLicenseGetBasicStatus (opts) {
var path = ''
path = '/' + '_license' + '/' + 'basic_status'
path = '/' + '_xpack' + '/' + 'license' + '/' + 'basic_status'
// build request object
const request = {

View File

@ -77,7 +77,7 @@ function buildXpackLicenseGetTrialStatus (opts) {
var path = ''
path = '/' + '_license' + '/' + 'trial_status'
path = '/' + '_xpack' + '/' + 'license' + '/' + 'trial_status'
// build request object
const request = {

View File

@ -73,7 +73,7 @@ function buildXpackLicensePost (opts) {
var path = ''
path = '/' + '_license'
path = '/' + '_xpack' + '/' + 'license'
// build request object
const request = {

View File

@ -78,7 +78,7 @@ function buildXpackLicensePostStartBasic (opts) {
var path = ''
path = '/' + '_license' + '/' + 'start_basic'
path = '/' + '_xpack' + '/' + 'license' + '/' + 'start_basic'
// build request object
const request = {

View File

@ -80,7 +80,7 @@ function buildXpackLicensePostStartTrial (opts) {
var path = ''
path = '/' + '_license' + '/' + 'start_trial'
path = '/' + '_xpack' + '/' + 'license' + '/' + 'start_trial'
// build request object
const request = {

View File

@ -79,9 +79,9 @@ function buildXpackMigrationDeprecations (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

View File

@ -80,9 +80,9 @@ function buildXpackMigrationGetAssistance (opts) {
var path = ''
if ((index) != null) {
path = '/' + '_migration' + '/' + 'assistance' + '/' + encodeURIComponent(index)
path = '/' + '_xpack' + '/' + 'migration' + '/' + 'assistance' + '/' + encodeURIComponent(index)
} else {
path = '/' + '_migration' + '/' + 'assistance'
path = '/' + '_xpack' + '/' + 'migration' + '/' + 'assistance'
}
// build request object

View File

@ -79,7 +79,7 @@ function buildXpackMigrationUpgrade (opts) {
var path = ''
path = '/' + '_migration' + '/' + 'upgrade' + '/' + encodeURIComponent(index)
path = '/' + '_xpack' + '/' + 'migration' + '/' + 'upgrade' + '/' + encodeURIComponent(index)
// build request object
const request = {

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 } = 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 = {
@ -126,4 +126,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 } = 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 = {
@ -123,4 +123,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 } = 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 = {
@ -134,4 +134,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 } = 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 = {
@ -134,4 +134,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 } = 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 = {
@ -124,4 +124,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 buildMlDeleteExpiredData (opts) {
function buildXpackMlDeleteExpiredData (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ml.delete_expired_data](undefined) request
* Perform a [xpack.ml.delete_expired_data](undefined) request
*
*/
@ -38,7 +38,7 @@ function buildMlDeleteExpiredData (opts) {
}
return function mlDeleteExpiredData (params, options, callback) {
return function xpackMlDeleteExpiredData (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' + '/' + 'ml' + '/' + '_delete_expired_data'
// build request object
const request = {
@ -118,4 +118,4 @@ function buildMlDeleteExpiredData (opts) {
}
}
module.exports = buildMlDeleteExpiredData
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 } = 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 = {
@ -123,4 +123,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 } = 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
@ -138,4 +138,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 } = 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 = {
@ -126,4 +126,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 } = 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 = {
@ -134,4 +134,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 } = opts
/**
* Perform a [ml.find_file_structure](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html) request
* Perform a [xpack.ml.find_file_structure](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html) request
*
* @param {int} lines_to_sample - How many lines of the file should be included in the analysis
* @param {time} timeout - Timeout after which the analysis will be aborted
@ -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 = {
@ -151,4 +151,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 } = 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 = {
@ -131,4 +131,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 } = 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 = {
@ -126,4 +126,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 } = 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
@ -150,4 +150,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 } = 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 = {
@ -133,4 +133,4 @@ function buildMlGetCalendarEvents (opts) {
}
}
module.exports = buildMlGetCalendarEvents
module.exports = buildXpackMlGetCalendarEvents

View File

@ -22,11 +22,11 @@
/* 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 } = 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
@ -42,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
@ -82,9 +82,9 @@ 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
@ -126,4 +126,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 } = 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
@ -128,4 +128,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 } = 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
@ -124,4 +124,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 } = 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
@ -124,4 +124,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 } = 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
@ -126,4 +126,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 } = 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 = {
@ -137,4 +137,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 } = 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
@ -124,4 +124,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 } = 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
@ -124,4 +124,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 } = 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
@ -142,4 +142,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 } = 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 = {
@ -137,4 +137,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 } = 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 = {
@ -137,4 +137,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 } = 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 = {
@ -112,4 +112,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 } = 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 = {
@ -125,4 +125,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 } = 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 = {
@ -124,4 +124,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 } = 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 = {
@ -128,4 +128,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 } = 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 = {
@ -123,4 +123,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 } = 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 = {
@ -120,4 +120,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 } = 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 = {
@ -134,4 +134,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 } = 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 = {
@ -124,4 +124,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 } = 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 = {
@ -124,4 +124,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 } = 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 = {
@ -124,4 +124,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 } = 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 = {
@ -132,4 +132,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 } = 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 = {
@ -121,4 +121,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 } = 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 = {
@ -125,4 +125,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 } = 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 = {
@ -125,4 +125,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 } = 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 = {
@ -124,4 +124,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 } = 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 = {
@ -124,4 +124,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 } = 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 = {
@ -124,4 +124,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 } = 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 = {
@ -135,4 +135,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 } = 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 = {
@ -119,4 +119,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 } = 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 = {
@ -119,4 +119,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 } = opts
/**
* Perform a [monitoring.bulk](http://www.elastic.co/guide/en/monitoring/current/appendix-api-bulk.html) request
* Perform a [xpack.monitoring.bulk](http://www.elastic.co/guide/en/monitoring/current/appendix-api-bulk.html) request
*
* @param {string} type - Default document type for items which don't provide one
* @param {string} system_id - Identifier of the monitored system
@ -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
@ -131,4 +131,4 @@ function buildMonitoringBulk (opts) {
}
}
module.exports = buildMonitoringBulk
module.exports = buildXpackMonitoringBulk

View File

@ -78,7 +78,7 @@ function buildXpackRollupDeleteJob (opts) {
var path = ''
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -73,9 +73,9 @@ function buildXpackRollupGetJobs (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

View File

@ -73,9 +73,9 @@ function buildXpackRollupGetRollupCaps (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

View File

@ -78,7 +78,7 @@ function buildXpackRollupGetRollupIndexCaps (opts) {
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + 'data'
path = '/' + encodeURIComponent(index) + '/' + '_xpack' + '/' + 'rollup' + '/' + 'data'
// build request object
const request = {

View File

@ -83,7 +83,7 @@ function buildXpackRollupPutJob (opts) {
var path = ''
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
// build request object
const request = {

View File

@ -31,18 +31,15 @@ function buildXpackRollupRollupSearch (opts) {
* @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 xpackRollupRollupSearch (params, options, callback) {

View File

@ -78,7 +78,7 @@ function buildXpackRollupStartJob (opts) {
var path = ''
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_start'
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_start'
// build request object
const request = {

View File

@ -82,7 +82,7 @@ function buildXpackRollupStopJob (opts) {
var path = ''
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_stop'
path = '/' + '_xpack' + '/' + 'rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_stop'
// build request object
const request = {

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 } = opts
/**
* Perform a [security.get_user_privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-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 = {
@ -118,4 +118,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 } = 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
@ -125,4 +125,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 } = 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 = {
@ -124,4 +124,4 @@ function buildSecurityClearCachedRealms (opts) {
}
}
module.exports = buildSecurityClearCachedRealms
module.exports = buildXpackSecurityClearCachedRealms

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