Compare commits
30 Commits
georgewall
...
v7.0.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
| ca0b33a2b0 | |||
| 74c37e5b2d | |||
| 0e47cb88eb | |||
| f97208214e | |||
| 6f4a8bbe6a | |||
| c0264393a1 | |||
| 92bcf46ab4 | |||
| af544e8a55 | |||
| fbf804869f | |||
| f3422a6f43 | |||
| f2c43a843b | |||
| 1f6c68df9c | |||
| c7675708de | |||
| e897d8f050 | |||
| 4537308c38 | |||
| 3a1bb9377a | |||
| e185a0b08c | |||
| 9b111ee664 | |||
| 367f16c0ba | |||
| 1d61cba014 | |||
| 358474bca8 | |||
| c0027b3958 | |||
| 68c4dd29fb | |||
| a3e3d57247 | |||
| c3966cacab | |||
| 048933f106 | |||
| 91935905b6 | |||
| 0f5ac8127c | |||
| 99e1dc3b39 | |||
| e98cab1a34 |
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
ELASTICSEARCH_VERSION:
|
ELASTICSEARCH_VERSION:
|
||||||
- 7.0.0-beta1
|
- 7.0.0-rc1
|
||||||
|
|
||||||
NODE_JS_VERSION:
|
NODE_JS_VERSION:
|
||||||
- 11
|
- 11
|
||||||
|
|||||||
@ -11,7 +11,7 @@ node_js:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- ELASTICSEARCH_VERSION=7.0.0-beta1
|
- ELASTICSEARCH_VERSION=7.0.0-rc1
|
||||||
- QUIET=true
|
- QUIET=true
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
|
|||||||
3
CODE_OF_CONDUCT.md
Normal file
3
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
303 See Other
|
||||||
|
|
||||||
|
Location: https://www.elastic.co/community/codeofconduct
|
||||||
100
CONTRIBUTING.md
Normal file
100
CONTRIBUTING.md
Normal 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)*
|
||||||
@ -51,6 +51,12 @@ function buildCcrFollowStats (opts) {
|
|||||||
options = {}
|
options = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check required parameters
|
||||||
|
if (params['index'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: index')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
|
|||||||
@ -22,25 +22,25 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackMigrationUpgrade (opts) {
|
function buildCcrForgetFollower (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.migration.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html) request
|
* Perform a [ccr.forget_follower](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
|
||||||
*
|
*
|
||||||
* @param {string} index - The name of the index
|
* @param {string} index - the name of the leader index for which specified follower retention leases should be removed
|
||||||
* @param {boolean} wait_for_completion - Should the request block until the upgrade operation is completed
|
* @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 acceptedQuerystring = [
|
||||||
'wait_for_completion'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
waitForCompletion: 'wait_for_completion'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackMigrationUpgrade (params, options, callback) {
|
return function ccrForgetFollower (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -57,6 +57,10 @@ function buildXpackMigrationUpgrade (opts) {
|
|||||||
const err = new ConfigurationError('Missing required parameter: index')
|
const err = new ConfigurationError('Missing required parameter: index')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
if (params['body'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: body')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
@ -79,7 +83,7 @@ function buildXpackMigrationUpgrade (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
path = '/' + '_migration' + '/' + 'upgrade' + '/' + encodeURIComponent(index)
|
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
|
||||||
|
|
||||||
// build request object
|
// build request object
|
||||||
const request = {
|
const request = {
|
||||||
@ -120,4 +124,4 @@ function buildXpackMigrationUpgrade (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackMigrationUpgrade
|
module.exports = buildCcrForgetFollower
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackGraphExplore (opts) {
|
function buildGraphExplore (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.graph.explore](https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html) request
|
* Perform a [graph.explore](https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
||||||
@ -44,7 +44,7 @@ function buildXpackGraphExplore (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackGraphExplore (params, options, callback) {
|
return function graphExplore (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -128,4 +128,4 @@ function buildXpackGraphExplore (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackGraphExplore
|
module.exports = buildGraphExplore
|
||||||
@ -29,11 +29,10 @@ function buildIlmExplainLifecycle (opts) {
|
|||||||
* Perform a [ilm.explain_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html) request
|
* Perform a [ilm.explain_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html) request
|
||||||
*
|
*
|
||||||
* @param {string} index - The name of the index to explain
|
* @param {string} index - The name of the index to explain
|
||||||
* @param {boolean} human - Return data such as dates in a human readable format
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
'human'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
|
|||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackLicenseDelete (opts) {
|
function buildLicenseDelete (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.license.delete](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
* Perform a [license.delete](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ function buildXpackLicenseDelete (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackLicenseDelete (params, options, callback) {
|
return function licenseDelete (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -118,4 +118,4 @@ function buildXpackLicenseDelete (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackLicenseDelete
|
module.exports = buildLicenseDelete
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackLicenseGet (opts) {
|
function buildLicenseGet (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.license.get](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
* Perform a [license.get](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
||||||
*
|
*
|
||||||
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackLicenseGet (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackLicenseGet (params, options, callback) {
|
return function licenseGet (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -119,4 +119,4 @@ function buildXpackLicenseGet (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackLicenseGet
|
module.exports = buildLicenseGet
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackLicenseGetBasicStatus (opts) {
|
function buildLicenseGetBasicStatus (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.license.get_basic_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
* Perform a [license.get_basic_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ function buildXpackLicenseGetBasicStatus (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackLicenseGetBasicStatus (params, options, callback) {
|
return function licenseGetBasicStatus (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -118,4 +118,4 @@ function buildXpackLicenseGetBasicStatus (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackLicenseGetBasicStatus
|
module.exports = buildLicenseGetBasicStatus
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackLicenseGetTrialStatus (opts) {
|
function buildLicenseGetTrialStatus (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.license.get_trial_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
* Perform a [license.get_trial_status](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ function buildXpackLicenseGetTrialStatus (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackLicenseGetTrialStatus (params, options, callback) {
|
return function licenseGetTrialStatus (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -118,4 +118,4 @@ function buildXpackLicenseGetTrialStatus (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackLicenseGetTrialStatus
|
module.exports = buildLicenseGetTrialStatus
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackLicensePost (opts) {
|
function buildLicensePost (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.license.post](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
* Perform a [license.post](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
||||||
*
|
*
|
||||||
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
|
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
|
||||||
* @param {object} body - licenses to be installed
|
* @param {object} body - licenses to be installed
|
||||||
@ -40,7 +40,7 @@ function buildXpackLicensePost (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackLicensePost (params, options, callback) {
|
return function licensePost (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -114,4 +114,4 @@ function buildXpackLicensePost (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackLicensePost
|
module.exports = buildLicensePost
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackLicensePostStartBasic (opts) {
|
function buildLicensePostStartBasic (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.license.post_start_basic](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
* Perform a [license.post_start_basic](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
||||||
*
|
*
|
||||||
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
|
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackLicensePostStartBasic (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackLicensePostStartBasic (params, options, callback) {
|
return function licensePostStartBasic (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -119,4 +119,4 @@ function buildXpackLicensePostStartBasic (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackLicensePostStartBasic
|
module.exports = buildLicensePostStartBasic
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackLicensePostStartTrial (opts) {
|
function buildLicensePostStartTrial (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.license.post_start_trial](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
* Perform a [license.post_start_trial](https://www.elastic.co/guide/en/x-pack/current/license-management.html) request
|
||||||
*
|
*
|
||||||
* @param {string} type - The type of trial license to generate (default: "trial")
|
* @param {string} type - The type of trial license to generate (default: "trial")
|
||||||
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
|
* @param {boolean} acknowledge - whether the user has acknowledged acknowledge messages (default: false)
|
||||||
@ -41,7 +41,7 @@ function buildXpackLicensePostStartTrial (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackLicensePostStartTrial (params, options, callback) {
|
return function licensePostStartTrial (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -121,4 +121,4 @@ function buildXpackLicensePostStartTrial (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackLicensePostStartTrial
|
module.exports = buildLicensePostStartTrial
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackMigrationDeprecations (opts) {
|
function buildMigrationDeprecations (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.migration.deprecations](http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html) request
|
* Perform a [migration.deprecations](http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html) request
|
||||||
*
|
*
|
||||||
* @param {string} index - Index pattern
|
* @param {string} index - Index pattern
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackMigrationDeprecations (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackMigrationDeprecations (params, options, callback) {
|
return function migrationDeprecations (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -123,4 +123,4 @@ function buildXpackMigrationDeprecations (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackMigrationDeprecations
|
module.exports = buildMigrationDeprecations
|
||||||
@ -31,6 +31,7 @@ function buildMlGetCalendars (opts) {
|
|||||||
* @param {string} calendar_id - The ID of the calendar to fetch
|
* @param {string} calendar_id - The ID of the calendar to fetch
|
||||||
* @param {int} from - skips a number of calendars
|
* @param {int} from - skips a number of calendars
|
||||||
* @param {int} size - specifies a max number of calendars to get
|
* @param {int} size - specifies a max number of calendars to get
|
||||||
|
* @param {object} body - The from and size parameters optionally sent in the body
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
const acceptedQuerystring = [
|
||||||
@ -54,12 +55,6 @@ function buildMlGetCalendars (opts) {
|
|||||||
options = {}
|
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
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -91,7 +86,7 @@ function buildMlGetCalendars (opts) {
|
|||||||
const request = {
|
const request = {
|
||||||
method,
|
method,
|
||||||
path,
|
path,
|
||||||
body: '',
|
body: body || '',
|
||||||
querystring
|
querystring
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ function buildReindex (opts) {
|
|||||||
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
||||||
* @param {boolean} wait_for_completion - Should the request should block until the reindex is complete.
|
* @param {boolean} wait_for_completion - Should the request should block until the reindex is complete.
|
||||||
* @param {number} requests_per_second - The throttle to set on this request in sub-requests per second. -1 means no throttle.
|
* @param {number} requests_per_second - The throttle to set on this request in sub-requests per second. -1 means no throttle.
|
||||||
|
* @param {time} scroll - Control how long to keep the search context alive
|
||||||
* @param {number} slices - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
|
* @param {number} slices - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
|
||||||
* @param {object} body - The search definition using the Query DSL and the prototype for the index request.
|
* @param {object} body - The search definition using the Query DSL and the prototype for the index request.
|
||||||
*/
|
*/
|
||||||
@ -43,6 +44,7 @@ function buildReindex (opts) {
|
|||||||
'wait_for_active_shards',
|
'wait_for_active_shards',
|
||||||
'wait_for_completion',
|
'wait_for_completion',
|
||||||
'requests_per_second',
|
'requests_per_second',
|
||||||
|
'scroll',
|
||||||
'slices',
|
'slices',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
|
|||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackRollupDeleteJob (opts) {
|
function buildRollupDeleteJob (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.rollup.delete_job]() request
|
* Perform a [rollup.delete_job]() request
|
||||||
*
|
*
|
||||||
* @param {string} id - The ID of the job to delete
|
* @param {string} id - The ID of the job to delete
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackRollupDeleteJob (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackRollupDeleteJob (params, options, callback) {
|
return function rollupDeleteJob (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -119,4 +119,4 @@ function buildXpackRollupDeleteJob (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackRollupDeleteJob
|
module.exports = buildRollupDeleteJob
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackRollupGetJobs (opts) {
|
function buildRollupGetJobs (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.rollup.get_jobs]() request
|
* Perform a [rollup.get_jobs]() request
|
||||||
*
|
*
|
||||||
* @param {string} id - The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs
|
* @param {string} id - The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackRollupGetJobs (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackRollupGetJobs (params, options, callback) {
|
return function rollupGetJobs (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -117,4 +117,4 @@ function buildXpackRollupGetJobs (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackRollupGetJobs
|
module.exports = buildRollupGetJobs
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackRollupGetRollupCaps (opts) {
|
function buildRollupGetRollupCaps (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.rollup.get_rollup_caps]() request
|
* Perform a [rollup.get_rollup_caps]() request
|
||||||
*
|
*
|
||||||
* @param {string} id - The ID of the index to check rollup capabilities on, or left blank for all jobs
|
* @param {string} id - The ID of the index to check rollup capabilities on, or left blank for all jobs
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackRollupGetRollupCaps (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackRollupGetRollupCaps (params, options, callback) {
|
return function rollupGetRollupCaps (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -117,4 +117,4 @@ function buildXpackRollupGetRollupCaps (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackRollupGetRollupCaps
|
module.exports = buildRollupGetRollupCaps
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackRollupGetRollupIndexCaps (opts) {
|
function buildRollupGetRollupIndexCaps (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.rollup.get_rollup_index_caps]() request
|
* Perform a [rollup.get_rollup_index_caps]() request
|
||||||
*
|
*
|
||||||
* @param {string} index - The rollup index or index pattern to obtain rollup capabilities from.
|
* @param {string} index - The rollup index or index pattern to obtain rollup capabilities from.
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackRollupGetRollupIndexCaps (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackRollupGetRollupIndexCaps (params, options, callback) {
|
return function rollupGetRollupIndexCaps (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -119,4 +119,4 @@ function buildXpackRollupGetRollupIndexCaps (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackRollupGetRollupIndexCaps
|
module.exports = buildRollupGetRollupIndexCaps
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackRollupPutJob (opts) {
|
function buildRollupPutJob (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.rollup.put_job]() request
|
* Perform a [rollup.put_job]() request
|
||||||
*
|
*
|
||||||
* @param {string} id - The ID of the job to create
|
* @param {string} id - The ID of the job to create
|
||||||
* @param {object} body - The job configuration
|
* @param {object} body - The job configuration
|
||||||
@ -40,7 +40,7 @@ function buildXpackRollupPutJob (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackRollupPutJob (params, options, callback) {
|
return function rollupPutJob (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -124,4 +124,4 @@ function buildXpackRollupPutJob (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackRollupPutJob
|
module.exports = buildRollupPutJob
|
||||||
@ -22,13 +22,13 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackRollupRollupSearch (opts) {
|
function buildRollupRollupSearch (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.rollup.rollup_search]() request
|
* Perform a [rollup.rollup_search]() request
|
||||||
*
|
*
|
||||||
* @param {string} index - The index or index-pattern (containing rollup or regular data) that should be searched
|
* @param {list} index - The indices or index-pattern(s) (containing rollup or regular data) that should be searched
|
||||||
* @param {string} type - The doc type inside the index
|
* @param {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} 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} rest_total_hits_as_int - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
|
||||||
@ -45,7 +45,7 @@ function buildXpackRollupRollupSearch (opts) {
|
|||||||
restTotalHitsAsInt: 'rest_total_hits_as_int'
|
restTotalHitsAsInt: 'rest_total_hits_as_int'
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackRollupRollupSearch (params, options, callback) {
|
return function rollupRollupSearch (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -139,4 +139,4 @@ function buildXpackRollupRollupSearch (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackRollupRollupSearch
|
module.exports = buildRollupRollupSearch
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackRollupStartJob (opts) {
|
function buildRollupStartJob (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.rollup.start_job]() request
|
* Perform a [rollup.start_job]() request
|
||||||
*
|
*
|
||||||
* @param {string} id - The ID of the job to start
|
* @param {string} id - The ID of the job to start
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackRollupStartJob (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackRollupStartJob (params, options, callback) {
|
return function rollupStartJob (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -119,4 +119,4 @@ function buildXpackRollupStartJob (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackRollupStartJob
|
module.exports = buildRollupStartJob
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackRollupStopJob (opts) {
|
function buildRollupStopJob (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.rollup.stop_job]() request
|
* Perform a [rollup.stop_job]() request
|
||||||
*
|
*
|
||||||
* @param {string} id - The ID of the job to stop
|
* @param {string} id - The ID of the job to stop
|
||||||
* @param {boolean} wait_for_completion - True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false.
|
* @param {boolean} wait_for_completion - True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false.
|
||||||
@ -43,7 +43,7 @@ function buildXpackRollupStopJob (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackRollupStopJob (params, options, callback) {
|
return function rollupStopJob (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -123,4 +123,4 @@ function buildXpackRollupStopJob (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackRollupStopJob
|
module.exports = buildRollupStopJob
|
||||||
@ -53,6 +53,10 @@ function buildSecurityDisableUser (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check required parameters
|
// check required parameters
|
||||||
|
if (params['username'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: username')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
if (params.body != null) {
|
if (params.body != null) {
|
||||||
const err = new ConfigurationError('This API does not require a body')
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
|
|||||||
@ -53,6 +53,10 @@ function buildSecurityEnableUser (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check required parameters
|
// check required parameters
|
||||||
|
if (params['username'] == null) {
|
||||||
|
const err = new ConfigurationError('Missing required parameter: username')
|
||||||
|
return handleError(err, callback)
|
||||||
|
}
|
||||||
if (params.body != null) {
|
if (params.body != null) {
|
||||||
const err = new ConfigurationError('This API does not require a body')
|
const err = new ConfigurationError('This API does not require a body')
|
||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
|
|||||||
@ -85,9 +85,9 @@ function buildSecurityGetPrivileges (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if (application && name) {
|
if ((application) != null && (name) != null) {
|
||||||
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
|
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
|
||||||
} else if (application) {
|
} else if ((application) != null) {
|
||||||
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application)
|
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application)
|
||||||
} else {
|
} else {
|
||||||
path = '/' + '_security' + '/' + 'privilege'
|
path = '/' + '_security' + '/' + 'privilege'
|
||||||
|
|||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackSqlClearCursor (opts) {
|
function buildSqlClearCursor (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.sql.clear_cursor](Clear SQL cursor) request
|
* Perform a [sql.clear_cursor](Clear SQL cursor) request
|
||||||
*
|
*
|
||||||
* @param {object} body - Specify the cursor value in the `cursor` element to clean the cursor.
|
* @param {object} body - Specify the cursor value in the `cursor` element to clean the cursor.
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackSqlClearCursor (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackSqlClearCursor (params, options, callback) {
|
return function sqlClearCursor (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -119,4 +119,4 @@ function buildXpackSqlClearCursor (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackSqlClearCursor
|
module.exports = buildSqlClearCursor
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackSqlQuery (opts) {
|
function buildSqlQuery (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.sql.query](Execute SQL) request
|
* Perform a [sql.query](Execute SQL) request
|
||||||
*
|
*
|
||||||
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
* @param {string} format - a short version of the Accept header, e.g. json, yaml
|
||||||
* @param {object} body - Use the `query` element to start a query. Use the `cursor` element to continue a query.
|
* @param {object} body - Use the `query` element to start a query. Use the `cursor` element to continue a query.
|
||||||
@ -40,7 +40,7 @@ function buildXpackSqlQuery (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackSqlQuery (params, options, callback) {
|
return function sqlQuery (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -120,4 +120,4 @@ function buildXpackSqlQuery (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackSqlQuery
|
module.exports = buildSqlQuery
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackSqlTranslate (opts) {
|
function buildSqlTranslate (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.sql.translate](Translate SQL into Elasticsearch queries) request
|
* Perform a [sql.translate](Translate SQL into Elasticsearch queries) request
|
||||||
*
|
*
|
||||||
* @param {object} body - Specify the query in the `query` element.
|
* @param {object} body - Specify the query in the `query` element.
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackSqlTranslate (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackSqlTranslate (params, options, callback) {
|
return function sqlTranslate (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -119,4 +119,4 @@ function buildXpackSqlTranslate (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackSqlTranslate
|
module.exports = buildSqlTranslate
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherAckWatch (opts) {
|
function buildWatcherAckWatch (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.ack_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html) request
|
* Perform a [watcher.ack_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html) request
|
||||||
*
|
*
|
||||||
* @param {string} watch_id - Watch ID
|
* @param {string} watch_id - Watch ID
|
||||||
* @param {list} action_id - A comma-separated list of the action ids to be acked
|
* @param {list} action_id - A comma-separated list of the action ids to be acked
|
||||||
@ -40,7 +40,7 @@ function buildXpackWatcherAckWatch (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherAckWatch (params, options, callback) {
|
return function watcherAckWatch (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -134,4 +134,4 @@ function buildXpackWatcherAckWatch (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherAckWatch
|
module.exports = buildWatcherAckWatch
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherActivateWatch (opts) {
|
function buildWatcherActivateWatch (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.activate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html) request
|
* Perform a [watcher.activate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html) request
|
||||||
*
|
*
|
||||||
* @param {string} watch_id - Watch ID
|
* @param {string} watch_id - Watch ID
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackWatcherActivateWatch (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherActivateWatch (params, options, callback) {
|
return function watcherActivateWatch (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -123,4 +123,4 @@ function buildXpackWatcherActivateWatch (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherActivateWatch
|
module.exports = buildWatcherActivateWatch
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherDeactivateWatch (opts) {
|
function buildWatcherDeactivateWatch (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.deactivate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html) request
|
* Perform a [watcher.deactivate_watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html) request
|
||||||
*
|
*
|
||||||
* @param {string} watch_id - Watch ID
|
* @param {string} watch_id - Watch ID
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackWatcherDeactivateWatch (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherDeactivateWatch (params, options, callback) {
|
return function watcherDeactivateWatch (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -123,4 +123,4 @@ function buildXpackWatcherDeactivateWatch (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherDeactivateWatch
|
module.exports = buildWatcherDeactivateWatch
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherDeleteWatch (opts) {
|
function buildWatcherDeleteWatch (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.delete_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html) request
|
* Perform a [watcher.delete_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - Watch ID
|
* @param {string} id - Watch ID
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackWatcherDeleteWatch (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherDeleteWatch (params, options, callback) {
|
return function watcherDeleteWatch (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -123,4 +123,4 @@ function buildXpackWatcherDeleteWatch (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherDeleteWatch
|
module.exports = buildWatcherDeleteWatch
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherExecuteWatch (opts) {
|
function buildWatcherExecuteWatch (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.execute_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html) request
|
* Perform a [watcher.execute_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - Watch ID
|
* @param {string} id - Watch ID
|
||||||
* @param {boolean} debug - indicates whether the watch should execute in debug mode
|
* @param {boolean} debug - indicates whether the watch should execute in debug mode
|
||||||
@ -41,7 +41,7 @@ function buildXpackWatcherExecuteWatch (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherExecuteWatch (params, options, callback) {
|
return function watcherExecuteWatch (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -119,4 +119,4 @@ function buildXpackWatcherExecuteWatch (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherExecuteWatch
|
module.exports = buildWatcherExecuteWatch
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherGetWatch (opts) {
|
function buildWatcherGetWatch (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.get_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html) request
|
* Perform a [watcher.get_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - Watch ID
|
* @param {string} id - Watch ID
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ function buildXpackWatcherGetWatch (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherGetWatch (params, options, callback) {
|
return function watcherGetWatch (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -123,4 +123,4 @@ function buildXpackWatcherGetWatch (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherGetWatch
|
module.exports = buildWatcherGetWatch
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherPutWatch (opts) {
|
function buildWatcherPutWatch (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.put_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html) request
|
* Perform a [watcher.put_watch](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html) request
|
||||||
*
|
*
|
||||||
* @param {string} id - Watch ID
|
* @param {string} id - Watch ID
|
||||||
* @param {boolean} active - Specify whether the watch is in/active by default
|
* @param {boolean} active - Specify whether the watch is in/active by default
|
||||||
@ -48,7 +48,7 @@ function buildXpackWatcherPutWatch (opts) {
|
|||||||
ifPrimaryTerm: 'if_primary_term'
|
ifPrimaryTerm: 'if_primary_term'
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherPutWatch (params, options, callback) {
|
return function watcherPutWatch (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -128,4 +128,4 @@ function buildXpackWatcherPutWatch (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherPutWatch
|
module.exports = buildWatcherPutWatch
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherStart (opts) {
|
function buildWatcherStart (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.start](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html) request
|
* Perform a [watcher.start](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html) request
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ function buildXpackWatcherStart (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherStart (params, options, callback) {
|
return function watcherStart (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -118,4 +118,4 @@ function buildXpackWatcherStart (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherStart
|
module.exports = buildWatcherStart
|
||||||
@ -22,14 +22,14 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherStats (opts) {
|
function buildWatcherStats (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html) request
|
* Perform a [watcher.stats](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html) request
|
||||||
*
|
*
|
||||||
* @param {enum} metric - Controls what additional stat metrics should be include in the response
|
* @param {list} metric - Controls what additional stat metrics should be include in the response
|
||||||
* @param {enum} metric - Controls what additional stat metrics should be include in the response
|
* @param {list} metric - Controls what additional stat metrics should be include in the response
|
||||||
* @param {boolean} emit_stacktraces - Emits stack traces of currently running watches
|
* @param {boolean} emit_stacktraces - Emits stack traces of currently running watches
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ function buildXpackWatcherStats (opts) {
|
|||||||
emitStacktraces: 'emit_stacktraces'
|
emitStacktraces: 'emit_stacktraces'
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherStats (params, options, callback) {
|
return function watcherStats (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -126,4 +126,4 @@ function buildXpackWatcherStats (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherStats
|
module.exports = buildWatcherStats
|
||||||
@ -22,11 +22,11 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildXpackWatcherStop (opts) {
|
function buildWatcherStop (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
const { makeRequest, ConfigurationError, handleError } = opts
|
||||||
/**
|
/**
|
||||||
* Perform a [xpack.watcher.stop](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html) request
|
* Perform a [watcher.stop](http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html) request
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ function buildXpackWatcherStop (opts) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return function xpackWatcherStop (params, options, callback) {
|
return function watcherStop (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -118,4 +118,4 @@ function buildXpackWatcherStop (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildXpackWatcherStop
|
module.exports = buildWatcherStop
|
||||||
@ -1,127 +0,0 @@
|
|||||||
/*
|
|
||||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict'
|
|
||||||
|
|
||||||
/* eslint camelcase: 0 */
|
|
||||||
/* eslint no-unused-vars: 0 */
|
|
||||||
|
|
||||||
function buildXpackMigrationGetAssistance (opts) {
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
const { makeRequest, ConfigurationError, handleError } = opts
|
|
||||||
/**
|
|
||||||
* Perform a [xpack.migration.get_assistance](https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html) request
|
|
||||||
*
|
|
||||||
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
|
||||||
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
|
||||||
*/
|
|
||||||
|
|
||||||
const acceptedQuerystring = [
|
|
||||||
'allow_no_indices',
|
|
||||||
'expand_wildcards',
|
|
||||||
'ignore_unavailable'
|
|
||||||
]
|
|
||||||
|
|
||||||
const snakeCase = {
|
|
||||||
allowNoIndices: 'allow_no_indices',
|
|
||||||
expandWildcards: 'expand_wildcards',
|
|
||||||
ignoreUnavailable: 'ignore_unavailable'
|
|
||||||
}
|
|
||||||
|
|
||||||
return function xpackMigrationGetAssistance (params, options, callback) {
|
|
||||||
options = options || {}
|
|
||||||
if (typeof options === 'function') {
|
|
||||||
callback = options
|
|
||||||
options = {}
|
|
||||||
}
|
|
||||||
if (typeof params === 'function' || params == null) {
|
|
||||||
callback = params
|
|
||||||
params = {}
|
|
||||||
options = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
var warnings = null
|
|
||||||
var { method, body, index } = params
|
|
||||||
var querystring = semicopy(params, ['method', 'body', 'index'])
|
|
||||||
|
|
||||||
if (method == null) {
|
|
||||||
method = 'GET'
|
|
||||||
}
|
|
||||||
|
|
||||||
var ignore = options.ignore || null
|
|
||||||
if (typeof ignore === 'number') {
|
|
||||||
ignore = [ignore]
|
|
||||||
}
|
|
||||||
|
|
||||||
var path = ''
|
|
||||||
|
|
||||||
if ((index) != null) {
|
|
||||||
path = '/' + '_migration' + '/' + 'assistance' + '/' + encodeURIComponent(index)
|
|
||||||
} else {
|
|
||||||
path = '/' + '_migration' + '/' + 'assistance'
|
|
||||||
}
|
|
||||||
|
|
||||||
// build request object
|
|
||||||
const request = {
|
|
||||||
method,
|
|
||||||
path,
|
|
||||||
body: null,
|
|
||||||
querystring
|
|
||||||
}
|
|
||||||
|
|
||||||
const requestOptions = {
|
|
||||||
ignore,
|
|
||||||
requestTimeout: options.requestTimeout || null,
|
|
||||||
maxRetries: options.maxRetries || null,
|
|
||||||
asStream: options.asStream || false,
|
|
||||||
headers: options.headers || null,
|
|
||||||
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 = buildXpackMigrationGetAssistance
|
|
||||||
131
api/index.js
131
api/index.js
@ -63,6 +63,8 @@ function ESAPI (opts) {
|
|||||||
followInfo: lazyLoad('ccr.follow_info', opts),
|
followInfo: lazyLoad('ccr.follow_info', opts),
|
||||||
follow_stats: lazyLoad('ccr.follow_stats', opts),
|
follow_stats: lazyLoad('ccr.follow_stats', opts),
|
||||||
followStats: lazyLoad('ccr.follow_stats', opts),
|
followStats: lazyLoad('ccr.follow_stats', opts),
|
||||||
|
forget_follower: lazyLoad('ccr.forget_follower', opts),
|
||||||
|
forgetFollower: lazyLoad('ccr.forget_follower', opts),
|
||||||
get_auto_follow_pattern: lazyLoad('ccr.get_auto_follow_pattern', opts),
|
get_auto_follow_pattern: lazyLoad('ccr.get_auto_follow_pattern', opts),
|
||||||
getAutoFollowPattern: lazyLoad('ccr.get_auto_follow_pattern', opts),
|
getAutoFollowPattern: lazyLoad('ccr.get_auto_follow_pattern', opts),
|
||||||
pause_follow: lazyLoad('ccr.pause_follow', opts),
|
pause_follow: lazyLoad('ccr.pause_follow', opts),
|
||||||
@ -112,6 +114,9 @@ function ESAPI (opts) {
|
|||||||
getScript: lazyLoad('get_script', opts),
|
getScript: lazyLoad('get_script', opts),
|
||||||
get_source: lazyLoad('get_source', opts),
|
get_source: lazyLoad('get_source', opts),
|
||||||
getSource: lazyLoad('get_source', opts),
|
getSource: lazyLoad('get_source', opts),
|
||||||
|
graph: {
|
||||||
|
explore: lazyLoad('graph.explore', opts)
|
||||||
|
},
|
||||||
ilm: {
|
ilm: {
|
||||||
delete_lifecycle: lazyLoad('ilm.delete_lifecycle', opts),
|
delete_lifecycle: lazyLoad('ilm.delete_lifecycle', opts),
|
||||||
deleteLifecycle: lazyLoad('ilm.delete_lifecycle', opts),
|
deleteLifecycle: lazyLoad('ilm.delete_lifecycle', opts),
|
||||||
@ -205,7 +210,23 @@ function ESAPI (opts) {
|
|||||||
putPipeline: lazyLoad('ingest.put_pipeline', opts),
|
putPipeline: lazyLoad('ingest.put_pipeline', opts),
|
||||||
simulate: lazyLoad('ingest.simulate', opts)
|
simulate: lazyLoad('ingest.simulate', opts)
|
||||||
},
|
},
|
||||||
|
license: {
|
||||||
|
delete: lazyLoad('license.delete', opts),
|
||||||
|
get: lazyLoad('license.get', opts),
|
||||||
|
get_basic_status: lazyLoad('license.get_basic_status', opts),
|
||||||
|
getBasicStatus: lazyLoad('license.get_basic_status', opts),
|
||||||
|
get_trial_status: lazyLoad('license.get_trial_status', opts),
|
||||||
|
getTrialStatus: lazyLoad('license.get_trial_status', opts),
|
||||||
|
post: lazyLoad('license.post', opts),
|
||||||
|
post_start_basic: lazyLoad('license.post_start_basic', opts),
|
||||||
|
postStartBasic: lazyLoad('license.post_start_basic', opts),
|
||||||
|
post_start_trial: lazyLoad('license.post_start_trial', opts),
|
||||||
|
postStartTrial: lazyLoad('license.post_start_trial', opts)
|
||||||
|
},
|
||||||
mget: lazyLoad('mget', opts),
|
mget: lazyLoad('mget', opts),
|
||||||
|
migration: {
|
||||||
|
deprecations: lazyLoad('migration.deprecations', opts)
|
||||||
|
},
|
||||||
ml: {
|
ml: {
|
||||||
close_job: lazyLoad('ml.close_job', opts),
|
close_job: lazyLoad('ml.close_job', opts),
|
||||||
closeJob: lazyLoad('ml.close_job', opts),
|
closeJob: lazyLoad('ml.close_job', opts),
|
||||||
@ -323,6 +344,24 @@ function ESAPI (opts) {
|
|||||||
reindexRethrottle: lazyLoad('reindex_rethrottle', opts),
|
reindexRethrottle: lazyLoad('reindex_rethrottle', opts),
|
||||||
render_search_template: lazyLoad('render_search_template', opts),
|
render_search_template: lazyLoad('render_search_template', opts),
|
||||||
renderSearchTemplate: lazyLoad('render_search_template', opts),
|
renderSearchTemplate: lazyLoad('render_search_template', opts),
|
||||||
|
rollup: {
|
||||||
|
delete_job: lazyLoad('rollup.delete_job', opts),
|
||||||
|
deleteJob: lazyLoad('rollup.delete_job', opts),
|
||||||
|
get_jobs: lazyLoad('rollup.get_jobs', opts),
|
||||||
|
getJobs: lazyLoad('rollup.get_jobs', opts),
|
||||||
|
get_rollup_caps: lazyLoad('rollup.get_rollup_caps', opts),
|
||||||
|
getRollupCaps: lazyLoad('rollup.get_rollup_caps', opts),
|
||||||
|
get_rollup_index_caps: lazyLoad('rollup.get_rollup_index_caps', opts),
|
||||||
|
getRollupIndexCaps: lazyLoad('rollup.get_rollup_index_caps', opts),
|
||||||
|
put_job: lazyLoad('rollup.put_job', opts),
|
||||||
|
putJob: lazyLoad('rollup.put_job', opts),
|
||||||
|
rollup_search: lazyLoad('rollup.rollup_search', opts),
|
||||||
|
rollupSearch: lazyLoad('rollup.rollup_search', opts),
|
||||||
|
start_job: lazyLoad('rollup.start_job', opts),
|
||||||
|
startJob: lazyLoad('rollup.start_job', opts),
|
||||||
|
stop_job: lazyLoad('rollup.stop_job', opts),
|
||||||
|
stopJob: lazyLoad('rollup.stop_job', opts)
|
||||||
|
},
|
||||||
scripts_painless_execute: lazyLoad('scripts_painless_execute', opts),
|
scripts_painless_execute: lazyLoad('scripts_painless_execute', opts),
|
||||||
scriptsPainlessExecute: lazyLoad('scripts_painless_execute', opts),
|
scriptsPainlessExecute: lazyLoad('scripts_painless_execute', opts),
|
||||||
scroll: lazyLoad('scroll', opts),
|
scroll: lazyLoad('scroll', opts),
|
||||||
@ -397,6 +436,12 @@ function ESAPI (opts) {
|
|||||||
verify_repository: lazyLoad('snapshot.verify_repository', opts),
|
verify_repository: lazyLoad('snapshot.verify_repository', opts),
|
||||||
verifyRepository: lazyLoad('snapshot.verify_repository', opts)
|
verifyRepository: lazyLoad('snapshot.verify_repository', opts)
|
||||||
},
|
},
|
||||||
|
sql: {
|
||||||
|
clear_cursor: lazyLoad('sql.clear_cursor', opts),
|
||||||
|
clearCursor: lazyLoad('sql.clear_cursor', opts),
|
||||||
|
query: lazyLoad('sql.query', opts),
|
||||||
|
translate: lazyLoad('sql.translate', opts)
|
||||||
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
certificates: lazyLoad('ssl.certificates', opts)
|
certificates: lazyLoad('ssl.certificates', opts)
|
||||||
},
|
},
|
||||||
@ -411,74 +456,28 @@ function ESAPI (opts) {
|
|||||||
updateByQuery: lazyLoad('update_by_query', opts),
|
updateByQuery: lazyLoad('update_by_query', opts),
|
||||||
update_by_query_rethrottle: lazyLoad('update_by_query_rethrottle', opts),
|
update_by_query_rethrottle: lazyLoad('update_by_query_rethrottle', opts),
|
||||||
updateByQueryRethrottle: lazyLoad('update_by_query_rethrottle', opts),
|
updateByQueryRethrottle: lazyLoad('update_by_query_rethrottle', opts),
|
||||||
|
watcher: {
|
||||||
|
ack_watch: lazyLoad('watcher.ack_watch', opts),
|
||||||
|
ackWatch: lazyLoad('watcher.ack_watch', opts),
|
||||||
|
activate_watch: lazyLoad('watcher.activate_watch', opts),
|
||||||
|
activateWatch: lazyLoad('watcher.activate_watch', opts),
|
||||||
|
deactivate_watch: lazyLoad('watcher.deactivate_watch', opts),
|
||||||
|
deactivateWatch: lazyLoad('watcher.deactivate_watch', opts),
|
||||||
|
delete_watch: lazyLoad('watcher.delete_watch', opts),
|
||||||
|
deleteWatch: lazyLoad('watcher.delete_watch', opts),
|
||||||
|
execute_watch: lazyLoad('watcher.execute_watch', opts),
|
||||||
|
executeWatch: lazyLoad('watcher.execute_watch', opts),
|
||||||
|
get_watch: lazyLoad('watcher.get_watch', opts),
|
||||||
|
getWatch: lazyLoad('watcher.get_watch', opts),
|
||||||
|
put_watch: lazyLoad('watcher.put_watch', opts),
|
||||||
|
putWatch: lazyLoad('watcher.put_watch', opts),
|
||||||
|
start: lazyLoad('watcher.start', opts),
|
||||||
|
stats: lazyLoad('watcher.stats', opts),
|
||||||
|
stop: lazyLoad('watcher.stop', opts)
|
||||||
|
},
|
||||||
xpack: {
|
xpack: {
|
||||||
graph: {
|
|
||||||
explore: lazyLoad('xpack.graph.explore', opts)
|
|
||||||
},
|
|
||||||
info: lazyLoad('xpack.info', opts),
|
info: lazyLoad('xpack.info', opts),
|
||||||
license: {
|
usage: lazyLoad('xpack.usage', opts)
|
||||||
delete: lazyLoad('xpack.license.delete', opts),
|
|
||||||
get: lazyLoad('xpack.license.get', opts),
|
|
||||||
get_basic_status: lazyLoad('xpack.license.get_basic_status', opts),
|
|
||||||
getBasicStatus: lazyLoad('xpack.license.get_basic_status', opts),
|
|
||||||
get_trial_status: lazyLoad('xpack.license.get_trial_status', opts),
|
|
||||||
getTrialStatus: lazyLoad('xpack.license.get_trial_status', opts),
|
|
||||||
post: lazyLoad('xpack.license.post', opts),
|
|
||||||
post_start_basic: lazyLoad('xpack.license.post_start_basic', opts),
|
|
||||||
postStartBasic: lazyLoad('xpack.license.post_start_basic', opts),
|
|
||||||
post_start_trial: lazyLoad('xpack.license.post_start_trial', opts),
|
|
||||||
postStartTrial: lazyLoad('xpack.license.post_start_trial', opts)
|
|
||||||
},
|
|
||||||
migration: {
|
|
||||||
deprecations: lazyLoad('xpack.migration.deprecations', opts),
|
|
||||||
get_assistance: lazyLoad('xpack.migration.get_assistance', opts),
|
|
||||||
getAssistance: lazyLoad('xpack.migration.get_assistance', opts),
|
|
||||||
upgrade: lazyLoad('xpack.migration.upgrade', opts)
|
|
||||||
},
|
|
||||||
rollup: {
|
|
||||||
delete_job: lazyLoad('xpack.rollup.delete_job', opts),
|
|
||||||
deleteJob: lazyLoad('xpack.rollup.delete_job', opts),
|
|
||||||
get_jobs: lazyLoad('xpack.rollup.get_jobs', opts),
|
|
||||||
getJobs: lazyLoad('xpack.rollup.get_jobs', opts),
|
|
||||||
get_rollup_caps: lazyLoad('xpack.rollup.get_rollup_caps', opts),
|
|
||||||
getRollupCaps: lazyLoad('xpack.rollup.get_rollup_caps', opts),
|
|
||||||
get_rollup_index_caps: lazyLoad('xpack.rollup.get_rollup_index_caps', opts),
|
|
||||||
getRollupIndexCaps: lazyLoad('xpack.rollup.get_rollup_index_caps', opts),
|
|
||||||
put_job: lazyLoad('xpack.rollup.put_job', opts),
|
|
||||||
putJob: lazyLoad('xpack.rollup.put_job', opts),
|
|
||||||
rollup_search: lazyLoad('xpack.rollup.rollup_search', opts),
|
|
||||||
rollupSearch: lazyLoad('xpack.rollup.rollup_search', opts),
|
|
||||||
start_job: lazyLoad('xpack.rollup.start_job', opts),
|
|
||||||
startJob: lazyLoad('xpack.rollup.start_job', opts),
|
|
||||||
stop_job: lazyLoad('xpack.rollup.stop_job', opts),
|
|
||||||
stopJob: lazyLoad('xpack.rollup.stop_job', opts)
|
|
||||||
},
|
|
||||||
sql: {
|
|
||||||
clear_cursor: lazyLoad('xpack.sql.clear_cursor', opts),
|
|
||||||
clearCursor: lazyLoad('xpack.sql.clear_cursor', opts),
|
|
||||||
query: lazyLoad('xpack.sql.query', opts),
|
|
||||||
translate: lazyLoad('xpack.sql.translate', opts)
|
|
||||||
},
|
|
||||||
usage: lazyLoad('xpack.usage', opts),
|
|
||||||
watcher: {
|
|
||||||
ack_watch: lazyLoad('xpack.watcher.ack_watch', opts),
|
|
||||||
ackWatch: lazyLoad('xpack.watcher.ack_watch', opts),
|
|
||||||
activate_watch: lazyLoad('xpack.watcher.activate_watch', opts),
|
|
||||||
activateWatch: lazyLoad('xpack.watcher.activate_watch', opts),
|
|
||||||
deactivate_watch: lazyLoad('xpack.watcher.deactivate_watch', opts),
|
|
||||||
deactivateWatch: lazyLoad('xpack.watcher.deactivate_watch', opts),
|
|
||||||
delete_watch: lazyLoad('xpack.watcher.delete_watch', opts),
|
|
||||||
deleteWatch: lazyLoad('xpack.watcher.delete_watch', opts),
|
|
||||||
execute_watch: lazyLoad('xpack.watcher.execute_watch', opts),
|
|
||||||
executeWatch: lazyLoad('xpack.watcher.execute_watch', opts),
|
|
||||||
get_watch: lazyLoad('xpack.watcher.get_watch', opts),
|
|
||||||
getWatch: lazyLoad('xpack.watcher.get_watch', opts),
|
|
||||||
put_watch: lazyLoad('xpack.watcher.put_watch', opts),
|
|
||||||
putWatch: lazyLoad('xpack.watcher.put_watch', opts),
|
|
||||||
start: lazyLoad('xpack.watcher.start', opts),
|
|
||||||
stats: lazyLoad('xpack.watcher.stats', opts),
|
|
||||||
stop: lazyLoad('xpack.watcher.stop', opts)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
228
api/requestParams.d.ts
vendored
228
api/requestParams.d.ts
vendored
@ -1051,6 +1051,7 @@ export interface Reindex extends Generic {
|
|||||||
wait_for_active_shards?: string;
|
wait_for_active_shards?: string;
|
||||||
wait_for_completion?: boolean;
|
wait_for_completion?: boolean;
|
||||||
requests_per_second?: number;
|
requests_per_second?: number;
|
||||||
|
scroll?: string;
|
||||||
slices?: number;
|
slices?: number;
|
||||||
body: any;
|
body: any;
|
||||||
}
|
}
|
||||||
@ -1337,7 +1338,12 @@ export interface CcrFollowInfo extends Generic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface CcrFollowStats extends Generic {
|
export interface CcrFollowStats extends Generic {
|
||||||
index?: string | string[];
|
index: string | string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CcrForgetFollower extends Generic {
|
||||||
|
index: string;
|
||||||
|
body: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CcrGetAutoFollowPattern extends Generic {
|
export interface CcrGetAutoFollowPattern extends Generic {
|
||||||
@ -1365,13 +1371,20 @@ export interface CcrUnfollow extends Generic {
|
|||||||
index: string;
|
index: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GraphExplore extends Generic {
|
||||||
|
index?: string | string[];
|
||||||
|
type?: string | string[];
|
||||||
|
routing?: string;
|
||||||
|
timeout?: string;
|
||||||
|
body?: any;
|
||||||
|
}
|
||||||
|
|
||||||
export interface IlmDeleteLifecycle extends Generic {
|
export interface IlmDeleteLifecycle extends Generic {
|
||||||
policy?: string;
|
policy?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IlmExplainLifecycle extends Generic {
|
export interface IlmExplainLifecycle extends Generic {
|
||||||
index?: string;
|
index?: string;
|
||||||
human?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IlmGetLifecycle extends Generic {
|
export interface IlmGetLifecycle extends Generic {
|
||||||
@ -1425,6 +1438,37 @@ export interface IndicesUnfreeze extends Generic {
|
|||||||
wait_for_active_shards?: string;
|
wait_for_active_shards?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface LicenseDelete extends Generic {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LicenseGet extends Generic {
|
||||||
|
local?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LicenseGetBasicStatus extends Generic {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LicenseGetTrialStatus extends Generic {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LicensePost extends Generic {
|
||||||
|
acknowledge?: boolean;
|
||||||
|
body?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LicensePostStartBasic extends Generic {
|
||||||
|
acknowledge?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LicensePostStartTrial extends Generic {
|
||||||
|
type?: string;
|
||||||
|
acknowledge?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MigrationDeprecations extends Generic {
|
||||||
|
index?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface MlCloseJob extends Generic {
|
export interface MlCloseJob extends Generic {
|
||||||
job_id: string;
|
job_id: string;
|
||||||
allow_no_jobs?: boolean;
|
allow_no_jobs?: boolean;
|
||||||
@ -1538,6 +1582,7 @@ export interface MlGetCalendars extends Generic {
|
|||||||
calendar_id?: string;
|
calendar_id?: string;
|
||||||
from?: number;
|
from?: number;
|
||||||
size?: number;
|
size?: number;
|
||||||
|
body?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MlGetCategories extends Generic {
|
export interface MlGetCategories extends Generic {
|
||||||
@ -1738,6 +1783,45 @@ export interface MonitoringBulk extends Generic {
|
|||||||
body: any;
|
body: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface RollupDeleteJob extends Generic {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RollupGetJobs extends Generic {
|
||||||
|
id?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RollupGetRollupCaps extends Generic {
|
||||||
|
id?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RollupGetRollupIndexCaps extends Generic {
|
||||||
|
index: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RollupPutJob extends Generic {
|
||||||
|
id: string;
|
||||||
|
body: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RollupRollupSearch extends Generic {
|
||||||
|
index: string | string[];
|
||||||
|
type?: string;
|
||||||
|
typed_keys?: boolean;
|
||||||
|
rest_total_hits_as_int?: boolean;
|
||||||
|
body: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RollupStartJob extends Generic {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RollupStopJob extends Generic {
|
||||||
|
id: string;
|
||||||
|
wait_for_completion?: boolean;
|
||||||
|
timeout?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface SecurityAuthenticate extends Generic {
|
export interface SecurityAuthenticate extends Generic {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1783,12 +1867,12 @@ export interface SecurityDeleteUser extends Generic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface SecurityDisableUser extends Generic {
|
export interface SecurityDisableUser extends Generic {
|
||||||
username?: string;
|
username: string;
|
||||||
refresh?: 'true' | 'false' | 'wait_for';
|
refresh?: 'true' | 'false' | 'wait_for';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SecurityEnableUser extends Generic {
|
export interface SecurityEnableUser extends Generic {
|
||||||
username?: string;
|
username: string;
|
||||||
refresh?: 'true' | 'false' | 'wait_for';
|
refresh?: 'true' | 'false' | 'wait_for';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1859,148 +1943,50 @@ export interface SecurityPutUser extends Generic {
|
|||||||
body: any;
|
body: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SslCertificates extends Generic {
|
export interface SqlClearCursor extends Generic {
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackGraphExplore extends Generic {
|
|
||||||
index?: string | string[];
|
|
||||||
type?: string | string[];
|
|
||||||
routing?: string;
|
|
||||||
timeout?: string;
|
|
||||||
body?: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackInfo extends Generic {
|
|
||||||
categories?: string | string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackLicenseDelete extends Generic {
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackLicenseGet extends Generic {
|
|
||||||
local?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackLicenseGetBasicStatus extends Generic {
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackLicenseGetTrialStatus extends Generic {
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackLicensePost extends Generic {
|
|
||||||
acknowledge?: boolean;
|
|
||||||
body?: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackLicensePostStartBasic extends Generic {
|
|
||||||
acknowledge?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackLicensePostStartTrial extends Generic {
|
|
||||||
type?: string;
|
|
||||||
acknowledge?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackMigrationDeprecations extends Generic {
|
|
||||||
index?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackMigrationGetAssistance extends Generic {
|
|
||||||
index?: string | string[];
|
|
||||||
allow_no_indices?: boolean;
|
|
||||||
expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
|
|
||||||
ignore_unavailable?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackMigrationUpgrade extends Generic {
|
|
||||||
index: string;
|
|
||||||
wait_for_completion?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackRollupDeleteJob extends Generic {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackRollupGetJobs extends Generic {
|
|
||||||
id?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackRollupGetRollupCaps extends Generic {
|
|
||||||
id?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackRollupGetRollupIndexCaps extends Generic {
|
|
||||||
index: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackRollupPutJob extends Generic {
|
|
||||||
id: string;
|
|
||||||
body: any;
|
body: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackRollupRollupSearch extends Generic {
|
export interface SqlQuery extends Generic {
|
||||||
index: string;
|
|
||||||
type?: string;
|
|
||||||
typed_keys?: boolean;
|
|
||||||
rest_total_hits_as_int?: boolean;
|
|
||||||
body: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackRollupStartJob extends Generic {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackRollupStopJob extends Generic {
|
|
||||||
id: string;
|
|
||||||
wait_for_completion?: boolean;
|
|
||||||
timeout?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackSqlClearCursor extends Generic {
|
|
||||||
body: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface XpackSqlQuery extends Generic {
|
|
||||||
format?: string;
|
format?: string;
|
||||||
body: any;
|
body: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackSqlTranslate extends Generic {
|
export interface SqlTranslate extends Generic {
|
||||||
body: any;
|
body: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackUsage extends Generic {
|
export interface SslCertificates extends Generic {
|
||||||
master_timeout?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherAckWatch extends Generic {
|
export interface WatcherAckWatch extends Generic {
|
||||||
watch_id: string;
|
watch_id: string;
|
||||||
action_id?: string | string[];
|
action_id?: string | string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherActivateWatch extends Generic {
|
export interface WatcherActivateWatch extends Generic {
|
||||||
watch_id: string;
|
watch_id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherDeactivateWatch extends Generic {
|
export interface WatcherDeactivateWatch extends Generic {
|
||||||
watch_id: string;
|
watch_id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherDeleteWatch extends Generic {
|
export interface WatcherDeleteWatch extends Generic {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherExecuteWatch extends Generic {
|
export interface WatcherExecuteWatch extends Generic {
|
||||||
id?: string;
|
id?: string;
|
||||||
debug?: boolean;
|
debug?: boolean;
|
||||||
body?: any;
|
body?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherGetWatch extends Generic {
|
export interface WatcherGetWatch extends Generic {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherPutWatch extends Generic {
|
export interface WatcherPutWatch extends Generic {
|
||||||
id: string;
|
id: string;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
version?: number;
|
version?: number;
|
||||||
@ -2009,13 +1995,21 @@ export interface XpackWatcherPutWatch extends Generic {
|
|||||||
body?: any;
|
body?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherStart extends Generic {
|
export interface WatcherStart extends Generic {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherStats extends Generic {
|
export interface WatcherStats extends Generic {
|
||||||
metric?: '_all' | 'queued_watches' | 'current_watches' | 'pending_watches';
|
metric?: string | string[];
|
||||||
emit_stacktraces?: boolean;
|
emit_stacktraces?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface XpackWatcherStop extends Generic {
|
export interface WatcherStop extends Generic {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface XpackInfo extends Generic {
|
||||||
|
categories?: string | string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface XpackUsage extends Generic {
|
||||||
|
master_timeout?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
= Authentication
|
[[auth-reference]]
|
||||||
|
== Authentication
|
||||||
|
|
||||||
This document contains code snippets to show you how to connect to various Elasticsearch providers.
|
This document contains code snippets to show you how to connect to various Elasticsearch providers.
|
||||||
|
|
||||||
== Basic Auth
|
=== Basic Auth
|
||||||
|
|
||||||
You can provide your credentials in the node(s) URL.
|
You can provide your credentials in the node(s) URL.
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ const client = new Client({
|
|||||||
})
|
})
|
||||||
----
|
----
|
||||||
|
|
||||||
== SSL configuration
|
=== SSL configuration
|
||||||
|
|
||||||
Without any additional configuration you can specify `https://` node urls, but the certificates used to sign these requests will not verified (`rejectUnauthorized: false`). To turn on certificate verification you must specify an `ssl` object either in the top level config or in each host config object and set `rejectUnauthorized: true`. The ssl config object can contain many of the same configuration options that https://nodejs.org/api/tls.html#tls_tls_connect_options_callback[tls.connect()] accepts.
|
Without any additional configuration you can specify `https://` node urls, but the certificates used to sign these requests will not verified (`rejectUnauthorized: false`). To turn on certificate verification you must specify an `ssl` object either in the top level config or in each host config object and set `rejectUnauthorized: true`. The ssl config object can contain many of the same configuration options that https://nodejs.org/api/tls.html#tls_tls_connect_options_callback[tls.connect()] accepts.
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ const client = new Client({
|
|||||||
})
|
})
|
||||||
----
|
----
|
||||||
|
|
||||||
== Elastic Cloud
|
=== Elastic Cloud
|
||||||
|
|
||||||
If you are using https://www.elastic.co/cloud[Elastic Cloud], the client offers a easy way to connect to it via the `cloud` option. +
|
If you are using https://www.elastic.co/cloud[Elastic Cloud], the client offers a easy way to connect to it via the `cloud` option. +
|
||||||
You must pass the Cloud ID that you can find in the cloud console, then your username and password.
|
You must pass the Cloud ID that you can find in the cloud console, then your username and password.
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Breaking changes coming from the old client
|
[[breaking-changes]]
|
||||||
|
== Breaking changes coming from the old client
|
||||||
|
|
||||||
If you were already using the previous version of this client --i.e. the one you used to install with `npm install elasticsearch`-- you will encounter some breaking changes.
|
If you were already using the previous version of this client --i.e. the one you used to install with `npm install elasticsearch`-- you will encounter some breaking changes.
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Creating a child client
|
[[child-client]]
|
||||||
|
== Creating a child client
|
||||||
|
|
||||||
There are some use cases where you may need multiple instances of the client. You can easily do that by calling `new Client()` as many times as you need, but you will lose all the benefits of using one single client, such as the long living connections and the connection pool handling. +
|
There are some use cases where you may need multiple instances of the client. You can easily do that by calling `new Client()` as many times as you need, but you will lose all the benefits of using one single client, such as the long living connections and the connection pool handling. +
|
||||||
To avoid this problem the client offers a `child` API, which returns a new client instance that shares the connection pool with the parent client. +
|
To avoid this problem the client offers a `child` API, which returns a new client instance that shares the connection pool with the parent client. +
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Client configuration
|
[[client-configuration]]
|
||||||
|
== Client configuration
|
||||||
|
|
||||||
The client is designed to be easily configured as you see fit for your needs, following you can see all the possible basic options that you can use to configure it.
|
The client is designed to be easily configured as you see fit for your needs, following you can see all the possible basic options that you can use to configure it.
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ const client = new Client({
|
|||||||
})
|
})
|
||||||
----
|
----
|
||||||
|
|
||||||
== Basic options
|
=== Basic options
|
||||||
[cols=2*]
|
[cols=2*]
|
||||||
|===
|
|===
|
||||||
|`node` or `nodes`
|
|`node` or `nodes`
|
||||||
@ -72,7 +73,7 @@ _Default:_ `false`
|
|||||||
|
|
||||||
|`resurrectStrategy`
|
|`resurrectStrategy`
|
||||||
|`string` - Configure the node resurrection strategy. +
|
|`string` - Configure the node resurrection strategy. +
|
||||||
_Options:_ `'ping'`, `'optimistic'`, `'none'` +
|
_Options:_ `'ping'`, `'optimistic'`, `'none'` +
|
||||||
_Default:_ `'ping'`
|
_Default:_ `'ping'`
|
||||||
|
|
||||||
|`suggestCompression`
|
|`suggestCompression`
|
||||||
@ -122,7 +123,7 @@ function nodeSelector (connections) {
|
|||||||
----
|
----
|
||||||
|===
|
|===
|
||||||
|
|
||||||
== Advanced configuration
|
=== Advanced configuration
|
||||||
If you need to customize the client behavior heavily, you are in the right place! +
|
If you need to customize the client behavior heavily, you are in the right place! +
|
||||||
The client allows you to customize the following internals:
|
The client allows you to customize the following internals:
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
[[as_stream_examples]]
|
||||||
== asStream
|
== asStream
|
||||||
|
|
||||||
Instead of getting the parsed body back, you will get the raw Node.js stream of data.
|
Instead of getting the parsed body back, you will get the raw Node.js stream of data.
|
||||||
@ -10,7 +11,7 @@ const { Client } = require('@elastic/elasticsearch')
|
|||||||
const client = new Client({ node: 'http://localhost:9200' })
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
|
|
||||||
async function run () {
|
async function run () {
|
||||||
await client.bulk({
|
const { body: bulkResponse } = await client.bulk({
|
||||||
refresh: true,
|
refresh: true,
|
||||||
body: [
|
body: [
|
||||||
// operation to perform
|
// operation to perform
|
||||||
@ -35,6 +36,11 @@ async function run () {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (bulkResponse.errors) {
|
||||||
|
console.log(bulkResponse)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
// Let's search!
|
// Let's search!
|
||||||
const { body } = await client.search({
|
const { body } = await client.search({
|
||||||
index: 'game-of-thrones',
|
index: 'game-of-thrones',
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Bulk
|
[[bulk_examples]]
|
||||||
|
== Bulk
|
||||||
|
|
||||||
The `bulk` API makes it possible to perform many index/delete operations in a single API call. +
|
The `bulk` API makes it possible to perform many index/delete operations in a single API call. +
|
||||||
This can greatly increase the indexing speed.
|
This can greatly increase the indexing speed.
|
||||||
@ -11,7 +12,7 @@ const { Client } = require('@elastic/elasticsearch')
|
|||||||
const client = new Client({ node: 'http://localhost:9200' })
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
|
|
||||||
async function run () {
|
async function run () {
|
||||||
await client.bulk({
|
const { body: bulkResponse } = await client.bulk({
|
||||||
// here we are forcing an index refresh,
|
// here we are forcing an index refresh,
|
||||||
// otherwise we will not get any result
|
// otherwise we will not get any result
|
||||||
// in the consequent search
|
// in the consequent search
|
||||||
@ -39,6 +40,11 @@ async function run () {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (bulkResponse.errors) {
|
||||||
|
console.log(bulkResponse)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
// Let's search!
|
// Let's search!
|
||||||
const { body } = await client.search({
|
const { body } = await client.search({
|
||||||
index: 'game-of-thrones',
|
index: 'game-of-thrones',
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Exists
|
[[exists_examples]]
|
||||||
|
== Exists
|
||||||
|
|
||||||
Check that the document `/game-of-thrones/1` exists.
|
Check that the document `/game-of-thrones/1` exists.
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Get
|
[[get_examples]]
|
||||||
|
== Get
|
||||||
|
|
||||||
The get API allows to get a typed JSON document from the index based on its id. +
|
The get API allows to get a typed JSON document from the index based on its id. +
|
||||||
The following example gets a JSON document from an index called `game-of-thrones`, under a type called `_doc`, with id valued `'1'`.
|
The following example gets a JSON document from an index called `game-of-thrones`, under a type called `_doc`, with id valued `'1'`.
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
[[ignore_examples]]
|
||||||
== Ignore
|
== Ignore
|
||||||
HTTP status codes which should not be considered errors for this request.
|
HTTP status codes which should not be considered errors for this request.
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ const { Client } = require('@elastic/elasticsearch')
|
|||||||
const client = new Client({ node: 'http://localhost:9200' })
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
|
|
||||||
async function run () {
|
async function run () {
|
||||||
await client.bulk({
|
const { body: bulkResponse } = await client.bulk({
|
||||||
refresh: true,
|
refresh: true,
|
||||||
body: [
|
body: [
|
||||||
// operation to perform
|
// operation to perform
|
||||||
@ -34,6 +35,11 @@ async function run () {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (bulkResponse.errors) {
|
||||||
|
console.log(bulkResponse)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
// Let's search!
|
// Let's search!
|
||||||
const { body } = await client.search({
|
const { body } = await client.search({
|
||||||
index: 'game-of-thrones',
|
index: 'game-of-thrones',
|
||||||
|
|||||||
28
docs/examples/index.asciidoc
Normal file
28
docs/examples/index.asciidoc
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
[[examples]]
|
||||||
|
= Examples
|
||||||
|
|
||||||
|
Following you can find some examples on how to use the client.
|
||||||
|
|
||||||
|
* Use of the <<as_stream_examples,asStream>> parameter;
|
||||||
|
* Executing a <<bulk_examples,bulk>> request;
|
||||||
|
* Executing a <<exists_examples,exists>> request;
|
||||||
|
* Executing a <<get_examples,get>> request;
|
||||||
|
* Use of the <<ignore_examples,ignore>> parameter;
|
||||||
|
* Executing a <<msearch_examples,msearch>> request;
|
||||||
|
* How do I <<scroll_examples,scroll>>?
|
||||||
|
* Executing a <<search_examples,search>> request;
|
||||||
|
* I need <<suggest_examples,suggestions>>;
|
||||||
|
* How to use the <<transport_request_examples,transport.request>> method;
|
||||||
|
* How to use <<typescript_examples,TypeScript>>;
|
||||||
|
|
||||||
|
include::asStream.asciidoc[]
|
||||||
|
include::bulk.asciidoc[]
|
||||||
|
include::exists.asciidoc[]
|
||||||
|
include::get.asciidoc[]
|
||||||
|
include::ignore.asciidoc[]
|
||||||
|
include::msearch.asciidoc[]
|
||||||
|
include::scroll.asciidoc[]
|
||||||
|
include::search.asciidoc[]
|
||||||
|
include::suggest.asciidoc[]
|
||||||
|
include::transport.request.asciidoc[]
|
||||||
|
include::typescript.asciidoc[]
|
||||||
@ -1,4 +1,5 @@
|
|||||||
= MSearch
|
[[msearch_examples]]
|
||||||
|
== MSearch
|
||||||
|
|
||||||
The multi search API allows to execute several search requests within the same API.
|
The multi search API allows to execute several search requests within the same API.
|
||||||
|
|
||||||
@ -10,7 +11,7 @@ const { Client } = require('@elastic/elasticsearch')
|
|||||||
const client = new Client({ node: 'http://localhost:9200' })
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
|
|
||||||
async function run () {
|
async function run () {
|
||||||
await client.bulk({
|
const { body: bulkResponse } = await client.bulk({
|
||||||
refresh: true,
|
refresh: true,
|
||||||
body: [
|
body: [
|
||||||
{ index: { _index: 'game-of-thrones' } },
|
{ index: { _index: 'game-of-thrones' } },
|
||||||
@ -33,6 +34,11 @@ async function run () {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (bulkResponse.errors) {
|
||||||
|
console.log(bulkResponse)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
const { body } = await client.msearch({
|
const { body } = await client.msearch({
|
||||||
body: [
|
body: [
|
||||||
{ index: 'game-of-thrones' },
|
{ index: 'game-of-thrones' },
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Scroll
|
[[scroll_examples]]
|
||||||
|
== Scroll
|
||||||
|
|
||||||
While a search request returns a single “page” of results, the scroll API can be used to retrieve large numbers of results (or even all results) from a single search request, in much the same way as you would use a cursor on a traditional database.
|
While a search request returns a single “page” of results, the scroll API can be used to retrieve large numbers of results (or even all results) from a single search request, in much the same way as you would use a cursor on a traditional database.
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ async function run () {
|
|||||||
const responseQueue = []
|
const responseQueue = []
|
||||||
|
|
||||||
// Let's index some data!
|
// Let's index some data!
|
||||||
await client.bulk({
|
const { body: bulkResponse } = await client.bulk({
|
||||||
// here we are forcing an index refresh,
|
// here we are forcing an index refresh,
|
||||||
// otherwise we will not get any result
|
// otherwise we will not get any result
|
||||||
// in the consequent search
|
// in the consequent search
|
||||||
@ -48,6 +49,11 @@ async function run () {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (bulkResponse.errors) {
|
||||||
|
console.log(bulkResponse)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
// start things off by searching, setting a scroll timeout, and pushing
|
// start things off by searching, setting a scroll timeout, and pushing
|
||||||
// our first response into the queue to be processed
|
// our first response into the queue to be processed
|
||||||
const response = await client.search({
|
const response = await client.search({
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Search
|
[[search_examples]]
|
||||||
|
== Search
|
||||||
|
|
||||||
The `search` API allows you to execute a search query and get back search hits that match the query. +
|
The `search` API allows you to execute a search query and get back search hits that match the query. +
|
||||||
The query can either be provided using a simple https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-uri-request.html[query string as a parameter], or using a https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-body.html[request body].
|
The query can either be provided using a simple https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-uri-request.html[query string as a parameter], or using a https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-body.html[request body].
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Suggest
|
[[suggest_examples]]
|
||||||
|
== Suggest
|
||||||
|
|
||||||
The suggest feature suggests similar looking terms based on a provided text by using a suggester. _Parts of the suggest feature are still under development._
|
The suggest feature suggests similar looking terms based on a provided text by using a suggester. _Parts of the suggest feature are still under development._
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ const { Client } = require('@elastic/elasticsearch')
|
|||||||
const client = new Client({ node: 'http://localhost:9200' })
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
|
|
||||||
async function run () {
|
async function run () {
|
||||||
await client.bulk({
|
const { body: bulkResponse } = await client.bulk({
|
||||||
refresh: true,
|
refresh: true,
|
||||||
body: [
|
body: [
|
||||||
{ index: { _index: 'game-of-thrones' } },
|
{ index: { _index: 'game-of-thrones' } },
|
||||||
@ -36,6 +37,11 @@ async function run () {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (bulkResponse.errors) {
|
||||||
|
console.log(bulkResponse)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
const { body } = await client.search({
|
const { body } = await client.search({
|
||||||
index: 'game-of-thrones',
|
index: 'game-of-thrones',
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= transport.request
|
[[transport_request_examples]]
|
||||||
|
== transport.request
|
||||||
|
|
||||||
It can happen that you need to communicate with Elasticsearch by using an API that is not supported by the client, to mitigate this issue you can directly call `client.transport.request`, which is the internal utility that the client uses to communicate with Elasticsearch when you use an API method.
|
It can happen that you need to communicate with Elasticsearch by using an API that is not supported by the client, to mitigate this issue you can directly call `client.transport.request`, which is the internal utility that the client uses to communicate with Elasticsearch when you use an API method.
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ const { Client } = require('@elastic/elasticsearch')
|
|||||||
const client = new Client({ node: 'http://localhost:9200' })
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
|
|
||||||
async function run () {
|
async function run () {
|
||||||
await client.bulk({
|
const { body: bulkResponse } = await client.bulk({
|
||||||
refresh: true,
|
refresh: true,
|
||||||
body: [
|
body: [
|
||||||
{ index: { _index: 'game-of-thrones' } },
|
{ index: { _index: 'game-of-thrones' } },
|
||||||
@ -38,6 +39,11 @@ async function run () {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (bulkResponse.errors) {
|
||||||
|
console.log(bulkResponse)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
const { body } = await client.transport.request({
|
const { body } = await client.transport.request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/game-of-thrones/_search',
|
path: '/game-of-thrones/_search',
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Typescript
|
[[typescript_examples]]
|
||||||
|
== Typescript
|
||||||
|
|
||||||
The client offers a first-class support for TypeScript, since it ships the type definitions for every exposed API.
|
The client offers a first-class support for TypeScript, since it ships the type definitions for every exposed API.
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Extend the client
|
[[extend-client]]
|
||||||
|
== Extend the client
|
||||||
|
|
||||||
Sometimes you need to reuse the same logic, or you want to build a custom API to allow you simplify your code. +
|
Sometimes you need to reuse the same logic, or you want to build a custom API to allow you simplify your code. +
|
||||||
The easiest way to achieve that is by extending the client.
|
The easiest way to achieve that is by extending the client.
|
||||||
|
|||||||
@ -1,51 +1,15 @@
|
|||||||
= @elastic/elasticsearch
|
= @elastic/elasticsearch
|
||||||
|
|
||||||
The official Node.js client for Elasticsearch.
|
:branch: 7.x
|
||||||
|
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
|
||||||
|
|
||||||
== Features
|
include::introduction.asciidoc[]
|
||||||
* One-to-one mapping with REST API.
|
include::usage.asciidoc[]
|
||||||
* Generalized, pluggable architecture.
|
include::configuration.asciidoc[]
|
||||||
* Configurable, automatic discovery of cluster nodes.
|
include::reference.asciidoc[]
|
||||||
* Persistent, Keep-Alive connections.
|
include::breaking-changes.asciidoc[]
|
||||||
* Load balancing (with pluggable selection strategy) across all available nodes.
|
include::authentication.asciidoc[]
|
||||||
* TypeScript support out of the box.
|
include::child.asciidoc[]
|
||||||
|
include::extend.asciidoc[]
|
||||||
== Install
|
include::typescript.asciidoc[]
|
||||||
[source,sh]
|
include::examples/index.asciidoc[]
|
||||||
----
|
|
||||||
npm install @elastic/elasticsearch
|
|
||||||
----
|
|
||||||
By default the latest version of the module will be installed, which is the same version of the current release of Elasticsearch. +
|
|
||||||
If you need to work with older versions of Elasticsearch, you should install the same version of the client as well. +
|
|
||||||
For example, if you are using Elasticsearch `v6.5.4`, you will need the client `v6`, and you can easily do that with `npm install @elastic/elasticsearch@6`.
|
|
||||||
|
|
||||||
== Usage
|
|
||||||
[source,js]
|
|
||||||
----
|
|
||||||
const { Client } = require('@elastic/elasticsearch')
|
|
||||||
const client = new Client({ node: 'http://localhost:9200' })
|
|
||||||
|
|
||||||
// promise API
|
|
||||||
const result = await client.search({
|
|
||||||
index: 'my-index',
|
|
||||||
body: { foo: 'bar' }
|
|
||||||
})
|
|
||||||
|
|
||||||
// callback API
|
|
||||||
client.search({
|
|
||||||
index: 'my-index',
|
|
||||||
body: { foo: 'bar' }
|
|
||||||
}, (err, result) => {
|
|
||||||
if (err) console.log(err)
|
|
||||||
})
|
|
||||||
----
|
|
||||||
|
|
||||||
== Reference
|
|
||||||
* Client configuration
|
|
||||||
* Client usage
|
|
||||||
* API methods
|
|
||||||
* TypeScript support
|
|
||||||
* Extend the client
|
|
||||||
* Breaking changes from old client
|
|
||||||
* Authentication
|
|
||||||
* Child client
|
|
||||||
|
|||||||
53
docs/introduction.asciidoc
Normal file
53
docs/introduction.asciidoc
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
[[introduction]]
|
||||||
|
== Introduction
|
||||||
|
|
||||||
|
The official Node.js client for Elasticsearch.
|
||||||
|
|
||||||
|
=== Features
|
||||||
|
* One-to-one mapping with REST API.
|
||||||
|
* Generalized, pluggable architecture.
|
||||||
|
* Configurable, automatic discovery of cluster nodes.
|
||||||
|
* Persistent, Keep-Alive connections.
|
||||||
|
* Load balancing (with pluggable selection strategy) across all available nodes.
|
||||||
|
* TypeScript support out of the box.
|
||||||
|
|
||||||
|
=== Install
|
||||||
|
[source,sh]
|
||||||
|
----
|
||||||
|
npm install @elastic/elasticsearch
|
||||||
|
----
|
||||||
|
|
||||||
|
=== Compatibility
|
||||||
|
|
||||||
|
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.
|
||||||
|
----
|
||||||
|
# Elasticsearch 7.x
|
||||||
|
@elastic/elasticsearch@7
|
||||||
|
|
||||||
|
# Elasticsearch 6.x
|
||||||
|
@elastic/elasticsearch@6
|
||||||
|
|
||||||
|
# Elasticsearch 5.x
|
||||||
|
@elastic/elasticsearch@5
|
||||||
|
----
|
||||||
|
|
||||||
|
=== Usage
|
||||||
|
[source,js]
|
||||||
|
----
|
||||||
|
const { Client } = require('@elastic/elasticsearch')
|
||||||
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
|
|
||||||
|
// promise API
|
||||||
|
const result = await client.search({
|
||||||
|
index: 'my-index',
|
||||||
|
body: { foo: 'bar' }
|
||||||
|
})
|
||||||
|
|
||||||
|
// callback API
|
||||||
|
client.search({
|
||||||
|
index: 'my-index',
|
||||||
|
body: { foo: 'bar' }
|
||||||
|
}, (err, result) => {
|
||||||
|
if (err) console.log(err)
|
||||||
|
})
|
||||||
|
----
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
|||||||
= TypeScript support
|
[[typescript]]
|
||||||
|
== TypeScript support
|
||||||
|
|
||||||
The client offers a first-class support for TypeScript, since it ships the type definitions for every exposed API.
|
The client offers a first-class support for TypeScript, since it ships the type definitions for every exposed API.
|
||||||
|
|
||||||
@ -6,7 +7,7 @@ While the client offers type definitions for Request parameters, Request bodies
|
|||||||
|
|
||||||
NOTE: If you are using TypeScript you will be required to use _snake_case_ style to define the API parameters instead of _camelCase_.
|
NOTE: If you are using TypeScript you will be required to use _snake_case_ style to define the API parameters instead of _camelCase_.
|
||||||
|
|
||||||
== How to extend the provided typings?
|
=== How to extend the provided typings?
|
||||||
Extend the provided typings is very straightforward, you should declare a custom `.d.ts` file and then write inside your type extensions, following there is an example of how do it.
|
Extend the provided typings is very straightforward, you should declare a custom `.d.ts` file and then write inside your type extensions, following there is an example of how do it.
|
||||||
[source,ts]
|
[source,ts]
|
||||||
----
|
----
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
= Usage
|
[[client-usage]]
|
||||||
|
== Usage
|
||||||
|
|
||||||
Use the client is pretty straightforward, it supports all the public APIs of Elasticsearch, and every method exposes the same signature.
|
Use the client is pretty straightforward, it supports all the public APIs of Elasticsearch, and every method exposes the same signature.
|
||||||
|
|
||||||
|
|||||||
129
index.d.ts
vendored
129
index.d.ts
vendored
@ -134,6 +134,8 @@ declare class Client extends EventEmitter {
|
|||||||
followInfo: ApiMethod<RequestParams.CcrFollowInfo>
|
followInfo: ApiMethod<RequestParams.CcrFollowInfo>
|
||||||
follow_stats: ApiMethod<RequestParams.CcrFollowStats>
|
follow_stats: ApiMethod<RequestParams.CcrFollowStats>
|
||||||
followStats: ApiMethod<RequestParams.CcrFollowStats>
|
followStats: ApiMethod<RequestParams.CcrFollowStats>
|
||||||
|
forget_follower: ApiMethod<RequestParams.CcrForgetFollower>
|
||||||
|
forgetFollower: ApiMethod<RequestParams.CcrForgetFollower>
|
||||||
get_auto_follow_pattern: ApiMethod<RequestParams.CcrGetAutoFollowPattern>
|
get_auto_follow_pattern: ApiMethod<RequestParams.CcrGetAutoFollowPattern>
|
||||||
getAutoFollowPattern: ApiMethod<RequestParams.CcrGetAutoFollowPattern>
|
getAutoFollowPattern: ApiMethod<RequestParams.CcrGetAutoFollowPattern>
|
||||||
pause_follow: ApiMethod<RequestParams.CcrPauseFollow>
|
pause_follow: ApiMethod<RequestParams.CcrPauseFollow>
|
||||||
@ -183,6 +185,9 @@ declare class Client extends EventEmitter {
|
|||||||
getScript: ApiMethod<RequestParams.GetScript>
|
getScript: ApiMethod<RequestParams.GetScript>
|
||||||
get_source: ApiMethod<RequestParams.GetSource>
|
get_source: ApiMethod<RequestParams.GetSource>
|
||||||
getSource: ApiMethod<RequestParams.GetSource>
|
getSource: ApiMethod<RequestParams.GetSource>
|
||||||
|
graph: {
|
||||||
|
explore: ApiMethod<RequestParams.GraphExplore>
|
||||||
|
}
|
||||||
ilm: {
|
ilm: {
|
||||||
delete_lifecycle: ApiMethod<RequestParams.IlmDeleteLifecycle>
|
delete_lifecycle: ApiMethod<RequestParams.IlmDeleteLifecycle>
|
||||||
deleteLifecycle: ApiMethod<RequestParams.IlmDeleteLifecycle>
|
deleteLifecycle: ApiMethod<RequestParams.IlmDeleteLifecycle>
|
||||||
@ -276,7 +281,23 @@ declare class Client extends EventEmitter {
|
|||||||
putPipeline: ApiMethod<RequestParams.IngestPutPipeline>
|
putPipeline: ApiMethod<RequestParams.IngestPutPipeline>
|
||||||
simulate: ApiMethod<RequestParams.IngestSimulate>
|
simulate: ApiMethod<RequestParams.IngestSimulate>
|
||||||
}
|
}
|
||||||
|
license: {
|
||||||
|
delete: ApiMethod<RequestParams.LicenseDelete>
|
||||||
|
get: ApiMethod<RequestParams.LicenseGet>
|
||||||
|
get_basic_status: ApiMethod<RequestParams.LicenseGetBasicStatus>
|
||||||
|
getBasicStatus: ApiMethod<RequestParams.LicenseGetBasicStatus>
|
||||||
|
get_trial_status: ApiMethod<RequestParams.LicenseGetTrialStatus>
|
||||||
|
getTrialStatus: ApiMethod<RequestParams.LicenseGetTrialStatus>
|
||||||
|
post: ApiMethod<RequestParams.LicensePost>
|
||||||
|
post_start_basic: ApiMethod<RequestParams.LicensePostStartBasic>
|
||||||
|
postStartBasic: ApiMethod<RequestParams.LicensePostStartBasic>
|
||||||
|
post_start_trial: ApiMethod<RequestParams.LicensePostStartTrial>
|
||||||
|
postStartTrial: ApiMethod<RequestParams.LicensePostStartTrial>
|
||||||
|
}
|
||||||
mget: ApiMethod<RequestParams.Mget>
|
mget: ApiMethod<RequestParams.Mget>
|
||||||
|
migration: {
|
||||||
|
deprecations: ApiMethod<RequestParams.MigrationDeprecations>
|
||||||
|
}
|
||||||
ml: {
|
ml: {
|
||||||
close_job: ApiMethod<RequestParams.MlCloseJob>
|
close_job: ApiMethod<RequestParams.MlCloseJob>
|
||||||
closeJob: ApiMethod<RequestParams.MlCloseJob>
|
closeJob: ApiMethod<RequestParams.MlCloseJob>
|
||||||
@ -394,6 +415,24 @@ declare class Client extends EventEmitter {
|
|||||||
reindexRethrottle: ApiMethod<RequestParams.ReindexRethrottle>
|
reindexRethrottle: ApiMethod<RequestParams.ReindexRethrottle>
|
||||||
render_search_template: ApiMethod<RequestParams.RenderSearchTemplate>
|
render_search_template: ApiMethod<RequestParams.RenderSearchTemplate>
|
||||||
renderSearchTemplate: ApiMethod<RequestParams.RenderSearchTemplate>
|
renderSearchTemplate: ApiMethod<RequestParams.RenderSearchTemplate>
|
||||||
|
rollup: {
|
||||||
|
delete_job: ApiMethod<RequestParams.RollupDeleteJob>
|
||||||
|
deleteJob: ApiMethod<RequestParams.RollupDeleteJob>
|
||||||
|
get_jobs: ApiMethod<RequestParams.RollupGetJobs>
|
||||||
|
getJobs: ApiMethod<RequestParams.RollupGetJobs>
|
||||||
|
get_rollup_caps: ApiMethod<RequestParams.RollupGetRollupCaps>
|
||||||
|
getRollupCaps: ApiMethod<RequestParams.RollupGetRollupCaps>
|
||||||
|
get_rollup_index_caps: ApiMethod<RequestParams.RollupGetRollupIndexCaps>
|
||||||
|
getRollupIndexCaps: ApiMethod<RequestParams.RollupGetRollupIndexCaps>
|
||||||
|
put_job: ApiMethod<RequestParams.RollupPutJob>
|
||||||
|
putJob: ApiMethod<RequestParams.RollupPutJob>
|
||||||
|
rollup_search: ApiMethod<RequestParams.RollupRollupSearch>
|
||||||
|
rollupSearch: ApiMethod<RequestParams.RollupRollupSearch>
|
||||||
|
start_job: ApiMethod<RequestParams.RollupStartJob>
|
||||||
|
startJob: ApiMethod<RequestParams.RollupStartJob>
|
||||||
|
stop_job: ApiMethod<RequestParams.RollupStopJob>
|
||||||
|
stopJob: ApiMethod<RequestParams.RollupStopJob>
|
||||||
|
}
|
||||||
scripts_painless_execute: ApiMethod<RequestParams.ScriptsPainlessExecute>
|
scripts_painless_execute: ApiMethod<RequestParams.ScriptsPainlessExecute>
|
||||||
scriptsPainlessExecute: ApiMethod<RequestParams.ScriptsPainlessExecute>
|
scriptsPainlessExecute: ApiMethod<RequestParams.ScriptsPainlessExecute>
|
||||||
scroll: ApiMethod<RequestParams.Scroll>
|
scroll: ApiMethod<RequestParams.Scroll>
|
||||||
@ -468,6 +507,12 @@ declare class Client extends EventEmitter {
|
|||||||
verify_repository: ApiMethod<RequestParams.SnapshotVerifyRepository>
|
verify_repository: ApiMethod<RequestParams.SnapshotVerifyRepository>
|
||||||
verifyRepository: ApiMethod<RequestParams.SnapshotVerifyRepository>
|
verifyRepository: ApiMethod<RequestParams.SnapshotVerifyRepository>
|
||||||
}
|
}
|
||||||
|
sql: {
|
||||||
|
clear_cursor: ApiMethod<RequestParams.SqlClearCursor>
|
||||||
|
clearCursor: ApiMethod<RequestParams.SqlClearCursor>
|
||||||
|
query: ApiMethod<RequestParams.SqlQuery>
|
||||||
|
translate: ApiMethod<RequestParams.SqlTranslate>
|
||||||
|
}
|
||||||
ssl: {
|
ssl: {
|
||||||
certificates: ApiMethod<RequestParams.SslCertificates>
|
certificates: ApiMethod<RequestParams.SslCertificates>
|
||||||
}
|
}
|
||||||
@ -482,74 +527,28 @@ declare class Client extends EventEmitter {
|
|||||||
updateByQuery: ApiMethod<RequestParams.UpdateByQuery>
|
updateByQuery: ApiMethod<RequestParams.UpdateByQuery>
|
||||||
update_by_query_rethrottle: ApiMethod<RequestParams.UpdateByQueryRethrottle>
|
update_by_query_rethrottle: ApiMethod<RequestParams.UpdateByQueryRethrottle>
|
||||||
updateByQueryRethrottle: ApiMethod<RequestParams.UpdateByQueryRethrottle>
|
updateByQueryRethrottle: ApiMethod<RequestParams.UpdateByQueryRethrottle>
|
||||||
|
watcher: {
|
||||||
|
ack_watch: ApiMethod<RequestParams.WatcherAckWatch>
|
||||||
|
ackWatch: ApiMethod<RequestParams.WatcherAckWatch>
|
||||||
|
activate_watch: ApiMethod<RequestParams.WatcherActivateWatch>
|
||||||
|
activateWatch: ApiMethod<RequestParams.WatcherActivateWatch>
|
||||||
|
deactivate_watch: ApiMethod<RequestParams.WatcherDeactivateWatch>
|
||||||
|
deactivateWatch: ApiMethod<RequestParams.WatcherDeactivateWatch>
|
||||||
|
delete_watch: ApiMethod<RequestParams.WatcherDeleteWatch>
|
||||||
|
deleteWatch: ApiMethod<RequestParams.WatcherDeleteWatch>
|
||||||
|
execute_watch: ApiMethod<RequestParams.WatcherExecuteWatch>
|
||||||
|
executeWatch: ApiMethod<RequestParams.WatcherExecuteWatch>
|
||||||
|
get_watch: ApiMethod<RequestParams.WatcherGetWatch>
|
||||||
|
getWatch: ApiMethod<RequestParams.WatcherGetWatch>
|
||||||
|
put_watch: ApiMethod<RequestParams.WatcherPutWatch>
|
||||||
|
putWatch: ApiMethod<RequestParams.WatcherPutWatch>
|
||||||
|
start: ApiMethod<RequestParams.WatcherStart>
|
||||||
|
stats: ApiMethod<RequestParams.WatcherStats>
|
||||||
|
stop: ApiMethod<RequestParams.WatcherStop>
|
||||||
|
}
|
||||||
xpack: {
|
xpack: {
|
||||||
graph: {
|
|
||||||
explore: ApiMethod<RequestParams.XpackGraphExplore>
|
|
||||||
}
|
|
||||||
info: ApiMethod<RequestParams.XpackInfo>
|
info: ApiMethod<RequestParams.XpackInfo>
|
||||||
license: {
|
|
||||||
delete: ApiMethod<RequestParams.XpackLicenseDelete>
|
|
||||||
get: ApiMethod<RequestParams.XpackLicenseGet>
|
|
||||||
get_basic_status: ApiMethod<RequestParams.XpackLicenseGetBasicStatus>
|
|
||||||
getBasicStatus: ApiMethod<RequestParams.XpackLicenseGetBasicStatus>
|
|
||||||
get_trial_status: ApiMethod<RequestParams.XpackLicenseGetTrialStatus>
|
|
||||||
getTrialStatus: ApiMethod<RequestParams.XpackLicenseGetTrialStatus>
|
|
||||||
post: ApiMethod<RequestParams.XpackLicensePost>
|
|
||||||
post_start_basic: ApiMethod<RequestParams.XpackLicensePostStartBasic>
|
|
||||||
postStartBasic: ApiMethod<RequestParams.XpackLicensePostStartBasic>
|
|
||||||
post_start_trial: ApiMethod<RequestParams.XpackLicensePostStartTrial>
|
|
||||||
postStartTrial: ApiMethod<RequestParams.XpackLicensePostStartTrial>
|
|
||||||
}
|
|
||||||
migration: {
|
|
||||||
deprecations: ApiMethod<RequestParams.XpackMigrationDeprecations>
|
|
||||||
get_assistance: ApiMethod<RequestParams.XpackMigrationGetAssistance>
|
|
||||||
getAssistance: ApiMethod<RequestParams.XpackMigrationGetAssistance>
|
|
||||||
upgrade: ApiMethod<RequestParams.XpackMigrationUpgrade>
|
|
||||||
}
|
|
||||||
rollup: {
|
|
||||||
delete_job: ApiMethod<RequestParams.XpackRollupDeleteJob>
|
|
||||||
deleteJob: ApiMethod<RequestParams.XpackRollupDeleteJob>
|
|
||||||
get_jobs: ApiMethod<RequestParams.XpackRollupGetJobs>
|
|
||||||
getJobs: ApiMethod<RequestParams.XpackRollupGetJobs>
|
|
||||||
get_rollup_caps: ApiMethod<RequestParams.XpackRollupGetRollupCaps>
|
|
||||||
getRollupCaps: ApiMethod<RequestParams.XpackRollupGetRollupCaps>
|
|
||||||
get_rollup_index_caps: ApiMethod<RequestParams.XpackRollupGetRollupIndexCaps>
|
|
||||||
getRollupIndexCaps: ApiMethod<RequestParams.XpackRollupGetRollupIndexCaps>
|
|
||||||
put_job: ApiMethod<RequestParams.XpackRollupPutJob>
|
|
||||||
putJob: ApiMethod<RequestParams.XpackRollupPutJob>
|
|
||||||
rollup_search: ApiMethod<RequestParams.XpackRollupRollupSearch>
|
|
||||||
rollupSearch: ApiMethod<RequestParams.XpackRollupRollupSearch>
|
|
||||||
start_job: ApiMethod<RequestParams.XpackRollupStartJob>
|
|
||||||
startJob: ApiMethod<RequestParams.XpackRollupStartJob>
|
|
||||||
stop_job: ApiMethod<RequestParams.XpackRollupStopJob>
|
|
||||||
stopJob: ApiMethod<RequestParams.XpackRollupStopJob>
|
|
||||||
}
|
|
||||||
sql: {
|
|
||||||
clear_cursor: ApiMethod<RequestParams.XpackSqlClearCursor>
|
|
||||||
clearCursor: ApiMethod<RequestParams.XpackSqlClearCursor>
|
|
||||||
query: ApiMethod<RequestParams.XpackSqlQuery>
|
|
||||||
translate: ApiMethod<RequestParams.XpackSqlTranslate>
|
|
||||||
}
|
|
||||||
usage: ApiMethod<RequestParams.XpackUsage>
|
usage: ApiMethod<RequestParams.XpackUsage>
|
||||||
watcher: {
|
|
||||||
ack_watch: ApiMethod<RequestParams.XpackWatcherAckWatch>
|
|
||||||
ackWatch: ApiMethod<RequestParams.XpackWatcherAckWatch>
|
|
||||||
activate_watch: ApiMethod<RequestParams.XpackWatcherActivateWatch>
|
|
||||||
activateWatch: ApiMethod<RequestParams.XpackWatcherActivateWatch>
|
|
||||||
deactivate_watch: ApiMethod<RequestParams.XpackWatcherDeactivateWatch>
|
|
||||||
deactivateWatch: ApiMethod<RequestParams.XpackWatcherDeactivateWatch>
|
|
||||||
delete_watch: ApiMethod<RequestParams.XpackWatcherDeleteWatch>
|
|
||||||
deleteWatch: ApiMethod<RequestParams.XpackWatcherDeleteWatch>
|
|
||||||
execute_watch: ApiMethod<RequestParams.XpackWatcherExecuteWatch>
|
|
||||||
executeWatch: ApiMethod<RequestParams.XpackWatcherExecuteWatch>
|
|
||||||
get_watch: ApiMethod<RequestParams.XpackWatcherGetWatch>
|
|
||||||
getWatch: ApiMethod<RequestParams.XpackWatcherGetWatch>
|
|
||||||
put_watch: ApiMethod<RequestParams.XpackWatcherPutWatch>
|
|
||||||
putWatch: ApiMethod<RequestParams.XpackWatcherPutWatch>
|
|
||||||
start: ApiMethod<RequestParams.XpackWatcherStart>
|
|
||||||
stats: ApiMethod<RequestParams.XpackWatcherStats>
|
|
||||||
stop: ApiMethod<RequestParams.XpackWatcherStop>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
|
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
|
||||||
"version": "0.1.0-beta.2",
|
"version": "7.0.0-rc.1",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"elasticsearch",
|
"elasticsearch",
|
||||||
"elastic",
|
"elastic",
|
||||||
@ -21,7 +21,6 @@
|
|||||||
"test:behavior": "tap test/behavior/*.test.js -J -t 300",
|
"test:behavior": "tap test/behavior/*.test.js -J -t 300",
|
||||||
"test:integration": "tap test/integration/index.js -T --harmony --no-esm",
|
"test:integration": "tap test/integration/index.js -T --harmony --no-esm",
|
||||||
"test:types": "tsc --project ./test/types/tsconfig.json",
|
"test:types": "tsc --project ./test/types/tsconfig.json",
|
||||||
"test:benchmarks": "nanobench test/benchmarks/*.bench.js",
|
|
||||||
"test:coverage": "nyc npm run test:unit && nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
"test:coverage": "nyc npm run test:unit && nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
||||||
"lint": "standard",
|
"lint": "standard",
|
||||||
"lint:fix": "standard --fix",
|
"lint:fix": "standard --fix",
|
||||||
|
|||||||
@ -28,5 +28,5 @@ exec docker run \
|
|||||||
-v "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \
|
-v "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \
|
||||||
-v "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \
|
-v "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \
|
||||||
-p 9200:9200 \
|
-p 9200:9200 \
|
||||||
docker.elastic.co/elasticsearch/elasticsearch:7.0.0-beta1
|
docker.elastic.co/elasticsearch/elasticsearch:7.0.0-rc1
|
||||||
# docker.elastic.co/elasticsearch/elasticsearch:6.6.0
|
# docker.elastic.co/elasticsearch/elasticsearch:6.6.0
|
||||||
|
|||||||
@ -9,5 +9,5 @@ exec docker run \
|
|||||||
-p 9200:9200 \
|
-p 9200:9200 \
|
||||||
--network=elastic \
|
--network=elastic \
|
||||||
--name=elasticsearch \
|
--name=elasticsearch \
|
||||||
docker.elastic.co/elasticsearch/elasticsearch:7.0.0-beta1
|
docker.elastic.co/elasticsearch/elasticsearch:7.0.0-rc1
|
||||||
# docker.elastic.co/elasticsearch/elasticsearch:6.6.0
|
# docker.elastic.co/elasticsearch/elasticsearch:6.6.0
|
||||||
|
|||||||
@ -22,7 +22,16 @@
|
|||||||
const dedent = require('dedent')
|
const dedent = require('dedent')
|
||||||
|
|
||||||
function generateDocs (common, spec) {
|
function generateDocs (common, spec) {
|
||||||
var doc = '= API Reference\n\n'
|
var doc = dedent`
|
||||||
|
[[api-reference]]
|
||||||
|
== API Reference
|
||||||
|
|
||||||
|
////////
|
||||||
|
|
||||||
|
This documentation is generated by running:
|
||||||
|
node scripts/run.js --tag v7.0.0-beta
|
||||||
|
|
||||||
|
////////\n\n`
|
||||||
doc += commonParameters(common)
|
doc += commonParameters(common)
|
||||||
spec.forEach(s => {
|
spec.forEach(s => {
|
||||||
doc += '\n' + generateApiDoc(s)
|
doc += '\n' + generateApiDoc(s)
|
||||||
@ -34,7 +43,8 @@ function commonParameters (spec) {
|
|||||||
var doc = dedent`
|
var doc = dedent`
|
||||||
=== Common parameters
|
=== Common parameters
|
||||||
Parameters that are accepted by all API endpoints.
|
Parameters that are accepted by all API endpoints.
|
||||||
https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html
|
|
||||||
|
link:{ref}/common-options.html[Reference]
|
||||||
[cols=2*]
|
[cols=2*]
|
||||||
|===\n`
|
|===\n`
|
||||||
Object.keys(spec.params).forEach(key => {
|
Object.keys(spec.params).forEach(key => {
|
||||||
@ -60,7 +70,7 @@ function commonParameters (spec) {
|
|||||||
|
|
||||||
function generateApiDoc (spec) {
|
function generateApiDoc (spec) {
|
||||||
const name = Object.keys(spec)[0]
|
const name = Object.keys(spec)[0]
|
||||||
const documentationUrl = spec[name].documentation
|
const documentationUrl = fixLink(name, spec[name].documentation)
|
||||||
const params = []
|
const params = []
|
||||||
// url params
|
// url params
|
||||||
const urlParts = spec[name].url.parts
|
const urlParts = spec[name].url.parts
|
||||||
@ -104,31 +114,69 @@ function generateApiDoc (spec) {
|
|||||||
[source,js]
|
[source,js]
|
||||||
----
|
----
|
||||||
client.${camelify(name)}([params] [, options] [, callback])
|
client.${camelify(name)}([params] [, options] [, callback])
|
||||||
----
|
----\n`
|
||||||
${documentationUrl || ''}
|
if (documentationUrl) {
|
||||||
[cols=2*]
|
doc += `link:${documentationUrl}[Reference]\n`
|
||||||
|===`
|
}
|
||||||
|
|
||||||
doc += '\n' + params.reduce((acc, val) => {
|
if (params.length !== 0) {
|
||||||
const name = isSnakeCased(val.name) && val.name !== camelify(val.name)
|
doc += dedent`[cols=2*]
|
||||||
? '`' + val.name + '` or `' + camelify(val.name) + '`'
|
|===\n`
|
||||||
: '`' + val.name + '`'
|
doc += params.reduce((acc, val) => {
|
||||||
acc += dedent`
|
const name = isSnakeCased(val.name) && val.name !== camelify(val.name)
|
||||||
|${name}
|
? '`' + val.name + '` or `' + camelify(val.name) + '`'
|
||||||
|${'`' + val.type + '`'} - ${val.description}`
|
: '`' + val.name + '`'
|
||||||
if (val.default) {
|
acc += dedent`
|
||||||
acc += ` +
|
|${name}
|
||||||
_Default:_ ${'`' + val.default + '`'}`
|
|${'`' + val.type + '`'} - ${val.description}`
|
||||||
}
|
if (val.default) {
|
||||||
return acc + '\n\n'
|
acc += ` +\n_Default:_ ${'`' + val.default + '`'}`
|
||||||
}, '')
|
}
|
||||||
|
return acc + '\n\n'
|
||||||
|
}, '')
|
||||||
|
|
||||||
doc += dedent`
|
doc += dedent`
|
||||||
|===
|
|===
|
||||||
`
|
`
|
||||||
|
}
|
||||||
|
doc += '\n'
|
||||||
return doc
|
return doc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const LINK_OVERRIDES = {
|
||||||
|
'license.delete': '{ref}/delete-license.html',
|
||||||
|
'license.get': '{ref}/get-license.html',
|
||||||
|
'license.get_basic_status': '{ref}/get-basic-status.html',
|
||||||
|
'license.get_trial_status': '{ref}/get-trial-status.html',
|
||||||
|
'license.post': '{ref}/update-license.html',
|
||||||
|
'license.post_start_basic': '{ref}/start-basic.html',
|
||||||
|
'license.post_start_trial': '{ref}/start-trial.html',
|
||||||
|
'migration.deprecations': '{ref}/migration-api-deprecation.html',
|
||||||
|
'monitoring.bulk': '{ref}/es-monitoring.html',
|
||||||
|
'ingest.delete_pipeline': '{ref}/delete-pipeline-api.html',
|
||||||
|
'ingest.get_pipeline': '{ref}/get-pipeline-api.html',
|
||||||
|
'ingest.put_pipeline': '{ref}/put-pipeline-api.html',
|
||||||
|
'ingest.simulate': '{ref}/simulate-pipeline-api.html',
|
||||||
|
'ingest.processor_grok': '{ref}/grok-processor.html#grok-processor-rest-get'
|
||||||
|
}
|
||||||
|
// Fixes bad urls in the JSON spec
|
||||||
|
function fixLink (name, str) {
|
||||||
|
/* In 6.x some API start with `xpack.` when in master they do not. We
|
||||||
|
* can safely ignore that for link generation. */
|
||||||
|
name = name.replace(/^xpack\./, '')
|
||||||
|
const override = LINK_OVERRIDES[name]
|
||||||
|
if (override) return override
|
||||||
|
if (!str) return ''
|
||||||
|
/* Replace references to the guide with the attribute {ref} because
|
||||||
|
* the json files in the Elasticsearch repo are a bit of a mess. */
|
||||||
|
str = str.replace(/^.+guide\/en\/elasticsearch\/reference\/[^/]+\/([^./]*\.html(?:#.+)?)$/, '{ref}/$1')
|
||||||
|
str = str.replace(/frozen\.html/, 'freeze-index-api.html')
|
||||||
|
str = str.replace(/ml-file-structure\.html/, 'ml-find-file-structure.html')
|
||||||
|
str = str.replace(/security-api-get-user-privileges\.html/, 'security-api-get-privileges.html')
|
||||||
|
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
|
||||||
function getType (type, options) {
|
function getType (type, options) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'list':
|
case 'list':
|
||||||
|
|||||||
@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const generate = require('./generate')
|
const generate = require('./generateApis')
|
||||||
const generateRequestTypes = require('./generateRequestTypes')
|
const generateRequestTypes = require('./generateRequestTypes')
|
||||||
const cloneAndCheckout = require('./clone-es')
|
const cloneAndCheckout = require('./clone-es')
|
||||||
const genFactory = require('./genMain')
|
const genFactory = require('./generateMain')
|
||||||
const generateDocs = require('./generateDocs')
|
const generateDocs = require('./generateDocs')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@ -43,28 +43,33 @@ const customSkips = [
|
|||||||
]
|
]
|
||||||
const platinumBlackList = {
|
const platinumBlackList = {
|
||||||
// file path: test name
|
// file path: test name
|
||||||
'cat.aliases/10_basic.yml': 'Empty cluster',
|
'cat.aliases/10_basic.yml': ['Empty cluster'],
|
||||||
'index/10_with_id.yml': 'Index with ID',
|
'index/10_with_id.yml': ['Index with ID'],
|
||||||
'indices.get_alias/10_basic.yml': 'Get alias against closed indices',
|
'indices.get_alias/10_basic.yml': ['Get alias against closed indices'],
|
||||||
'indices.get_alias/20_empty.yml': 'Check empty aliases when getting all aliases via /_alias',
|
'indices.get_alias/20_empty.yml': ['Check empty aliases when getting all aliases via /_alias'],
|
||||||
// https://github.com/elastic/elasticsearch/pull/39400
|
// https://github.com/elastic/elasticsearch/pull/39400
|
||||||
'ml/jobs_crud.yml': 'Test put job with id that is already taken',
|
'ml/jobs_crud.yml': ['Test put job with id that is already taken'],
|
||||||
// TODO: investigate why this is failing
|
// it gets random failures on CI, must investigate
|
||||||
'monitoring/bulk/10_basic.yml': '*',
|
'ml/set_upgrade_mode.yml': [
|
||||||
'monitoring/bulk/20_privileges.yml': '*',
|
'Attempt to open job when upgrade_mode is enabled',
|
||||||
'license/20_put_license.yml': '*',
|
'Setting upgrade mode to disabled from enabled'
|
||||||
'snapshot/10_basic.yml': '*',
|
],
|
||||||
|
// investigate why this is failing
|
||||||
|
'monitoring/bulk/10_basic.yml': ['*'],
|
||||||
|
'monitoring/bulk/20_privileges.yml': ['*'],
|
||||||
|
'license/20_put_license.yml': ['*'],
|
||||||
|
'snapshot/10_basic.yml': ['*'],
|
||||||
// the body is correct, but the regex is failing
|
// the body is correct, but the regex is failing
|
||||||
'sql/sql.yml': 'Getting textual representation',
|
'sql/sql.yml': ['Getting textual representation'],
|
||||||
// we are setting two certificates in the docker config
|
// we are setting two certificates in the docker config
|
||||||
'ssl/10_basic.yml': '*',
|
'ssl/10_basic.yml': ['*'],
|
||||||
// docker issue?
|
// docker issue?
|
||||||
'watcher/execute_watch/60_http_input.yml': '*',
|
'watcher/execute_watch/60_http_input.yml': ['*'],
|
||||||
// the checks are correct, but for some reason the test is failing on js side
|
// the checks are correct, but for some reason the test is failing on js side
|
||||||
// I bet is because the backslashes in the rg
|
// I bet is because the backslashes in the rg
|
||||||
'watcher/execute_watch/70_invalid.yml': '*',
|
'watcher/execute_watch/70_invalid.yml': ['*'],
|
||||||
'watcher/put_watch/10_basic.yml': '*',
|
'watcher/put_watch/10_basic.yml': ['*'],
|
||||||
'xpack/15_basic.yml': '*'
|
'xpack/15_basic.yml': ['*']
|
||||||
}
|
}
|
||||||
|
|
||||||
function Runner (opts) {
|
function Runner (opts) {
|
||||||
@ -93,7 +98,7 @@ Runner.prototype.waitCluster = function (callback, times = 0) {
|
|||||||
this.client.cluster.health(
|
this.client.cluster.health(
|
||||||
{ waitForStatus: 'green', timeout: '50s' },
|
{ waitForStatus: 'green', timeout: '50s' },
|
||||||
(err, res) => {
|
(err, res) => {
|
||||||
if (++times < 10) {
|
if (err && ++times < 10) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.waitCluster(callback, times)
|
this.waitCluster(callback, times)
|
||||||
}, 5000)
|
}, 5000)
|
||||||
@ -184,10 +189,13 @@ Runner.prototype.start = function (opts) {
|
|||||||
if (opts.isPlatinum) {
|
if (opts.isPlatinum) {
|
||||||
const list = Object.keys(platinumBlackList)
|
const list = Object.keys(platinumBlackList)
|
||||||
for (i = 0; i < list.length; i++) {
|
for (i = 0; i < list.length; i++) {
|
||||||
if (file.endsWith(list[i]) && (name === platinumBlackList[list[i]] || platinumBlackList[list[i]] === '*')) {
|
const platTest = platinumBlackList[list[i]]
|
||||||
const testName = file.slice(file.indexOf(`${sep}elasticsearch${sep}`)) + ' / ' + name
|
for (var j = 0; j < platTest.length; j++) {
|
||||||
tap.skip(`Skipping test ${testName} because is blacklisted in the platinum test`)
|
if (file.endsWith(list[i]) && (name === platTest[j] || platTest[j] === '*')) {
|
||||||
return
|
const testName = file.slice(file.indexOf(`${sep}elasticsearch${sep}`)) + ' / ' + name
|
||||||
|
tap.skip(`Skipping test ${testName} because is blacklisted in the platinum test`)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -182,15 +182,15 @@ TestRunner.prototype.cleanupPlatinum = function (q, done) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
q.add((q, done) => {
|
q.add((q, done) => {
|
||||||
this.client.xpack.rollup.getJobs({ id: '_all' }, (err, { body }) => {
|
this.client.rollup.getJobs({ id: '_all' }, (err, { body }) => {
|
||||||
this.tap.error(err, 'should not error: rollup.getJobs')
|
this.tap.error(err, 'should not error: rollup.getJobs')
|
||||||
const jobs = body.jobs.map(j => j.config.id)
|
const jobs = body.jobs.map(j => j.config.id)
|
||||||
helper.runInParallel(
|
helper.runInParallel(
|
||||||
this.client, 'xpack.rollup.stopJob',
|
this.client, 'rollup.stopJob',
|
||||||
jobs.map(j => ({ id: j, waitForCompletion: true }))
|
jobs.map(j => ({ id: j, waitForCompletion: true }))
|
||||||
)
|
)
|
||||||
.then(() => helper.runInParallel(
|
.then(() => helper.runInParallel(
|
||||||
this.client, 'xpack.rollup.deleteJob',
|
this.client, 'rollup.deleteJob',
|
||||||
jobs.map(j => ({ id: j }))
|
jobs.map(j => ({ id: j }))
|
||||||
))
|
))
|
||||||
.then(() => done())
|
.then(() => done())
|
||||||
|
|||||||
Reference in New Issue
Block a user