updated APIs

This commit is contained in:
Spencer Alger
2014-10-07 08:47:14 -07:00
parent 35023bb64f
commit 923a36e29d
9 changed files with 341 additions and 10 deletions

View File

@ -95,6 +95,7 @@ NOTE: This is currently the default API, but in upcomming versions that will cha
* <<api-indices-stats,indices.stats>>
* <<api-indices-status,indices.status>>
* <<api-indices-updatealiases,indices.updateAliases>>
* <<api-indices-upgrade,indices.upgrade>>
* <<api-indices-validatequery,indices.validateQuery>>
* <<api-nodes-hotthreads,nodes.hotThreads>>
* <<api-nodes-info,nodes.info>>
@ -108,6 +109,7 @@ NOTE: This is currently the default API, but in upcomming versions that will cha
* <<api-snapshot-getrepository,snapshot.getRepository>>
* <<api-snapshot-restore,snapshot.restore>>
* <<api-snapshot-status,snapshot.status>>
* <<api-snapshot-verifyrepository,snapshot.verifyRepository>>
[[api-bulk]]
=== `bulk`
@ -1553,7 +1555,7 @@ client.search({
q: 'title:test'
}, function getMoreUntilDone(error, response) {
// collect the title from each response
response.hits.hists.forEach(function (hit) {
response.hits.hits.forEach(function (hit) {
allTitles.push(hit.fields.title);
});
@ -4048,6 +4050,41 @@ client.indices.updateAliases({
link:#[back to top]
[[api-indices-upgrade]]
=== `indices.upgrade`
[source,js]
--------
client.indices.upgrade([params, [callback]])
--------
// no description
The default method is `POST` and the usual <<api-conventions,params and return values>> 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"`
`waitForCompletion`::
`Boolean` -- Specify whether the request should block until the all segments are upgraded (default: true)
`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-validatequery]]
=== `indices.validateQuery`
@ -4280,6 +4317,8 @@ The default method is `POST` and the usual <<api-conventions,params and return v
`Date, Number` -- Explicit operation timeout for connection to master node
`timeout`::
`Date, Number` -- Explicit operation timeout
`verify`::
`Boolean` -- Whether to verify the repository after creation
`repository`::
`String` -- A repository name
@ -4448,3 +4487,30 @@ The default method is `GET` and the usual <<api-conventions,params and return va
`String, String[], Boolean` -- A comma-separated list of snapshot names
link:#[back to top]
[[api-snapshot-verifyrepository]]
=== `snapshot.verifyRepository`
[source,js]
--------
client.snapshot.verifyRepository([params, [callback]])
--------
// no description
The default method is `POST` and the usual <<api-conventions,params and return values>> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html[the elasticsearch docs] for more about this method.
// no examples
==== Params
[horizontal]
`masterTimeout`::
`Date, Number` -- Explicit operation timeout for connection to master node
`timeout`::
`Date, Number` -- Explicit operation timeout
`repository`::
`String` -- A repository name
link:#[back to top]

View File

@ -1138,7 +1138,7 @@ client.search({
q: 'title:test'
}, function getMoreUntilDone(error, response) {
// collect the title from each response
response.hits.hists.forEach(function (hit) {
response.hits.hits.forEach(function (hit) {
allTitles.push(hit.fields.title);
});

View File

@ -1339,7 +1339,7 @@ client.search({
q: 'title:test'
}, function getMoreUntilDone(error, response) {
// collect the title from each response
response.hits.hists.forEach(function (hit) {
response.hits.hits.forEach(function (hit) {
allTitles.push(hit.fields.title);
});

View File

@ -1357,7 +1357,7 @@ client.search({
q: 'title:test'
}, function getMoreUntilDone(error, response) {
// collect the title from each response
response.hits.hists.forEach(function (hit) {
response.hits.hits.forEach(function (hit) {
allTitles.push(hit.fields.title);
});

View File

@ -1407,7 +1407,7 @@ client.search({
q: 'title:test'
}, function getMoreUntilDone(error, response) {
// collect the title from each response
response.hits.hists.forEach(function (hit) {
response.hits.hits.forEach(function (hit) {
allTitles.push(hit.fields.title);
});

View File

@ -1557,7 +1557,7 @@ client.search({
q: 'title:test'
}, function getMoreUntilDone(error, response) {
// collect the title from each response
response.hits.hists.forEach(function (hit) {
response.hits.hits.forEach(function (hit) {
allTitles.push(hit.fields.title);
});

View File

@ -3822,6 +3822,56 @@ api.indices.prototype.updateAliases = ca({
method: 'POST'
});
/**
* 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.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'
},
expandWildcards: {
type: 'enum',
'default': 'open',
options: [
'open',
'closed'
],
name: 'expand_wildcards'
},
waitForCompletion: {
type: 'boolean',
name: 'wait_for_completion'
}
},
urls: [
{
fmt: '/<%=index%>/_upgrade',
req: {
index: {
type: 'list'
}
}
},
{
fmt: '/_upgrade'
}
],
method: 'POST'
});
/**
* Perform a [indices.validateQuery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-validate.html) request
*
@ -5342,6 +5392,7 @@ api.snapshot.prototype.create = ca({
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {Boolean} params.verify - Whether to verify the repository after creation
* @param {String} params.repository - A repository name
*/
api.snapshot.prototype.createRepository = ca({
@ -5352,6 +5403,9 @@ api.snapshot.prototype.createRepository = ca({
},
timeout: {
type: 'time'
},
verify: {
type: 'boolean'
}
},
url: {
@ -5561,6 +5615,35 @@ api.snapshot.prototype.status = ca({
]
});
/**
* Perform a [snapshot.verifyRepository](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {String} params.repository - A repository name
*/
api.snapshot.prototype.verifyRepository = ca({
params: {
masterTimeout: {
type: 'time',
name: 'master_timeout'
},
timeout: {
type: 'time'
}
},
url: {
fmt: '/_snapshot/<%=repository%>/_verify',
req: {
repository: {
type: 'string'
}
}
},
method: 'POST'
});
/**
* Perform a [suggest](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-search.html) request
*

View File

@ -3881,6 +3881,56 @@ api.indices.prototype.updateAliases = ca({
method: 'POST'
});
/**
* 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.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'
},
expandWildcards: {
type: 'enum',
'default': 'open',
options: [
'open',
'closed'
],
name: 'expand_wildcards'
},
waitForCompletion: {
type: 'boolean',
name: 'wait_for_completion'
}
},
urls: [
{
fmt: '/<%=index%>/_upgrade',
req: {
index: {
type: 'list'
}
}
},
{
fmt: '/_upgrade'
}
],
method: 'POST'
});
/**
* Perform a [indices.validateQuery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-validate.html) request
*
@ -4309,6 +4359,7 @@ api.msearch = ca({
* @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs".
* @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 {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.
@ -4361,6 +4412,10 @@ api.mtermvectors = ca({
parent: {
type: 'string',
required: false
},
realtime: {
type: 'boolean',
required: false
}
},
urls: [
@ -5435,6 +5490,7 @@ api.snapshot.prototype.create = ca({
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {Boolean} params.verify - Whether to verify the repository after creation
* @param {String} params.repository - A repository name
*/
api.snapshot.prototype.createRepository = ca({
@ -5445,6 +5501,9 @@ api.snapshot.prototype.createRepository = ca({
},
timeout: {
type: 'time'
},
verify: {
type: 'boolean'
}
},
url: {
@ -5654,6 +5713,35 @@ api.snapshot.prototype.status = ca({
]
});
/**
* Perform a [snapshot.verifyRepository](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {String} params.repository - A repository name
*/
api.snapshot.prototype.verifyRepository = ca({
params: {
masterTimeout: {
type: 'time',
name: 'master_timeout'
},
timeout: {
type: 'time'
}
},
url: {
fmt: '/_snapshot/<%=repository%>/_verify',
req: {
repository: {
type: 'string'
}
}
},
method: 'POST'
});
/**
* Perform a [suggest](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-search.html) request
*
@ -5725,6 +5813,7 @@ api.suggest = ca({
* @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random).
* @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 {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.
@ -5773,6 +5862,10 @@ api.termvector = ca({
parent: {
type: 'string',
required: false
},
realtime: {
type: 'boolean',
required: false
}
},
url: {

View File

@ -3181,7 +3181,6 @@ api.indices.prototype.open = ca({
* @param {Boolean} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents
* @param {Anything} params.operationThreading - TODO: ?
* @param {Boolean} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true)
* @param {Boolean} params.force - Force a merge operation to run, even if there is a single segment in the index (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.optimize = ca({
@ -3220,9 +3219,6 @@ api.indices.prototype.optimize = ca({
waitForMerge: {
type: 'boolean',
name: 'wait_for_merge'
},
force: {
type: 'boolean'
}
},
urls: [
@ -3820,6 +3816,56 @@ api.indices.prototype.updateAliases = ca({
method: 'POST'
});
/**
* 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.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'
},
expandWildcards: {
type: 'enum',
'default': 'open',
options: [
'open',
'closed'
],
name: 'expand_wildcards'
},
waitForCompletion: {
type: 'boolean',
name: 'wait_for_completion'
}
},
urls: [
{
fmt: '/<%=index%>/_upgrade',
req: {
index: {
type: 'list'
}
}
},
{
fmt: '/_upgrade'
}
],
method: 'POST'
});
/**
* Perform a [indices.validateQuery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-validate.html) request
*
@ -4248,6 +4294,7 @@ api.msearch = ca({
* @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs".
* @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 {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.
@ -4300,6 +4347,10 @@ api.mtermvectors = ca({
parent: {
type: 'string',
required: false
},
realtime: {
type: 'boolean',
required: false
}
},
urls: [
@ -5377,6 +5428,7 @@ api.snapshot.prototype.create = ca({
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {Boolean} params.verify - Whether to verify the repository after creation
* @param {String} params.repository - A repository name
*/
api.snapshot.prototype.createRepository = ca({
@ -5387,6 +5439,9 @@ api.snapshot.prototype.createRepository = ca({
},
timeout: {
type: 'time'
},
verify: {
type: 'boolean'
}
},
url: {
@ -5596,6 +5651,35 @@ api.snapshot.prototype.status = ca({
]
});
/**
* Perform a [snapshot.verifyRepository](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.masterTimeout - Explicit operation timeout for connection to master node
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {String} params.repository - A repository name
*/
api.snapshot.prototype.verifyRepository = ca({
params: {
masterTimeout: {
type: 'time',
name: 'master_timeout'
},
timeout: {
type: 'time'
}
},
url: {
fmt: '/_snapshot/<%=repository%>/_verify',
req: {
repository: {
type: 'string'
}
}
},
method: 'POST'
});
/**
* Perform a [suggest](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-search.html) request
*
@ -5667,6 +5751,7 @@ api.suggest = ca({
* @param {String} params.preference - Specify the node or shard the operation should be performed on (default: random).
* @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 {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.
@ -5715,6 +5800,10 @@ api.termvector = ca({
parent: {
type: 'string',
required: false
},
realtime: {
type: 'boolean',
required: false
}
},
url: {