From 6d57aa7f950e679566e5f55ac5379520efcb5865 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Mon, 5 Jan 2015 12:53:11 -0700 Subject: [PATCH] update api --- docs/api_methods.asciidoc | 2 + docs/host.asciidoc | 39 +++++++++++++++++ src/lib/apis/1_4.js | 5 +++ src/lib/apis/1_x.js | 5 +++ src/lib/apis/master.js | 92 ++++++++++++++++++++++++++++----------- 5 files changed, 117 insertions(+), 26 deletions(-) diff --git a/docs/api_methods.asciidoc b/docs/api_methods.asciidoc index 75ae1ecdc..6e14fb98f 100644 --- a/docs/api_methods.asciidoc +++ b/docs/api_methods.asciidoc @@ -1735,6 +1735,8 @@ Options::: `String, String[], Boolean` -- A list of fields to exclude from the returned _source field `_sourceInclude`:: `String, String[], Boolean` -- A list of fields to extract and return from the _source field +`terminateAfter`:: +`Number` -- The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. `stats`:: `String, String[], Boolean` -- Specific 'tag' of the request for logging and statistical purposes `suggestField`:: diff --git a/docs/host.asciidoc b/docs/host.asciidoc index 50e3e3796..1fdc5d1c4 100644 --- a/docs/host.asciidoc +++ b/docs/host.asciidoc @@ -44,6 +44,45 @@ Options ::: `...`:: `Any` -- When the host receives a configuration object, it assigns all of the object's keys to itself. This allows you to pass in arbitrary keys and values that can be used within selectors, or other custom functionality. +`pfx`:: +`String,Array[String]` -- Certificate, Private key and CA certificates to use for SSL. + +Default ::: `null` + +`key`:: +`String` -- Private key to use for SSL. + +Default ::: `null` + +`passphrase`:: +`String` -- A string of passphrase for the private key or pfx. + +Default ::: `null` + +`cert`:: +`String` -- Public x509 certificate to use. + +Default ::: `null` + +`ca`:: +`String,Array[String]` -- An authority certificate or array of authority certificates to check the remote host against. + +Default ::: `null` + +`ciphers`:: +`String` -- A string describing the ciphers to use or exclude. Consult http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT for details on the format. + +Default ::: `null` + +`rejectUnauthorized`:: +`Boolean` -- If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent. + +Default ::: `true` + +`secureProtocol`:: +`String` -- The SSL method to use, e.g. TLSv1_method to force TLS version 1. The possible values depend on your installation of OpenSSL and are defined in the constant SSL_METHODS. + +Default ::: `null` === Examples diff --git a/src/lib/apis/1_4.js b/src/lib/apis/1_4.js index 00f72bf2a..f5a527483 100644 --- a/src/lib/apis/1_4.js +++ b/src/lib/apis/1_4.js @@ -5051,6 +5051,7 @@ api.scroll = ca({ * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes * @param {String} params.suggestField - Specify which field to use for suggestions * @param {String} [params.suggestMode=missing] - Specify suggest mode @@ -5165,6 +5166,10 @@ api.search = ca({ type: 'list', name: '_source_include' }, + terminateAfter: { + type: 'number', + name: 'terminate_after' + }, stats: { type: 'list' }, diff --git a/src/lib/apis/1_x.js b/src/lib/apis/1_x.js index 447c3314e..10e254c93 100644 --- a/src/lib/apis/1_x.js +++ b/src/lib/apis/1_x.js @@ -4428,6 +4428,7 @@ api.nodes = function NodesNS(transport) { * @param {Date, Number} params.interval - The interval for the second sampling of threads * @param {Number} params.snapshots - Number of samples of thread stacktrace (default: 10) * @param {Number} params.threads - Specify the number of threads to provide information for (default: 3) + * @param {Boolean} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) * @param {String} params.type - The type to sample (default: cpu) * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes */ @@ -4442,6 +4443,10 @@ api.nodes.prototype.hotThreads = ca({ threads: { type: 'number' }, + ignoreIdleThreads: { + type: 'boolean', + name: 'ignore_idle_threads' + }, type: { type: 'enum', options: [ diff --git a/src/lib/apis/master.js b/src/lib/apis/master.js index abe9d0088..c6dd9036c 100644 --- a/src/lib/apis/master.js +++ b/src/lib/apis/master.js @@ -148,7 +148,7 @@ api.cat = function CatNS(transport) { * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers * @param {String, String[], Boolean} params.name - A comma-separated list of alias names to return */ api.cat.prototype.aliases = ca({ @@ -169,7 +169,7 @@ api.cat.prototype.aliases = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, urls: [ @@ -196,7 +196,7 @@ api.cat.prototype.aliases = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information */ api.cat.prototype.allocation = ca({ @@ -226,7 +226,7 @@ api.cat.prototype.allocation = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, urls: [ @@ -252,7 +252,7 @@ api.cat.prototype.allocation = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information */ api.cat.prototype.count = ca({ @@ -273,7 +273,7 @@ api.cat.prototype.count = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, urls: [ @@ -300,7 +300,7 @@ api.cat.prototype.count = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers * @param {String, String[], Boolean} params.fields - A comma-separated list of fields to return the fielddata size */ api.cat.prototype.fielddata = ca({ @@ -330,7 +330,7 @@ api.cat.prototype.fielddata = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true }, fields: { type: 'list' @@ -360,7 +360,7 @@ api.cat.prototype.fielddata = ca({ * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information * @param {Boolean} [params.ts=true] - Set to false to disable timestamping - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers */ api.cat.prototype.health = ca({ params: { @@ -384,7 +384,7 @@ api.cat.prototype.health = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, url: { @@ -420,7 +420,7 @@ api.cat.prototype.help = ca({ * @param {String, String[], Boolean} params.h - Comma-separated list of column names to display * @param {Boolean} params.help - Return help information * @param {Boolean} params.pri - Set to true to return stats only for primary shards - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information */ api.cat.prototype.indices = ca({ @@ -454,7 +454,7 @@ api.cat.prototype.indices = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, urls: [ @@ -480,7 +480,7 @@ api.cat.prototype.indices = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers */ api.cat.prototype.master = ca({ params: { @@ -500,7 +500,7 @@ api.cat.prototype.master = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, url: { @@ -516,7 +516,7 @@ api.cat.prototype.master = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers */ api.cat.prototype.nodes = ca({ params: { @@ -536,7 +536,7 @@ api.cat.prototype.nodes = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, url: { @@ -552,7 +552,7 @@ api.cat.prototype.nodes = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers */ api.cat.prototype.pendingTasks = ca({ params: { @@ -572,7 +572,7 @@ api.cat.prototype.pendingTasks = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, url: { @@ -588,7 +588,7 @@ api.cat.prototype.pendingTasks = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers */ api.cat.prototype.plugins = ca({ params: { @@ -608,7 +608,7 @@ api.cat.prototype.plugins = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, url: { @@ -624,7 +624,7 @@ api.cat.prototype.plugins = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information */ api.cat.prototype.recovery = ca({ @@ -651,7 +651,7 @@ api.cat.prototype.recovery = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, urls: [ @@ -677,7 +677,7 @@ api.cat.prototype.recovery = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers * @param {String, String[], Boolean} params.index - A comma-separated list of index names to limit the returned information */ api.cat.prototype.shards = ca({ @@ -698,7 +698,7 @@ api.cat.prototype.shards = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true } }, urls: [ @@ -724,7 +724,7 @@ api.cat.prototype.shards = ca({ * @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 - * @param {Boolean} params.v - Verbose mode. Display column headers + * @param {Boolean} [params.v=true] - Verbose mode. Display column headers * @param {Boolean} params.fullId - Enables displaying the complete node ids */ api.cat.prototype.threadPool = ca({ @@ -745,7 +745,7 @@ api.cat.prototype.threadPool = ca({ }, v: { type: 'boolean', - 'default': false + 'default': true }, fullId: { type: 'boolean', @@ -4360,6 +4360,8 @@ api.msearch = ca({ * @param {String} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". * @param {String} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". * @param {Boolean} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type * @param {String} params.index - The index in which the document resides. * @param {String} params.type - The type of the document. */ @@ -4415,6 +4417,19 @@ api.mtermvectors = ca({ realtime: { type: 'boolean', required: false + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' } }, urls: [ @@ -4455,6 +4470,7 @@ api.nodes = function NodesNS(transport) { * @param {Date, Number} params.interval - The interval for the second sampling of threads * @param {Number} params.snapshots - Number of samples of thread stacktrace (default: 10) * @param {Number} params.threads - Specify the number of threads to provide information for (default: 3) + * @param {Boolean} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) * @param {String} params.type - The type to sample (default: cpu) * @param {String, String[], Boolean} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes */ @@ -4469,6 +4485,10 @@ api.nodes.prototype.hotThreads = ca({ threads: { type: 'number' }, + ignoreIdleThreads: { + type: 'boolean', + name: 'ignore_idle_threads' + }, type: { type: 'enum', options: [ @@ -5082,6 +5102,7 @@ api.scroll = ca({ * @param {String, String[], Boolean} params._source - True or false to return the _source field or not, or a list of fields to return * @param {String, String[], Boolean} params._sourceExclude - A list of fields to exclude from the returned _source field * @param {String, String[], Boolean} params._sourceInclude - A list of fields to extract and return from the _source field + * @param {Number} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {String, String[], Boolean} params.stats - Specific 'tag' of the request for logging and statistical purposes * @param {String} params.suggestField - Specify which field to use for suggestions * @param {String} [params.suggestMode=missing] - Specify suggest mode @@ -5192,6 +5213,10 @@ api.search = ca({ type: 'list', name: '_source_include' }, + terminateAfter: { + type: 'number', + name: 'terminate_after' + }, stats: { type: 'list' }, @@ -5854,6 +5879,8 @@ api.suggest = ca({ * @param {String} params.routing - Specific routing value. * @param {String} params.parent - Parent id of documents. * @param {Boolean} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). + * @param {Number} params.version - Explicit version number for concurrency control + * @param {String} params.versionType - Specific version type * @param {String} params.index - The index in which the document resides. * @param {String} params.type - The type of the document. * @param {String} params.id - The id of the document, when not specified a doc param should be supplied. @@ -5911,6 +5938,19 @@ api.termvectors = ca({ realtime: { type: 'boolean', required: false + }, + version: { + type: 'number' + }, + versionType: { + type: 'enum', + options: [ + 'internal', + 'external', + 'external_gte', + 'force' + ], + name: 'version_type' } }, urls: [