From c3f044042d6fe6cd82e7febfdb192e0fffdd6dc6 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Fri, 12 Dec 2014 16:44:40 -0700 Subject: [PATCH] updated docs, fixed #170 --- docs/api_methods.asciidoc | 4 +-- scripts/generate/aliases.js | 2 +- src/lib/apis/1_0.js | 2 +- src/lib/apis/1_1.js | 2 +- src/lib/apis/1_2.js | 2 +- src/lib/apis/1_3.js | 2 +- src/lib/apis/1_4.js | 42 ++++++++++++++++++----------- src/lib/apis/1_x.js | 11 +++++++- src/lib/apis/master.js | 53 ++++++++++++++++++++++++++----------- 9 files changed, 80 insertions(+), 40 deletions(-) diff --git a/docs/api_methods.asciidoc b/docs/api_methods.asciidoc index e0b388dae..75ae1ecdc 100644 --- a/docs/api_methods.asciidoc +++ b/docs/api_methods.asciidoc @@ -1332,8 +1332,6 @@ The default method is `POST` and the usual </<%=snapshot%>', + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_create', req: { repository: { type: 'string' diff --git a/src/lib/apis/1_1.js b/src/lib/apis/1_1.js index 925e2c1cd..f9cc4ed23 100644 --- a/src/lib/apis/1_1.js +++ b/src/lib/apis/1_1.js @@ -4911,7 +4911,7 @@ api.snapshot.prototype.create = ca({ } }, url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_create', req: { repository: { type: 'string' diff --git a/src/lib/apis/1_2.js b/src/lib/apis/1_2.js index 86365c206..4d65b1f9d 100644 --- a/src/lib/apis/1_2.js +++ b/src/lib/apis/1_2.js @@ -5024,7 +5024,7 @@ api.snapshot.prototype.create = ca({ } }, url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_create', req: { repository: { type: 'string' diff --git a/src/lib/apis/1_3.js b/src/lib/apis/1_3.js index a97b1fa8f..b0ca936a7 100644 --- a/src/lib/apis/1_3.js +++ b/src/lib/apis/1_3.js @@ -5149,7 +5149,7 @@ api.snapshot.prototype.create = ca({ } }, url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_create', req: { repository: { type: 'string' diff --git a/src/lib/apis/1_4.js b/src/lib/apis/1_4.js index cbfd2f3af..00f72bf2a 100644 --- a/src/lib/apis/1_4.js +++ b/src/lib/apis/1_4.js @@ -4334,7 +4334,6 @@ api.msearch = ca({ * @param {String} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". * @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. */ api.mtermvectors = ca({ params: { @@ -5484,7 +5483,7 @@ api.snapshot.prototype.create = ca({ } }, url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_create', req: { repository: { type: 'string' @@ -5828,7 +5827,7 @@ api.suggest = ca({ * @param {String} params.parent - Parent id of documents. * @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. + * @param {String} params.id - The id of the document, when not specified a doc param should be supplied. */ api.termvector = ca({ params: { @@ -5876,20 +5875,33 @@ api.termvector = ca({ required: false } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvector', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvector', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>/_termvector', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } } } - }, + ], method: 'POST' }); diff --git a/src/lib/apis/1_x.js b/src/lib/apis/1_x.js index 59c6953b0..447c3314e 100644 --- a/src/lib/apis/1_x.js +++ b/src/lib/apis/1_x.js @@ -853,12 +853,21 @@ api.cluster.prototype.pendingTasks = ca({ * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout */ api.cluster.prototype.putSettings = ca({ params: { flatSettings: { type: 'boolean', name: 'flat_settings' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' } }, url: { @@ -5479,7 +5488,7 @@ api.snapshot.prototype.create = ca({ } }, url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_create', req: { repository: { type: 'string' diff --git a/src/lib/apis/master.js b/src/lib/apis/master.js index 39f752478..abe9d0088 100644 --- a/src/lib/apis/master.js +++ b/src/lib/apis/master.js @@ -912,12 +912,21 @@ api.cluster.prototype.pendingTasks = ca({ * * @param {Object} params - An object with parameters used to carry out this action * @param {Boolean} params.flatSettings - Return settings in flat format (default: false) + * @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node + * @param {Date, Number} params.timeout - Explicit operation timeout */ api.cluster.prototype.putSettings = ca({ params: { flatSettings: { type: 'boolean', name: 'flat_settings' + }, + masterTimeout: { + type: 'time', + name: 'master_timeout' + }, + timeout: { + type: 'time' } }, url: { @@ -3879,7 +3888,7 @@ api.indices.prototype.updateAliases = ca({ * @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 {Boolean} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (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 */ api.indices.prototype.upgrade = ca({ @@ -4353,7 +4362,6 @@ api.msearch = ca({ * @param {Boolean} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). * @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. */ api.mtermvectors = ca({ params: { @@ -5502,7 +5510,7 @@ api.snapshot.prototype.create = ca({ } }, url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', + fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_create', req: { repository: { type: 'string' @@ -5848,7 +5856,7 @@ api.suggest = ca({ * @param {Boolean} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). * @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. + * @param {String} params.id - The id of the document, when not specified a doc param should be supplied. */ api.termvectors = ca({ params: { @@ -5905,20 +5913,33 @@ api.termvectors = ca({ required: false } }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' + urls: [ + { + fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + }, + id: { + type: 'string' + } + } + }, + { + fmt: '/<%=index%>/<%=type%>/_termvectors', + req: { + index: { + type: 'string' + }, + type: { + type: 'string' + } } } - }, + ], method: 'POST' });