diff --git a/docs/api_methods.asciidoc b/docs/api_methods.asciidoc index e28fcccde..8f9bfb3dc 100644 --- a/docs/api_methods.asciidoc +++ b/docs/api_methods.asciidoc @@ -81,6 +81,7 @@ NOTE: This is currently the default API, but in upcomming versions that will cha * <> * <> * <> +* <> * <> * <> * <> @@ -3524,6 +3525,41 @@ The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-upgrade.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`ignoreUnavailable`:: +`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) +`allowNoIndices`:: +`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) +`[expandWildcards=open]`:: +`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both. +Options::: + * `"open"` + * `"closed"` + +`human`:: +`Boolean` -- Whether to return time and byte values in human-readable format. +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + +link:#[back to top] + [[api-indices-getwarmer]] === `indices.getWarmer` @@ -4068,8 +4104,6 @@ The default method is `POST` and the usual </_upgrade', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_upgrade' + } + ] +}); + /** * Perform a [indices.getWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html) request * @@ -3826,18 +3875,14 @@ api.indices.prototype.updateAliases = ca({ * Perform a [indices.upgrade](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - 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 {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: true) * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices */ api.indices.prototype.upgrade = ca({ params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, allowNoIndices: { type: 'boolean', name: 'allow_no_indices' @@ -3851,6 +3896,10 @@ api.indices.prototype.upgrade = ca({ ], name: 'expand_wildcards' }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, waitForCompletion: { type: 'boolean', name: 'wait_for_completion' diff --git a/src/lib/apis/1_x.js b/src/lib/apis/1_x.js index b319df08f..e55949537 100644 --- a/src/lib/apis/1_x.js +++ b/src/lib/apis/1_x.js @@ -5,65 +5,6 @@ var api = module.exports = {}; api._namespaces = ['cat', 'cluster', 'indices', 'nodes', 'snapshot']; -/** - * Perform a [abortBenchmark](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {String} params.name - A benchmark name - */ -api.abortBenchmark = ca({ - url: { - fmt: '/_bench/abort/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [benchmark](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {Boolean} params.verbose - Specify whether to return verbose statistics about each iteration (default: false) - * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {String} params.type - The name of the document type - */ -api.benchmark = ca({ - params: { - verbose: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bench', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bench', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_bench' - } - ], - method: 'PUT' -}); - /** * Perform a [bulk](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-bulk.html) request * @@ -3037,6 +2978,55 @@ api.indices.prototype.getTemplate = ca({ ] }); +/** + * Perform a [indices.getUpgrade](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-upgrade.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - 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 {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.getUpgrade = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed' + ], + name: 'expand_wildcards' + }, + human: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_upgrade', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_upgrade' + } + ] +}); + /** * Perform a [indices.getWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html) request * @@ -3885,18 +3875,14 @@ api.indices.prototype.updateAliases = ca({ * Perform a [indices.upgrade](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - 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 {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: true) * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices */ api.indices.prototype.upgrade = ca({ params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, allowNoIndices: { type: 'boolean', name: 'allow_no_indices' @@ -3910,6 +3896,10 @@ api.indices.prototype.upgrade = ca({ ], name: 'expand_wildcards' }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, waitForCompletion: { type: 'boolean', name: 'wait_for_completion' @@ -4015,40 +4005,6 @@ api.info = ca({ } }); -/** - * Perform a [listBenchmarks](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {String} params.type - The name of the document type - */ -api.listBenchmarks = ca({ - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bench', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bench', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_bench' - } - ] -}); - /** * Perform a [mget](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-multi-get.html) request * diff --git a/src/lib/apis/master.js b/src/lib/apis/master.js index 33a6a4bb5..5062c4647 100644 --- a/src/lib/apis/master.js +++ b/src/lib/apis/master.js @@ -3037,6 +3037,55 @@ api.indices.prototype.getTemplate = ca({ ] }); +/** + * Perform a [indices.getUpgrade](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-upgrade.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {Boolean} params.allowNoIndices - 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 {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.human - Whether to return time and byte values in human-readable format. + * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + */ +api.indices.prototype.getUpgrade = ca({ + params: { + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, + allowNoIndices: { + type: 'boolean', + name: 'allow_no_indices' + }, + expandWildcards: { + type: 'enum', + 'default': 'open', + options: [ + 'open', + 'closed' + ], + name: 'expand_wildcards' + }, + human: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_upgrade', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_upgrade' + } + ] +}); + /** * Perform a [indices.getWarmer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-warmers.html) request * @@ -3820,18 +3869,14 @@ api.indices.prototype.updateAliases = ca({ * Perform a [indices.upgrade](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-upgrade.html) request * * @param {Object} params - An object with parameters used to carry out this action - * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.allowNoIndices - 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 {String} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. + * @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) * @param {Boolean} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: true) * @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices */ api.indices.prototype.upgrade = ca({ params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, allowNoIndices: { type: 'boolean', name: 'allow_no_indices' @@ -3845,6 +3890,10 @@ api.indices.prototype.upgrade = ca({ ], name: 'expand_wildcards' }, + ignoreUnavailable: { + type: 'boolean', + name: 'ignore_unavailable' + }, waitForCompletion: { type: 'boolean', name: 'wait_for_completion' @@ -5744,6 +5793,7 @@ api.suggest = ca({ * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.termStatistics - Specifies if total term frequency and document frequency should be returned. * @param {Boolean} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. + * @param {Boolean} params.dfs - Specifies if distributed frequencies should be returned instead shard frequencies. * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return. * @param {Boolean} [params.offsets=true] - Specifies if term offsets should be returned. * @param {Boolean} [params.positions=true] - Specifies if term positions should be returned. @@ -5770,6 +5820,11 @@ api.termvector = ca({ required: false, name: 'field_statistics' }, + dfs: { + type: 'boolean', + 'default': false, + required: false + }, fields: { type: 'list', required: false