From a91d6b76b93d678a7249c965d030403136a6c26a Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Thu, 27 Mar 2014 09:48:54 -0700 Subject: [PATCH] updated the API to the latest version --- docs/api_methods_1_x.asciidoc | 92 ++++++++++++++--------- docs/api_methods_master.asciidoc | 92 ++++++++++++++--------- src/lib/apis/1_x.js | 124 +++++++++++++++++++------------ src/lib/apis/master.js | 124 +++++++++++++++++++------------ 4 files changed, 262 insertions(+), 170 deletions(-) diff --git a/docs/api_methods_1_x.asciidoc b/docs/api_methods_1_x.asciidoc index b79de2d09..553097826 100644 --- a/docs/api_methods_1_x.asciidoc +++ b/docs/api_methods_1_x.asciidoc @@ -27,6 +27,7 @@ NOTE: At this time, you must opt into the 1.x API by setting the `apiVersion` co * <> * <> * <> +* <> * <> * <> * <> @@ -78,9 +79,9 @@ NOTE: At this time, you must opt into the 1.x API by setting the `apiVersion` co * <> * <> * <> +* <> * <> * <> -* <> * <> * <> * <> @@ -1526,6 +1527,31 @@ Options::: link:#[back to top] +[[api-searchtemplate-1-x]] +=== `searchTemplate` + +[source,js] +-------- +client.searchTemplate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-search.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + [[api-suggest-1-x]] === `suggest` @@ -2140,8 +2166,6 @@ Options::: * `"m"` * `"g"` -`local`:: -`Boolean` -- Return local information, do not retrieve the state from master node (default: false) `masterTimeout`:: `Date, Number` -- Explicit operation timeout for connection to master node `h`:: @@ -3408,6 +3432,35 @@ Options::: link:#[back to top] +[[api-indices-recovery-1-x]] +=== `indices.recovery` + +[source,js] +-------- +client.indices.recovery([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-recovery.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`detailed`:: +`Boolean` -- Whether to display detailed information about shard recovery +`activeOnly`:: +`Boolean` -- Display only those recoveries that are currently on-going +`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-refresh-1-x]] === `indices.refresh` @@ -3482,39 +3535,6 @@ Options::: link:#[back to top] -[[api-indices-snapshotindex-1-x]] -=== `indices.snapshotIndex` - -[source,js] --------- -client.indices.snapshotIndex([params, [callback]]) --------- - -Initiate a snapshot through the gateway of one or more indices. - -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-gateway-snapshot.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"` - -`index`:: -`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string for all indices - -link:#[back to top] - [[api-indices-stats-1-x]] === `indices.stats` diff --git a/docs/api_methods_master.asciidoc b/docs/api_methods_master.asciidoc index f87b8673b..ffbb2ce52 100644 --- a/docs/api_methods_master.asciidoc +++ b/docs/api_methods_master.asciidoc @@ -27,6 +27,7 @@ NOTE: At this time, you must opt into the master API by setting the `apiVersion` * <> * <> * <> +* <> * <> * <> * <> @@ -78,9 +79,9 @@ NOTE: At this time, you must opt into the master API by setting the `apiVersion` * <> * <> * <> +* <> * <> * <> -* <> * <> * <> * <> @@ -1526,6 +1527,31 @@ Options::: link:#[back to top] +[[api-searchtemplate-master]] +=== `searchTemplate` + +[source,js] +-------- +client.searchTemplate([params, [callback]]) +-------- + +// no description + +The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-search.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`index`:: +`String, String[], Boolean` -- A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +`type`:: +`String, String[], Boolean` -- A comma-separated list of document types to search; leave empty to perform the operation on all types + +link:#[back to top] + [[api-suggest-master]] === `suggest` @@ -2140,8 +2166,6 @@ Options::: * `"m"` * `"g"` -`local`:: -`Boolean` -- Return local information, do not retrieve the state from master node (default: false) `masterTimeout`:: `Date, Number` -- Explicit operation timeout for connection to master node `h`:: @@ -3408,6 +3432,35 @@ Options::: link:#[back to top] +[[api-indices-recovery-master]] +=== `indices.recovery` + +[source,js] +-------- +client.indices.recovery([params, [callback]]) +-------- + +// no description + +The default method is `GET` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-recovery.html[the elasticsearch docs] for more about this method. + +// no examples + + +==== Params + +[horizontal] +`detailed`:: +`Boolean` -- Whether to display detailed information about shard recovery +`activeOnly`:: +`Boolean` -- Display only those recoveries that are currently on-going +`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-refresh-master]] === `indices.refresh` @@ -3482,39 +3535,6 @@ Options::: link:#[back to top] -[[api-indices-snapshotindex-master]] -=== `indices.snapshotIndex` - -[source,js] --------- -client.indices.snapshotIndex([params, [callback]]) --------- - -Initiate a snapshot through the gateway of one or more indices. - -The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-gateway-snapshot.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"` - -`index`:: -`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string for all indices - -link:#[back to top] - [[api-indices-stats-master]] === `indices.stats` diff --git a/src/lib/apis/1_x.js b/src/lib/apis/1_x.js index efe274c67..1a44ff602 100644 --- a/src/lib/apis/1_x.js +++ b/src/lib/apis/1_x.js @@ -502,7 +502,6 @@ api.cat.prototype.plugins = ca({ * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.bytes - The unit in which to display byte values - * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information @@ -520,9 +519,6 @@ api.cat.prototype.recovery = ca({ 'g' ] }, - local: { - type: 'boolean' - }, masterTimeout: { type: 'time', name: 'master_timeout' @@ -3204,6 +3200,46 @@ api.indices.prototype.putWarmer = ca({ method: 'PUT' }); +/** + * Perform a [indices.recovery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-recovery.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.detailed - Whether to display detailed information about shard recovery + * @param {Boolean} params.activeOnly - Display only those recoveries that are currently on-going + * @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.recovery = ca({ + params: { + detailed: { + type: 'boolean', + 'default': false + }, + activeOnly: { + type: 'boolean', + 'default': false, + name: 'active_only' + }, + human: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_recovery', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_recovery' + } + ] +}); + /** * Perform a [indices.refresh](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-refresh.html) request * @@ -3311,51 +3347,6 @@ api.indices.prototype.segments = ca({ ] }); -/** - * Perform a [indices.snapshotIndex](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-gateway-snapshot.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 {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.snapshotIndex = 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' - } - }, - urls: [ - { - fmt: '/<%=index%>/_gateway/snapshot', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_gateway/snapshot' - } - ], - method: 'POST' -}); - /** * Perform a [indices.stats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-stats.html) request * @@ -4730,6 +4721,41 @@ api.search = ca({ method: 'POST' }); +/** + * Perform a [searchTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-search.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 to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.searchTemplate = ca({ + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_search/template', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_search/template', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_search/template' + } + ], + method: 'POST' +}); + api.snapshot = function SnapshotNS(transport) { this.transport = transport; }; diff --git a/src/lib/apis/master.js b/src/lib/apis/master.js index c8f4fa60f..d71a70d95 100644 --- a/src/lib/apis/master.js +++ b/src/lib/apis/master.js @@ -502,7 +502,6 @@ api.cat.prototype.plugins = ca({ * * @param {Object} params - An object with parameters used to carry out this action * @param {String} params.bytes - The unit in which to display byte values - * @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false) * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information @@ -520,9 +519,6 @@ api.cat.prototype.recovery = ca({ 'g' ] }, - local: { - type: 'boolean' - }, masterTimeout: { type: 'time', name: 'master_timeout' @@ -3204,6 +3200,46 @@ api.indices.prototype.putWarmer = ca({ method: 'PUT' }); +/** + * Perform a [indices.recovery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-recovery.html) request + * + * @param {Object} params - An object with parameters used to carry out this action + * @param {Boolean} params.detailed - Whether to display detailed information about shard recovery + * @param {Boolean} params.activeOnly - Display only those recoveries that are currently on-going + * @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.recovery = ca({ + params: { + detailed: { + type: 'boolean', + 'default': false + }, + activeOnly: { + type: 'boolean', + 'default': false, + name: 'active_only' + }, + human: { + type: 'boolean', + 'default': false + } + }, + urls: [ + { + fmt: '/<%=index%>/_recovery', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_recovery' + } + ] +}); + /** * Perform a [indices.refresh](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-refresh.html) request * @@ -3311,51 +3347,6 @@ api.indices.prototype.segments = ca({ ] }); -/** - * Perform a [indices.snapshotIndex](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-gateway-snapshot.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 {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.snapshotIndex = 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' - } - }, - urls: [ - { - fmt: '/<%=index%>/_gateway/snapshot', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_gateway/snapshot' - } - ], - method: 'POST' -}); - /** * Perform a [indices.stats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-stats.html) request * @@ -4730,6 +4721,41 @@ api.search = ca({ method: 'POST' }); +/** + * Perform a [searchTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-search.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 to search; use `_all` or empty string to perform the operation on all indices + * @param {String, String[], Boolean} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types + */ +api.searchTemplate = ca({ + urls: [ + { + fmt: '/<%=index%>/<%=type%>/_search/template', + req: { + index: { + type: 'list' + }, + type: { + type: 'list' + } + } + }, + { + fmt: '/<%=index%>/_search/template', + req: { + index: { + type: 'list' + } + } + }, + { + fmt: '/_search/template' + } + ], + method: 'POST' +}); + api.snapshot = function SnapshotNS(transport) { this.transport = transport; };