diff --git a/api/api/ccr.delete_auto_follow_pattern.js b/api/api/ccr.delete_auto_follow_pattern.js new file mode 100644 index 000000000..e1fc80d4c --- /dev/null +++ b/api/api/ccr.delete_auto_follow_pattern.js @@ -0,0 +1,90 @@ +'use strict' + +function buildCcrDeleteAutoFollowPattern (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [ccr.delete_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html) request + * + * @param {string} name - The name of the auto follow pattern. + */ + return function ccrDeleteAutoFollowPattern (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrDeleteAutoFollowPattern(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['name'] == null) { + return callback( + new ConfigurationError('Missing required parameter: name'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'DELETE' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_ccr', 'auto_follow', params['name']] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: params.body || '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildCcrDeleteAutoFollowPattern diff --git a/api/api/ccr.follow.js b/api/api/ccr.follow.js new file mode 100644 index 000000000..2c02acde8 --- /dev/null +++ b/api/api/ccr.follow.js @@ -0,0 +1,97 @@ +'use strict' + +function buildCcrFollow (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [ccr.follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html) request + * + * @param {string} index - The name of the follower index + * @param {object} body - The name of the leader index and other optional ccr related parameters + */ + return function ccrFollow (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrFollow(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['index'] == null) { + return callback( + new ConfigurationError('Missing required parameter: index'), + result + ) + } + if (params['body'] == null) { + return callback( + new ConfigurationError('Missing required parameter: body'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'PUT' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = [params['index'], '_ccr', 'follow'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: params.body || '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildCcrFollow diff --git a/api/api/ccr.follow_stats.js b/api/api/ccr.follow_stats.js new file mode 100644 index 000000000..b762fd549 --- /dev/null +++ b/api/api/ccr.follow_stats.js @@ -0,0 +1,82 @@ +'use strict' + +function buildCcrFollowStats (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [ccr.follow_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html) request + * + * @param {list} index - A comma-separated list of index patterns; use `_all` to perform the operation on all indices + */ + return function ccrFollowStats (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrFollowStats(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'GET' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = [params['index'], '_ccr', 'stats'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: null, + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildCcrFollowStats diff --git a/api/api/ccr.get_auto_follow_pattern.js b/api/api/ccr.get_auto_follow_pattern.js new file mode 100644 index 000000000..010e3cf40 --- /dev/null +++ b/api/api/ccr.get_auto_follow_pattern.js @@ -0,0 +1,82 @@ +'use strict' + +function buildCcrGetAutoFollowPattern (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [ccr.get_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html) request + * + * @param {string} name - The name of the auto follow pattern. + */ + return function ccrGetAutoFollowPattern (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrGetAutoFollowPattern(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'GET' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_ccr', 'auto_follow', params['name']] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: null, + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildCcrGetAutoFollowPattern diff --git a/api/api/ccr.pause_follow.js b/api/api/ccr.pause_follow.js new file mode 100644 index 000000000..fbf050432 --- /dev/null +++ b/api/api/ccr.pause_follow.js @@ -0,0 +1,90 @@ +'use strict' + +function buildCcrPauseFollow (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [ccr.pause_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html) request + * + * @param {string} index - The name of the follower index that should pause following its leader index. + */ + return function ccrPauseFollow (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrPauseFollow(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['index'] == null) { + return callback( + new ConfigurationError('Missing required parameter: index'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'POST' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = [params['index'], '_ccr', 'pause_follow'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: params.body || '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildCcrPauseFollow diff --git a/api/api/ccr.put_auto_follow_pattern.js b/api/api/ccr.put_auto_follow_pattern.js new file mode 100644 index 000000000..55b12438a --- /dev/null +++ b/api/api/ccr.put_auto_follow_pattern.js @@ -0,0 +1,97 @@ +'use strict' + +function buildCcrPutAutoFollowPattern (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [ccr.put_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html) request + * + * @param {string} name - The name of the auto follow pattern. + * @param {object} body - The specification of the auto follow pattern + */ + return function ccrPutAutoFollowPattern (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrPutAutoFollowPattern(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['name'] == null) { + return callback( + new ConfigurationError('Missing required parameter: name'), + result + ) + } + if (params['body'] == null) { + return callback( + new ConfigurationError('Missing required parameter: body'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'PUT' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_ccr', 'auto_follow', params['name']] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: params.body || '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildCcrPutAutoFollowPattern diff --git a/api/api/ccr.resume_follow.js b/api/api/ccr.resume_follow.js new file mode 100644 index 000000000..942fc5ae9 --- /dev/null +++ b/api/api/ccr.resume_follow.js @@ -0,0 +1,97 @@ +'use strict' + +function buildCcrResumeFollow (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [ccr.resume_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html) request + * + * @param {string} index - The name of the follow index to resume following. + * @param {object} body - The name of the leader index and other optional ccr related parameters + */ + return function ccrResumeFollow (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrResumeFollow(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['index'] == null) { + return callback( + new ConfigurationError('Missing required parameter: index'), + result + ) + } + if (params['body'] == null) { + return callback( + new ConfigurationError('Missing required parameter: body'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'POST' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = [params['index'], '_ccr', 'resume_follow'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: params.body || '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildCcrResumeFollow diff --git a/api/api/ccr.stats.js b/api/api/ccr.stats.js new file mode 100644 index 000000000..6b20d6dd1 --- /dev/null +++ b/api/api/ccr.stats.js @@ -0,0 +1,81 @@ +'use strict' + +function buildCcrStats (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [ccr.stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html) request + * + */ + return function ccrStats (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrStats(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'GET' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_ccr', 'stats'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: null, + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildCcrStats diff --git a/api/api/ccr.unfollow.js b/api/api/ccr.unfollow.js new file mode 100644 index 000000000..d12c23946 --- /dev/null +++ b/api/api/ccr.unfollow.js @@ -0,0 +1,90 @@ +'use strict' + +function buildCcrUnfollow (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [ccr.unfollow](http://www.elastic.co/guide/en/elasticsearch/reference/current) request + * + * @param {string} index - The name of the follower index that should be turned into a regular index. + */ + return function ccrUnfollow (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + ccrUnfollow(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['index'] == null) { + return callback( + new ConfigurationError('Missing required parameter: index'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'POST' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = [params['index'], '_ccr', 'unfollow'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: params.body || '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildCcrUnfollow diff --git a/api/api/delete_by_query_rethrottle.js b/api/api/delete_by_query_rethrottle.js new file mode 100644 index 000000000..c54f37ede --- /dev/null +++ b/api/api/delete_by_query_rethrottle.js @@ -0,0 +1,113 @@ +'use strict' + +function buildDeleteByQueryRethrottle (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [delete_by_query_rethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html) request + * + * @param {string} task_id - The task id to rethrottle + * @param {number} requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + */ + return function deleteByQueryRethrottle (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + deleteByQueryRethrottle(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['task_id'] == null && params['taskId'] == null) { + return callback( + new ConfigurationError('Missing required parameter: task_id or taskId'), + result + ) + } + if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) { + return callback( + new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond'), + result + ) + } + if (params.body != null) { + return callback( + new ConfigurationError('This API does not require a body'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + 'requests_per_second', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ] + const acceptedQuerystringCamelCased = [ + 'requestsPerSecond', + 'pretty', + 'human', + 'errorTrace', + 'source', + 'filterPath' + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'POST' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_delete_by_query', params['task_id'] || params['taskId'], '_rethrottle'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildDeleteByQueryRethrottle diff --git a/api/api/msearch.js b/api/api/msearch.js index 5fe5de3b6..d201b9d3b 100644 --- a/api/api/msearch.js +++ b/api/api/msearch.js @@ -12,6 +12,7 @@ function buildMsearch (opts) { * @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute * @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response * @param {number} pre_filter_shard_size - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * @param {number} max_concurrent_shard_requests - The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests * @param {object} body - The request definitions (metadata-search request definition pairs), separated by newlines */ return function msearch (params, callback) { @@ -52,6 +53,7 @@ function buildMsearch (opts) { 'max_concurrent_searches', 'typed_keys', 'pre_filter_shard_size', + 'max_concurrent_shard_requests', 'pretty', 'human', 'error_trace', @@ -63,6 +65,7 @@ function buildMsearch (opts) { 'maxConcurrentSearches', 'typedKeys', 'preFilterShardSize', + 'maxConcurrentShardRequests', 'pretty', 'human', 'errorTrace', diff --git a/api/api/nodes.reload_secure_settings.js b/api/api/nodes.reload_secure_settings.js new file mode 100644 index 000000000..37c682b31 --- /dev/null +++ b/api/api/nodes.reload_secure_settings.js @@ -0,0 +1,101 @@ +'use strict' + +function buildNodesReloadSecureSettings (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [nodes.reload_secure_settings](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/secure-settings.html#reloadable-secure-settings) request + * + * @param {list} node_id - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. + * @param {time} timeout - Explicit operation timeout + */ + return function nodesReloadSecureSettings (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + nodesReloadSecureSettings(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params.body != null) { + return callback( + new ConfigurationError('This API does not require a body'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ] + const acceptedQuerystringCamelCased = [ + 'timeout', + 'pretty', + 'human', + 'errorTrace', + 'source', + 'filterPath' + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'POST' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_nodes', params['node_id'] || params['nodeId'], 'reload_secure_settings'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildNodesReloadSecureSettings diff --git a/api/api/reindex_rethrottle.js b/api/api/reindex_rethrottle.js index 8093467b9..ce6bf9b27 100644 --- a/api/api/reindex_rethrottle.js +++ b/api/api/reindex_rethrottle.js @@ -95,12 +95,10 @@ function buildReindexRethrottle (opts) { } // build request object - const parts = ['_delete_by_query', params['task_id'] || params['taskId'], '_rethrottle'] + const parts = ['_reindex', params['task_id'] || params['taskId'], '_rethrottle'] const request = { method, - path: (params['task_id'] || params['taskId']) != null - ? '/' + parts.filter(Boolean).map(encodeURIComponent).join('/') - : '/_reindex/{task_id}/_rethrottle', + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), querystring, body: '', headers: params.headers || null, diff --git a/api/api/update_by_query_rethrottle.js b/api/api/update_by_query_rethrottle.js new file mode 100644 index 000000000..b2c5acff2 --- /dev/null +++ b/api/api/update_by_query_rethrottle.js @@ -0,0 +1,113 @@ +'use strict' + +function buildUpdateByQueryRethrottle (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [update_by_query_rethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html) request + * + * @param {string} task_id - The task id to rethrottle + * @param {number} requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + */ + return function updateByQueryRethrottle (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + updateByQueryRethrottle(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['task_id'] == null && params['taskId'] == null) { + return callback( + new ConfigurationError('Missing required parameter: task_id or taskId'), + result + ) + } + if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) { + return callback( + new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond'), + result + ) + } + if (params.body != null) { + return callback( + new ConfigurationError('This API does not require a body'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + 'requests_per_second', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ] + const acceptedQuerystringCamelCased = [ + 'requestsPerSecond', + 'pretty', + 'human', + 'errorTrace', + 'source', + 'filterPath' + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'POST' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_update_by_query', params['task_id'] || params['taskId'], '_rethrottle'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildUpdateByQueryRethrottle diff --git a/api/api/xpack.ml.delete_forecast.js b/api/api/xpack.ml.delete_forecast.js new file mode 100644 index 000000000..7ebba4f81 --- /dev/null +++ b/api/api/xpack.ml.delete_forecast.js @@ -0,0 +1,109 @@ +'use strict' + +function buildXpackMlDeleteForecast (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [xpack.ml.delete_forecast](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html) request + * + * @param {string} job_id - The ID of the job from which to delete forecasts + * @param {string} forecast_id - The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` + * @param {boolean} allow_no_forecasts - Whether to ignore if `_all` matches no forecasts + * @param {time} timeout - Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds + */ + return function xpackMlDeleteForecast (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackMlDeleteForecast(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['job_id'] == null && params['jobId'] == null) { + return callback( + new ConfigurationError('Missing required parameter: job_id or jobId'), + result + ) + } + if (params.body != null) { + return callback( + new ConfigurationError('This API does not require a body'), + result + ) + } + + // check required url components + if ((params['forecast_id'] != null || params['forecastId'] != null) && ((params['job_id'] == null || params['jobId']))) { + return callback( + new ConfigurationError('Missing required parameter of the url: job_id'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + 'allow_no_forecasts', + 'timeout' + ] + const acceptedQuerystringCamelCased = [ + 'allowNoForecasts', + 'timeout' + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'DELETE' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_xpack', 'ml', 'anomaly_detectors', params['job_id'] || params['jobId'], '_forecast', params['forecast_id'] || params['forecastId']] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildXpackMlDeleteForecast diff --git a/api/api/xpack.ml.delete_job.js b/api/api/xpack.ml.delete_job.js index 09fec33d3..b6bb053d7 100644 --- a/api/api/xpack.ml.delete_job.js +++ b/api/api/xpack.ml.delete_job.js @@ -8,6 +8,7 @@ function buildXpackMlDeleteJob (opts) { * * @param {string} job_id - The ID of the job to delete * @param {boolean} force - True if the job should be forcefully deleted + * @param {boolean} wait_for_completion - Should this request wait until the operation has completed before returning */ return function xpackMlDeleteJob (params, callback) { if (typeof params === 'function' || params == null) { @@ -41,10 +42,12 @@ function buildXpackMlDeleteJob (opts) { const querystring = {} const keys = Object.keys(params) const acceptedQuerystring = [ - 'force' + 'force', + 'wait_for_completion' ] const acceptedQuerystringCamelCased = [ - 'force' + 'force', + 'waitForCompletion' ] for (var i = 0, len = keys.length; i < len; i++) { diff --git a/api/api/xpack.ml.find_file_structure.js b/api/api/xpack.ml.find_file_structure.js new file mode 100644 index 000000000..3e3cdb580 --- /dev/null +++ b/api/api/xpack.ml.find_file_structure.js @@ -0,0 +1,127 @@ +'use strict' + +function buildXpackMlFindFileStructure (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [xpack.ml.find_file_structure](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html) request + * + * @param {int} lines_to_sample - How many lines of the file should be included in the analysis + * @param {time} timeout - Timeout after which the analysis will be aborted + * @param {string} charset - Optional parameter to specify the character set of the file + * @param {enum} format - Optional parameter to specify the high level file format + * @param {boolean} has_header_row - Optional parameter to specify whether a delimited file includes the column names in its first row + * @param {list} column_names - Optional parameter containing a comma separated list of the column names for a delimited file + * @param {string} delimiter - Optional parameter to specify the delimiter character for a delimited file - must be a single character + * @param {string} quote - Optional parameter to specify the quote character for a delimited file - must be a single character + * @param {boolean} should_trim_fields - Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them + * @param {string} grok_pattern - Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file + * @param {string} timestamp_field - Optional parameter to specify the timestamp field in the file + * @param {string} timestamp_format - Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format + * @param {boolean} explain - Whether to include a commentary on how the structure was derived + * @param {object} body - The contents of the file to be analyzed + */ + return function xpackMlFindFileStructure (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackMlFindFileStructure(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params['body'] == null) { + return callback( + new ConfigurationError('Missing required parameter: body'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + 'lines_to_sample', + 'timeout', + 'charset', + 'format', + 'has_header_row', + 'column_names', + 'delimiter', + 'quote', + 'should_trim_fields', + 'grok_pattern', + 'timestamp_field', + 'timestamp_format', + 'explain' + ] + const acceptedQuerystringCamelCased = [ + 'linesToSample', + 'timeout', + 'charset', + 'format', + 'hasHeaderRow', + 'columnNames', + 'delimiter', + 'quote', + 'shouldTrimFields', + 'grokPattern', + 'timestampField', + 'timestampFormat', + 'explain' + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'POST' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_xpack', 'ml', 'find_file_structure'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: params.body || '', + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildXpackMlFindFileStructure diff --git a/api/api/xpack.security.delete_role_mapping.js b/api/api/xpack.security.delete_role_mapping.js index 00a8f0164..8747d94ca 100644 --- a/api/api/xpack.security.delete_role_mapping.js +++ b/api/api/xpack.security.delete_role_mapping.js @@ -4,7 +4,7 @@ function buildXpackSecurityDeleteRoleMapping (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.delete_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-role-mapping.html#security-api-delete-role-mapping) request + * Perform a [xpack.security.delete_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html) request * * @param {string} name - Role-mapping name * @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. diff --git a/api/api/xpack.security.delete_user.js b/api/api/xpack.security.delete_user.js index d84670d64..3bed165bc 100644 --- a/api/api/xpack.security.delete_user.js +++ b/api/api/xpack.security.delete_user.js @@ -4,7 +4,7 @@ function buildXpackSecurityDeleteUser (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.delete_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html#security-api-delete-user) request + * Perform a [xpack.security.delete_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html) request * * @param {string} username - username * @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. diff --git a/api/api/xpack.security.disable_user.js b/api/api/xpack.security.disable_user.js index 3c382d912..30d154981 100644 --- a/api/api/xpack.security.disable_user.js +++ b/api/api/xpack.security.disable_user.js @@ -4,7 +4,7 @@ function buildXpackSecurityDisableUser (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.disable_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html#security-api-disable-user) request + * Perform a [xpack.security.disable_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html) request * * @param {string} username - The username of the user to disable * @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. diff --git a/api/api/xpack.security.enable_user.js b/api/api/xpack.security.enable_user.js index ed4518937..4df443a29 100644 --- a/api/api/xpack.security.enable_user.js +++ b/api/api/xpack.security.enable_user.js @@ -4,7 +4,7 @@ function buildXpackSecurityEnableUser (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.enable_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html#security-api-enable-user) request + * Perform a [xpack.security.enable_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html) request * * @param {string} username - The username of the user to enable * @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. diff --git a/api/api/xpack.security.get_role_mapping.js b/api/api/xpack.security.get_role_mapping.js index 0cceb6b1a..dea05f037 100644 --- a/api/api/xpack.security.get_role_mapping.js +++ b/api/api/xpack.security.get_role_mapping.js @@ -4,7 +4,7 @@ function buildXpackSecurityGetRoleMapping (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.get_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-role-mapping.html#security-api-get-role-mapping) request + * Perform a [xpack.security.get_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html) request * * @param {string} name - Role-Mapping name */ diff --git a/api/api/xpack.security.get_token.js b/api/api/xpack.security.get_token.js index 2f8877b56..913e8c83b 100644 --- a/api/api/xpack.security.get_token.js +++ b/api/api/xpack.security.get_token.js @@ -4,7 +4,7 @@ function buildXpackSecurityGetToken (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.get_token](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-tokens.html#security-api-get-token) request + * Perform a [xpack.security.get_token](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html) request * * @param {object} body - The token request to get */ diff --git a/api/api/xpack.security.get_user.js b/api/api/xpack.security.get_user.js index 645500eeb..4ee4a2493 100644 --- a/api/api/xpack.security.get_user.js +++ b/api/api/xpack.security.get_user.js @@ -4,7 +4,7 @@ function buildXpackSecurityGetUser (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.get_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html#security-api-get-user) request + * Perform a [xpack.security.get_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html) request * * @param {list} username - A comma-separated list of usernames */ diff --git a/api/api/xpack.security.get_user_privileges.js b/api/api/xpack.security.get_user_privileges.js new file mode 100644 index 000000000..a0f8da0b9 --- /dev/null +++ b/api/api/xpack.security.get_user_privileges.js @@ -0,0 +1,89 @@ +'use strict' + +function buildXpackSecurityGetUserPrivileges (opts) { + // eslint-disable-next-line no-unused-vars + const { makeRequest, ConfigurationError, result } = opts + /** + * Perform a [xpack.security.get_user_privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html) request + * + */ + return function xpackSecurityGetUserPrivileges (params, callback) { + if (typeof params === 'function' || params == null) { + callback = params + params = {} + } + // promises support + if (callback == null) { + return new Promise((resolve, reject) => { + xpackSecurityGetUserPrivileges(params, (err, body) => { + err ? reject(err) : resolve(body) + }) + }) + } + + // check required parameters + if (params.body != null) { + return callback( + new ConfigurationError('This API does not require a body'), + result + ) + } + + // build querystring object + const querystring = {} + const keys = Object.keys(params) + const acceptedQuerystring = [ + + ] + const acceptedQuerystringCamelCased = [ + + ] + + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i] + if (acceptedQuerystring.indexOf(key) !== -1) { + querystring[key] = params[key] + } else { + var camelIndex = acceptedQuerystringCamelCased.indexOf(key) + if (camelIndex !== -1) { + querystring[acceptedQuerystring[camelIndex]] = params[key] + } + } + } + + // configure http method + var method = params.method + if (method == null) { + method = 'GET' + } + + // validate headers object + if (params.headers != null && typeof params.headers !== 'object') { + return callback( + new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`), + result + ) + } + + var ignore = params.ignore || null + if (typeof ignore === 'number') { + ignore = [ignore] + } + + // build request object + const parts = ['_xpack', 'security', 'user', '_privileges'] + const request = { + method, + path: '/' + parts.filter(Boolean).map(encodeURIComponent).join('/'), + querystring, + body: null, + headers: params.headers || null, + ignore, + requestTimeout: params.requestTimeout || null + } + + return makeRequest(request, callback) + } +} + +module.exports = buildXpackSecurityGetUserPrivileges diff --git a/api/api/xpack.security.has_privileges.js b/api/api/xpack.security.has_privileges.js index d888bb1b0..e772571da 100644 --- a/api/api/xpack.security.has_privileges.js +++ b/api/api/xpack.security.has_privileges.js @@ -4,7 +4,7 @@ function buildXpackSecurityHasPrivileges (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.has_privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-privileges.html) request + * Perform a [xpack.security.has_privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html) request * * @param {string} user - Username * @param {object} body - The privileges to test diff --git a/api/api/xpack.security.invalidate_token.js b/api/api/xpack.security.invalidate_token.js index e5b3f6fe6..52d7cd7dd 100644 --- a/api/api/xpack.security.invalidate_token.js +++ b/api/api/xpack.security.invalidate_token.js @@ -4,7 +4,7 @@ function buildXpackSecurityInvalidateToken (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.invalidate_token](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-tokens.html#security-api-invalidate-token) request + * Perform a [xpack.security.invalidate_token](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html) request * * @param {object} body - The token to invalidate */ diff --git a/api/api/xpack.security.put_role_mapping.js b/api/api/xpack.security.put_role_mapping.js index 57ec1a6f4..3cacc94b7 100644 --- a/api/api/xpack.security.put_role_mapping.js +++ b/api/api/xpack.security.put_role_mapping.js @@ -4,7 +4,7 @@ function buildXpackSecurityPutRoleMapping (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.put_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-role-mapping.html#security-api-put-role-mapping) request + * Perform a [xpack.security.put_role_mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html) request * * @param {string} name - Role-mapping name * @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. diff --git a/api/api/xpack.security.put_user.js b/api/api/xpack.security.put_user.js index 0ad0a7031..7c92ddf60 100644 --- a/api/api/xpack.security.put_user.js +++ b/api/api/xpack.security.put_user.js @@ -4,7 +4,7 @@ function buildXpackSecurityPutUser (opts) { // eslint-disable-next-line no-unused-vars const { makeRequest, ConfigurationError, result } = opts /** - * Perform a [xpack.security.put_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html#security-api-put-user) request + * Perform a [xpack.security.put_user](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html) request * * @param {string} username - The username of the User * @param {enum} refresh - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. diff --git a/api/index.js b/api/index.js index 20603b0a3..7417f3b6c 100644 --- a/api/index.js +++ b/api/index.js @@ -23,6 +23,15 @@ const catSnapshots = require('./api/cat.snapshots.js') const catTasks = require('./api/cat.tasks.js') const catTemplates = require('./api/cat.templates.js') const catThreadPool = require('./api/cat.thread_pool.js') +const ccrDeleteAutoFollowPattern = require('./api/ccr.delete_auto_follow_pattern.js') +const ccrFollow = require('./api/ccr.follow.js') +const ccrFollowStats = require('./api/ccr.follow_stats.js') +const ccrGetAutoFollowPattern = require('./api/ccr.get_auto_follow_pattern.js') +const ccrPauseFollow = require('./api/ccr.pause_follow.js') +const ccrPutAutoFollowPattern = require('./api/ccr.put_auto_follow_pattern.js') +const ccrResumeFollow = require('./api/ccr.resume_follow.js') +const ccrStats = require('./api/ccr.stats.js') +const ccrUnfollow = require('./api/ccr.unfollow.js') const clearScroll = require('./api/clear_scroll.js') const clusterAllocationExplain = require('./api/cluster.allocation_explain.js') const clusterGetSettings = require('./api/cluster.get_settings.js') @@ -37,6 +46,7 @@ const count = require('./api/count.js') const create = require('./api/create.js') const _delete = require('./api/delete.js') const deleteByQuery = require('./api/delete_by_query.js') +const deleteByQueryRethrottle = require('./api/delete_by_query_rethrottle.js') const deleteScript = require('./api/delete_script.js') const exists = require('./api/exists.js') const existsSource = require('./api/exists_source.js') @@ -95,6 +105,7 @@ const msearchTemplate = require('./api/msearch_template.js') const mtermvectors = require('./api/mtermvectors.js') const nodesHotThreads = require('./api/nodes.hot_threads.js') const nodesInfo = require('./api/nodes.info.js') +const nodesReloadSecureSettings = require('./api/nodes.reload_secure_settings.js') const nodesStats = require('./api/nodes.stats.js') const nodesUsage = require('./api/nodes.usage.js') const ping = require('./api/ping.js') @@ -123,6 +134,7 @@ const tasksList = require('./api/tasks.list.js') const termvectors = require('./api/termvectors.js') const update = require('./api/update.js') const updateByQuery = require('./api/update_by_query.js') +const updateByQueryRethrottle = require('./api/update_by_query_rethrottle.js') const xpackGraphExplore = require('./api/xpack.graph.explore.js') const xpackInfo = require('./api/xpack.info.js') const xpackLicenseDelete = require('./api/xpack.license.delete.js') @@ -142,8 +154,10 @@ const xpackMlDeleteCalendarJob = require('./api/xpack.ml.delete_calendar_job.js' const xpackMlDeleteDatafeed = require('./api/xpack.ml.delete_datafeed.js') const xpackMlDeleteExpiredData = require('./api/xpack.ml.delete_expired_data.js') const xpackMlDeleteFilter = require('./api/xpack.ml.delete_filter.js') +const xpackMlDeleteForecast = require('./api/xpack.ml.delete_forecast.js') const xpackMlDeleteJob = require('./api/xpack.ml.delete_job.js') const xpackMlDeleteModelSnapshot = require('./api/xpack.ml.delete_model_snapshot.js') +const xpackMlFindFileStructure = require('./api/xpack.ml.find_file_structure.js') const xpackMlFlushJob = require('./api/xpack.ml.flush_job.js') const xpackMlForecast = require('./api/xpack.ml.forecast.js') const xpackMlGetBuckets = require('./api/xpack.ml.get_buckets.js') @@ -202,6 +216,7 @@ const xpackSecurityGetRole = require('./api/xpack.security.get_role.js') const xpackSecurityGetRoleMapping = require('./api/xpack.security.get_role_mapping.js') const xpackSecurityGetToken = require('./api/xpack.security.get_token.js') const xpackSecurityGetUser = require('./api/xpack.security.get_user.js') +const xpackSecurityGetUserPrivileges = require('./api/xpack.security.get_user_privileges.js') const xpackSecurityHasPrivileges = require('./api/xpack.security.has_privileges.js') const xpackSecurityInvalidateToken = require('./api/xpack.security.invalidate_token.js') const xpackSecurityPutPrivileges = require('./api/xpack.security.put_privileges.js') @@ -256,6 +271,23 @@ function ESAPI (opts) { thread_pool: catThreadPool(opts), threadPool: catThreadPool(opts) }, + ccr: { + delete_auto_follow_pattern: ccrDeleteAutoFollowPattern(opts), + deleteAutoFollowPattern: ccrDeleteAutoFollowPattern(opts), + follow: ccrFollow(opts), + follow_stats: ccrFollowStats(opts), + followStats: ccrFollowStats(opts), + get_auto_follow_pattern: ccrGetAutoFollowPattern(opts), + getAutoFollowPattern: ccrGetAutoFollowPattern(opts), + pause_follow: ccrPauseFollow(opts), + pauseFollow: ccrPauseFollow(opts), + put_auto_follow_pattern: ccrPutAutoFollowPattern(opts), + putAutoFollowPattern: ccrPutAutoFollowPattern(opts), + resume_follow: ccrResumeFollow(opts), + resumeFollow: ccrResumeFollow(opts), + stats: ccrStats(opts), + unfollow: ccrUnfollow(opts) + }, clear_scroll: clearScroll(opts), clearScroll: clearScroll(opts), cluster: { @@ -279,6 +311,8 @@ function ESAPI (opts) { delete: _delete(opts), delete_by_query: deleteByQuery(opts), deleteByQuery: deleteByQuery(opts), + delete_by_query_rethrottle: deleteByQueryRethrottle(opts), + deleteByQueryRethrottle: deleteByQueryRethrottle(opts), delete_script: deleteScript(opts), deleteScript: deleteScript(opts), exists: exists(opts), @@ -373,6 +407,8 @@ function ESAPI (opts) { hot_threads: nodesHotThreads(opts), hotThreads: nodesHotThreads(opts), info: nodesInfo(opts), + reload_secure_settings: nodesReloadSecureSettings(opts), + reloadSecureSettings: nodesReloadSecureSettings(opts), stats: nodesStats(opts), usage: nodesUsage(opts) }, @@ -418,6 +454,8 @@ function ESAPI (opts) { update: update(opts), update_by_query: updateByQuery(opts), updateByQuery: updateByQuery(opts), + update_by_query_rethrottle: updateByQueryRethrottle(opts), + updateByQueryRethrottle: updateByQueryRethrottle(opts), xpack: { graph: { explore: xpackGraphExplore(opts) @@ -457,10 +495,14 @@ function ESAPI (opts) { deleteExpiredData: xpackMlDeleteExpiredData(opts), delete_filter: xpackMlDeleteFilter(opts), deleteFilter: xpackMlDeleteFilter(opts), + delete_forecast: xpackMlDeleteForecast(opts), + deleteForecast: xpackMlDeleteForecast(opts), delete_job: xpackMlDeleteJob(opts), deleteJob: xpackMlDeleteJob(opts), delete_model_snapshot: xpackMlDeleteModelSnapshot(opts), deleteModelSnapshot: xpackMlDeleteModelSnapshot(opts), + find_file_structure: xpackMlFindFileStructure(opts), + findFileStructure: xpackMlFindFileStructure(opts), flush_job: xpackMlFlushJob(opts), flushJob: xpackMlFlushJob(opts), forecast: xpackMlForecast(opts), @@ -578,6 +620,8 @@ function ESAPI (opts) { getToken: xpackSecurityGetToken(opts), get_user: xpackSecurityGetUser(opts), getUser: xpackSecurityGetUser(opts), + get_user_privileges: xpackSecurityGetUserPrivileges(opts), + getUserPrivileges: xpackSecurityGetUserPrivileges(opts), has_privileges: xpackSecurityHasPrivileges(opts), hasPrivileges: xpackSecurityHasPrivileges(opts), invalidate_token: xpackSecurityInvalidateToken(opts),