Updated ES, brought a few modification to the API along with it. Yaml test suite is now built against a specific version of elasticsearch when you specify the es_branch arg

to `grunt test`
This commit is contained in:
Spencer Alger
2014-01-07 10:00:07 -07:00
parent 71a0b8f58e
commit bbbfcfa33e
6 changed files with 347 additions and 21 deletions

View File

@ -1025,6 +1025,12 @@ The default method is `POST` and the usual <<api-conventions,params and return v
`Date, Number` -- Explicit operation timeout
`masterTimeout`::
`Date, Number` -- Specify timeout for connection to master
`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.
`index`::
`String` -- The name of the index
@ -1200,6 +1206,12 @@ The default method is `HEAD` and the usual <<api-conventions,params and return v
==== 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.
`index`::
`String, String[], Boolean` -- A comma-separated list of indices to check
@ -1280,9 +1292,9 @@ The default method is `POST` and the usual <<api-conventions,params and return v
[horizontal]
`force`::
`Boolean` -- TODO: ?
`Boolean` -- Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)
`full`::
`Boolean` -- TODO: ?
`Boolean` -- If set to true a new index writer is created and settings that have been changed related to the index writer will be refreshed. Note: if a full flush is required for a setting to take effect this will be part of the settings update process and it not required to be executed by the user. (This setting can be considered as internal)
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed)
`allowNoIndices`::
@ -1323,6 +1335,29 @@ The default method is `GET` and the usual <<api-conventions,params and return va
`name`::
`String, String[], Boolean` -- A comma-separated list of alias names to return
[[api-indices-getaliases]]
=== `indices.getAliases`
[source,js]
--------
client.indices.getAliases([params, [callback]])
--------
Retrieve specified aliases
The default method is `GET` and the usual <<api-conventions,params and return values>> apply. See http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/[the elasticsearch docs] for more about this method.
// no examples
==== Params
[horizontal]
`timeout`::
`Date, Number` -- Explicit operation timeout
`index`::
`String, String[], Boolean` -- A comma-separated list of index names to filter aliases
[[api-indices-getfieldmapping]]
=== `indices.getFieldMapping`
@ -1343,6 +1378,12 @@ The default method is `GET` and the usual <<api-conventions,params and return va
[horizontal]
`includeDefaults`::
`Boolean` -- Whether the default mapping values should be returned as well
`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.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names
`type`::
@ -1368,6 +1409,12 @@ The default method is `GET` and the usual <<api-conventions,params and return va
==== 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.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names
`type`::
@ -1433,6 +1480,12 @@ The default method is `GET` and the usual <<api-conventions,params and return va
==== 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.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names to restrict the operation; use `_all` to perform the operation on all indices
`name`::
@ -1462,6 +1515,12 @@ The default method is `POST` and the usual <<api-conventions,params and return v
`Date, Number` -- Explicit operation timeout
`masterTimeout`::
`Date, Number` -- Specify timeout for connection to master
`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=closed]`::
`String` -- Whether to expand wildcard expression to concrete indices that are open, closed or both.
`index`::
`String` -- The name of the index
@ -1555,6 +1614,12 @@ The default method is `PUT` and the usual <<api-conventions,params and return va
`Date, Number` -- Explicit operation timeout
`masterTimeout`::
`Date, Number` -- Specify timeout for connection to master
`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.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names; use `_all` to perform the operation on all indices
`type`::
@ -1580,6 +1645,12 @@ The default method is `PUT` and the usual <<api-conventions,params and return va
[horizontal]
`masterTimeout`::
`Date, Number` -- Specify timeout for connection to master
`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.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
@ -1630,6 +1701,12 @@ The default method is `PUT` and the usual <<api-conventions,params and return va
[horizontal]
`masterTimeout`::
`Date, Number` -- Specify timeout for connection to master
`ignoreUnavailable`::
`Boolean` -- Whether specified concrete indices should be ignored when unavailable (missing or closed) in the search request to warm
`allowNoIndices`::
`Boolean` -- Whether to ignore if a wildcard indices expression resolves into no concrete indices in the search request to warm. (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, in the search request to warm.
`index`::
`String, String[], Boolean` -- A comma-separated list of index names to register the warmer for; use `_all` or empty string to perform the operation on all indices
`name`::

View File

@ -3,7 +3,13 @@ module.exports = {
cwd: './scripts'
},
generate: {
exec: 'node generate'
exec: 'node generate/index.js',
options: {
passArgs: [
'verbose',
'es_version'
]
}
},
browser_integration_tests: {
exec: 'node run_browser_integration_suite',

View File

@ -19,6 +19,11 @@ var argv = require('optimist')
tests: {
default: true,
boolean: true
},
es_version: {
default: 'master',
string: true,
alias: 'b'
}
});
@ -35,23 +40,46 @@ if (!argv.force && process.env.FORCE || process.env.FORCE_GEN) {
}
function updateSubmodules(done) {
cp.exec('git submodule update --init && git submodule foreach git pull origin master',
function (err, stdout, stderr) {
stdout = stdout.trim();
stderr = stderr.trim();
var branch = argv.es_version;
// branch can be prefixed with = or suffixed with _nightly
if (branch.indexOf) {
['='].forEach(function removePrefix(pref) {
if (branch.indexOf(pref) === 0) {
branch = branch.substring(pref.length);
}
});
if (err) {
done(new Error('Unable to update submodules: ' + err.message));
return;
} else if (argv.verbose && stdout) {
console.log(stdout);
}
['_nightly'].forEach(function removeSuffix(suf) {
if (branch.indexOf(suf) === branch.length - suf.length) {
branch = branch.substr(0, branch.length - suf.length);
}
});
}
if (stderr) {
console.error(stderr);
var stdio = [
'ignore',
argv.verbose ? process.stdout : 'ignore',
process.stderr
];
async.series([
function (done) {
// init submodules
cp.spawn('git', ['submodule', 'update', '--init'], {
stdio: stdio
}).on('exit', function (status) {
done(status ? new Error('Unable to init submodules.') : void 0);
});
},
function (done) {
// checkout branch and clean it
cp.spawn('git', ['submodule', 'foreach', 'git checkout --detach origin/' + branch + ' && git clean -f'], {
stdio: stdio
}).on('exit', function (status) {
done(status ? new Error('Unable to init submodules.') : void 0);
});
}
done();
});
], done);
}
updateSubmodules(function (err) {

View File

@ -1,7 +1,8 @@
#!/bin/bash
# generate the latest version of the yaml-tests
node scripts/generate/ --no-api 2>&1 > /dev/null
node scripts/generate/ --no-api --es_version="=$ES_V"
export VERBOSE="true"

View File

@ -1299,6 +1299,9 @@ api.indices.prototype.clearCache = ca({
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {Date, Number} params.masterTimeout - Specify timeout for connection to master
* @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} params.index - The name of the index
*/
api.indices.prototype.close = ca({
@ -1309,6 +1312,23 @@ api.indices.prototype.close = ca({
masterTimeout: {
type: 'time',
name: 'master_timeout'
},
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'open',
options: [
'open',
'closed'
],
name: 'expand_wildcards'
}
},
url: {
@ -1539,9 +1559,31 @@ api.indices.prototype.deleteWarmer = ca({
* Perform a [indices.exists](http://www.elasticsearch.org/guide/reference/api/admin-indices-indices-exists/) 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 indices to check
*/
api.indices.prototype.exists = 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'
}
},
url: {
fmt: '/<%=index%>',
req: {
@ -1671,8 +1713,8 @@ api.indices.prototype.existsType = ca({
* Perform a [indices.flush](http://www.elasticsearch.org/guide/reference/api/admin-indices-flush/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Boolean} params.force - TODO: ?
* @param {Boolean} params.full - TODO: ?
* @param {Boolean} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)
* @param {Boolean} params.full - If set to true a new index writer is created and settings that have been changed related to the index writer will be refreshed. Note: if a full flush is required for a setting to take effect this will be part of the settings update process and it not required to be executed by the user. (This setting can be considered as internal)
* @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.
@ -1785,11 +1827,42 @@ api.indices.prototype.getAlias = ca({
]
});
/**
* Perform a [indices.getAliases](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {String, String[], Boolean} params.index - A comma-separated list of index names to filter aliases
*/
api.indices.prototype.getAliases = ca({
params: {
timeout: {
type: 'time'
}
},
urls: [
{
fmt: '/<%=index%>/_aliases',
req: {
index: {
type: 'list'
}
}
},
{
fmt: '/_aliases'
}
]
});
/**
* Perform a [indices.getFieldMapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Boolean} params.includeDefaults - Whether the default mapping values should be returned as well
* @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
* @param {String, String[], Boolean} params.type - A comma-separated list of document types
* @param {String, String[], Boolean} params.field - A comma-separated list of fields
@ -1799,6 +1872,23 @@ api.indices.prototype.getFieldMapping = ca({
includeDefaults: {
type: 'boolean',
name: 'include_defaults'
},
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: [
@ -1842,10 +1932,32 @@ api.indices.prototype.getFieldMapping = ca({
* Perform a [indices.getMapping](http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping/) 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
* @param {String, String[], Boolean} params.type - A comma-separated list of document types
*/
api.indices.prototype.getMapping = 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%>/<%=type%>/_mapping',
@ -1920,11 +2032,33 @@ api.indices.prototype.getTemplate = ca({
* Perform a [indices.getWarmer](http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/) 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 to restrict the operation; use `_all` to perform the operation on all indices
* @param {String} params.name - The name of the warmer (supports wildcards); leave empty to get all warmers
* @param {String, String[], Boolean} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types
*/
api.indices.prototype.getWarmer = 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%>/<%=type%>/_warmer/<%=name%>',
@ -1968,6 +2102,9 @@ api.indices.prototype.getWarmer = ca({
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {Date, Number} params.masterTimeout - Specify timeout for connection to master
* @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=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {String} params.index - The name of the index
*/
api.indices.prototype.open = ca({
@ -1978,6 +2115,23 @@ api.indices.prototype.open = ca({
masterTimeout: {
type: 'time',
name: 'master_timeout'
},
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'closed',
options: [
'open',
'closed'
],
name: 'expand_wildcards'
}
},
url: {
@ -2125,6 +2279,9 @@ api.indices.prototype.putAlias = ca({
* @param {Boolean} params.ignoreConflicts - Specify whether to ignore conflicts while updating the mapping (default: false)
* @param {Date, Number} params.timeout - Explicit operation timeout
* @param {Date, Number} params.masterTimeout - Specify timeout for connection to master
* @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` to perform the operation on all indices
* @param {String} params.type - The name of the document type
*/
@ -2140,6 +2297,23 @@ api.indices.prototype.putMapping = ca({
masterTimeout: {
type: 'time',
name: 'master_timeout'
},
ignoreUnavailable: {
type: 'boolean',
name: 'ignore_unavailable'
},
allowNoIndices: {
type: 'boolean',
name: 'allow_no_indices'
},
expandWildcards: {
type: 'enum',
'default': 'open',
options: [
'open',
'closed'
],
name: 'expand_wildcards'
}
},
url: {
@ -2162,6 +2336,9 @@ api.indices.prototype.putMapping = ca({
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.masterTimeout - Specify timeout for connection to master
* @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 to perform the operation on all indices
*/
api.indices.prototype.putSettings = ca({
@ -2169,6 +2346,23 @@ api.indices.prototype.putSettings = ca({
masterTimeout: {
type: 'time',
name: 'master_timeout'
},
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: [
@ -2226,6 +2420,9 @@ api.indices.prototype.putTemplate = ca({
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {Date, Number} params.masterTimeout - Specify timeout for connection to master
* @param {Boolean} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) in the search request to warm
* @param {Boolean} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices in the search request to warm. (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, in the search request to warm.
* @param {String, String[], Boolean} params.index - A comma-separated list of index names to register the warmer for; use `_all` or empty string to perform the operation on all indices
* @param {String} params.name - The name of the warmer
* @param {String, String[], Boolean} params.type - A comma-separated list of document types to register the warmer for; leave empty to perform the operation on all types
@ -2235,6 +2432,23 @@ api.indices.prototype.putWarmer = ca({
masterTimeout: {
type: 'time',
name: 'master_timeout'
},
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: [