Merge pull request #3 from spenceralger/grunt_browser_test_options
Grunt browser test options
This commit is contained in:
@ -234,8 +234,8 @@ module.exports = function (grunt) {
|
||||
* This is run in the default and browser_tests:{{browser}} tests.
|
||||
*/
|
||||
grunt.registerMultiTask('open_browser_tests', function () {
|
||||
var host = process.env.ES_HOST || 'localhost';
|
||||
var port = process.env.ES_PORT || 9200;
|
||||
var host = grunt.option('host') || 'localhost';
|
||||
var port = grunt.option('port') || 9200;
|
||||
var taskData = this.data;
|
||||
|
||||
grunt.task.requires([
|
||||
|
||||
22
README.md
22
README.md
@ -190,27 +190,7 @@ This function will receive a list of nodes received during a sniff. The list of
|
||||
|
||||
To maintain consistency across all the low-level clients ([PHP](https://github.com/elasticsearch/elasticsearch-php), [Python](https://github.com/elasticsearch/elasticsearch-ph), [Ruby](https://github.com/elasticsearch/elasticsearch-ruby), [Perl](https://github.com/elasticsearch/elasticsearch-perl)) all API methods accept an object with parameters and a callback. If you don't pass the callback, the functions will return a promise.
|
||||
|
||||
### Generic Params
|
||||
|
||||
Several parameters work on all API methods, and control the way that those requests are carried out:
|
||||
|
||||
### ignore
|
||||
Type: `Number` or `Number[]`
|
||||
|
||||
Default: `null`
|
||||
|
||||
Don't treat these HTTP status codes as "errors". Example use cases could be `ignore: 404` or `ignore: [404]`
|
||||
|
||||
### timeout
|
||||
Type: `Number`
|
||||
|
||||
Default: `client.config.timeout`
|
||||
|
||||
The number of milliseconds this request has to complete. It defaults to the timeout specified at the client level, which defaults to 10 seconds.
|
||||
|
||||
### Methods
|
||||
|
||||
All the methods can be seen [here](docs/api.md), or take a look at [api.js](src/lib/api.js).
|
||||
For full details on the API, check out [api.md](docs/api.md).
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
147
docs/api.md
147
docs/api.md
@ -2,70 +2,82 @@
|
||||
|
||||
## Table Of Contents
|
||||
|
||||
- [Generic Params](#generic-params)
|
||||
- [Methods](#methods)
|
||||
- [bulk](#bulk)
|
||||
- [clearScroll](#clearscroll)
|
||||
- [cluster.getSettings](#clustergetsettings)
|
||||
- [cluster.health](#clusterhealth)
|
||||
- [cluster.nodeHotThreads](#clusternodehotthreads)
|
||||
- [cluster.nodeInfo](#clusternodeinfo)
|
||||
- [cluster.nodeShutdown](#clusternodeshutdown)
|
||||
- [cluster.nodeStats](#clusternodestats)
|
||||
- [cluster.putSettings](#clusterputsettings)
|
||||
- [cluster.reroute](#clusterreroute)
|
||||
- [cluster.state](#clusterstate)
|
||||
- [count](#count)
|
||||
- [create](#create)
|
||||
- [delete](#delete)
|
||||
- [deleteByQuery](#deletebyquery)
|
||||
- [exists](#exists)
|
||||
- [explain](#explain)
|
||||
- [get](#get)
|
||||
- [getSource](#getsource)
|
||||
- [index](#index)
|
||||
- [indices.analyze](#indicesanalyze)
|
||||
- [indices.clearCache](#indicesclearcache)
|
||||
- [indices.close](#indicesclose)
|
||||
- [indices.create](#indicescreate)
|
||||
- [indices.delete](#indicesdelete)
|
||||
- [indices.deleteAlias](#indicesdeletealias)
|
||||
- [indices.deleteMapping](#indicesdeletemapping)
|
||||
- [indices.deleteTemplate](#indicesdeletetemplate)
|
||||
- [indices.deleteWarmer](#indicesdeletewarmer)
|
||||
- [indices.exists](#indicesexists)
|
||||
- [indices.existsAlias](#indicesexistsalias)
|
||||
- [indices.existsType](#indicesexiststype)
|
||||
- [indices.flush](#indicesflush)
|
||||
- [indices.getAlias](#indicesgetalias)
|
||||
- [indices.getAliases](#indicesgetaliases)
|
||||
- [indices.getFieldMapping](#indicesgetfieldmapping)
|
||||
- [indices.getMapping](#indicesgetmapping)
|
||||
- [indices.getSettings](#indicesgetsettings)
|
||||
- [indices.getTemplate](#indicesgettemplate)
|
||||
- [indices.getWarmer](#indicesgetwarmer)
|
||||
- [indices.open](#indicesopen)
|
||||
- [indices.optimize](#indicesoptimize)
|
||||
- [indices.putAlias](#indicesputalias)
|
||||
- [indices.putMapping](#indicesputmapping)
|
||||
- [indices.putSettings](#indicesputsettings)
|
||||
- [indices.putTemplate](#indicesputtemplate)
|
||||
- [indices.putWarmer](#indicesputwarmer)
|
||||
- [indices.refresh](#indicesrefresh)
|
||||
- [indices.segments](#indicessegments)
|
||||
- [indices.snapshotIndex](#indicessnapshotindex)
|
||||
- [indices.stats](#indicesstats)
|
||||
- [indices.status](#indicesstatus)
|
||||
- [indices.updateAliases](#indicesupdatealiases)
|
||||
- [indices.validateQuery](#indicesvalidatequery)
|
||||
- [info](#info)
|
||||
- [mget](#mget)
|
||||
- [mlt](#mlt)
|
||||
- [msearch](#msearch)
|
||||
- [percolate](#percolate)
|
||||
- [scroll](#scroll)
|
||||
- [search](#search)
|
||||
- [suggest](#suggest)
|
||||
- [update](#update)
|
||||
|
||||
- [bulk](#bulk)
|
||||
- [clearScroll](#clearscroll)
|
||||
- [cluster.getSettings](#clustergetsettings)
|
||||
- [cluster.health](#clusterhealth)
|
||||
- [cluster.nodeHotThreads](#clusternodehotthreads)
|
||||
- [cluster.nodeInfo](#clusternodeinfo)
|
||||
- [cluster.nodeShutdown](#clusternodeshutdown)
|
||||
- [cluster.nodeStats](#clusternodestats)
|
||||
- [cluster.putSettings](#clusterputsettings)
|
||||
- [cluster.reroute](#clusterreroute)
|
||||
- [cluster.state](#clusterstate)
|
||||
- [count](#count)
|
||||
- [create](#create)
|
||||
- [delete](#delete)
|
||||
- [deleteByQuery](#deletebyquery)
|
||||
- [exists](#exists)
|
||||
- [explain](#explain)
|
||||
- [get](#get)
|
||||
- [getSource](#getsource)
|
||||
- [index](#index)
|
||||
- [indices.analyze](#indicesanalyze)
|
||||
- [indices.clearCache](#indicesclearcache)
|
||||
- [indices.close](#indicesclose)
|
||||
- [indices.create](#indicescreate)
|
||||
- [indices.delete](#indicesdelete)
|
||||
- [indices.deleteAlias](#indicesdeletealias)
|
||||
- [indices.deleteMapping](#indicesdeletemapping)
|
||||
- [indices.deleteTemplate](#indicesdeletetemplate)
|
||||
- [indices.deleteWarmer](#indicesdeletewarmer)
|
||||
- [indices.exists](#indicesexists)
|
||||
- [indices.existsAlias](#indicesexistsalias)
|
||||
- [indices.existsType](#indicesexiststype)
|
||||
- [indices.flush](#indicesflush)
|
||||
- [indices.getAlias](#indicesgetalias)
|
||||
- [indices.getAliases](#indicesgetaliases)
|
||||
- [indices.getFieldMapping](#indicesgetfieldmapping)
|
||||
- [indices.getMapping](#indicesgetmapping)
|
||||
- [indices.getSettings](#indicesgetsettings)
|
||||
- [indices.getTemplate](#indicesgettemplate)
|
||||
- [indices.getWarmer](#indicesgetwarmer)
|
||||
- [indices.open](#indicesopen)
|
||||
- [indices.optimize](#indicesoptimize)
|
||||
- [indices.putAlias](#indicesputalias)
|
||||
- [indices.putMapping](#indicesputmapping)
|
||||
- [indices.putSettings](#indicesputsettings)
|
||||
- [indices.putTemplate](#indicesputtemplate)
|
||||
- [indices.putWarmer](#indicesputwarmer)
|
||||
- [indices.refresh](#indicesrefresh)
|
||||
- [indices.segments](#indicessegments)
|
||||
- [indices.snapshotIndex](#indicessnapshotindex)
|
||||
- [indices.stats](#indicesstats)
|
||||
- [indices.status](#indicesstatus)
|
||||
- [indices.updateAliases](#indicesupdatealiases)
|
||||
- [indices.validateQuery](#indicesvalidatequery)
|
||||
- [info](#info)
|
||||
- [mget](#mget)
|
||||
- [mlt](#mlt)
|
||||
- [msearch](#msearch)
|
||||
- [percolate](#percolate)
|
||||
- [scroll](#scroll)
|
||||
- [search](#search)
|
||||
- [suggest](#suggest)
|
||||
- [update](#update)
|
||||
## Generic Params
|
||||
|
||||
Several parameters can be passed to any API method, and will control the way that those requests are carried out. These parameters are not listed in each method's param list.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| `[timeout=10000]` | Number | The number of milliseconds this request has to complete. It defaults to the timeout specified at the client level, which defaults to 10 seconds. |
|
||||
| `ignore` | Number or Number[] | Don't treat these HTTP status codes as "errors". Example use cases could be `ignore: 404` or `ignore: [404]` |
|
||||
|
||||
## Methods
|
||||
|
||||
### bulk()
|
||||
|
||||
@ -93,8 +105,7 @@ http://www.elasticsearch.org/guide/reference/api/search/scroll/
|
||||
|
||||
http://elasticsearch.org/guide/reference/api/admin-cluster-update-settings/
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
-- none --
|
||||
|
||||
|
||||
### cluster.health()
|
||||
@ -186,8 +197,7 @@ http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-stats/
|
||||
|
||||
http://elasticsearch.org/guide/reference/api/admin-cluster-update-settings/
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
-- none --
|
||||
|
||||
|
||||
### cluster.reroute()
|
||||
@ -817,8 +827,7 @@ http://www.elasticsearch.org/guide/reference/api/validate/
|
||||
|
||||
http://elasticsearch.org/guide/
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
-- none --
|
||||
|
||||
|
||||
### mget()
|
||||
|
||||
@ -34,11 +34,15 @@ function download() {
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
var stat = fs.statSync(outputPath);
|
||||
if (!stat.isFile() || stat.ctime < Date.now() - 86400000) {
|
||||
if (process.env.FORCE_GEN) {
|
||||
download();
|
||||
} else {
|
||||
try {
|
||||
var stat = fs.statSync(outputPath);
|
||||
if (!stat.isFile() || stat.ctime < Date.now() - 86400000) {
|
||||
download();
|
||||
}
|
||||
} catch (e) {
|
||||
download();
|
||||
}
|
||||
} catch (e) {
|
||||
download();
|
||||
}
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
|
||||
## Table Of Contents
|
||||
|
||||
<%
|
||||
- [Generic Params](#generic-params)
|
||||
- [Methods](#methods)<%
|
||||
|
||||
function esc(str) {
|
||||
return str.replace(/\|/g, '|');
|
||||
@ -19,15 +20,30 @@ paramType = function (type) {
|
||||
};
|
||||
|
||||
_.each(actions, function (action) {%>
|
||||
- [<%= action.name %>](#<%= action.name.toLowerCase().replace(/[^\w]/g, '') %>)<%
|
||||
- [<%= action.name %>](#<%= action.name.toLowerCase().replace(/[^\w ]/g, '').replace(/ /g, '-') %>)<%
|
||||
})
|
||||
|
||||
%>
|
||||
|
||||
## Generic Params
|
||||
|
||||
Several parameters can be passed to any API method, and will control the way that those requests are carried out. These parameters are not listed in each method's param list.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| `[timeout=10000]` | Number | The number of milliseconds this request has to complete. It defaults to the timeout specified at the client level, which defaults to 10 seconds. |
|
||||
| `ignore` | Number or Number[] | Don't treat these HTTP status codes as "errors". Example use cases could be `ignore: 404` or `ignore: [404]` |
|
||||
|
||||
## Methods<%
|
||||
|
||||
_.each(actions, function (action) {
|
||||
%>
|
||||
|
||||
### <%= action.name %>()
|
||||
|
||||
<%= action.docUrl %>
|
||||
<%= action.docUrl %><%
|
||||
|
||||
if (_.size(action.allParams)) { %>
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
@ -36,4 +52,11 @@ _.each(actions, function (action) {
|
||||
%>|`<%= paramWithDefault(paramName, param.default) %>` | <%= paramType(param.type) %> | <%= esc(param.description || '') %>|
|
||||
<% })
|
||||
|
||||
} else {%>
|
||||
|
||||
-- none --
|
||||
<%
|
||||
|
||||
}
|
||||
|
||||
}); %>
|
||||
|
||||
@ -30,11 +30,15 @@ function download() {
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
var stat = fs.statSync(testFile);
|
||||
if (!stat.isFile() || stat.ctime < Date.now() - 86400000) {
|
||||
if (process.env.FORCE_GEN) {
|
||||
download();
|
||||
} else {
|
||||
try {
|
||||
var stat = fs.statSync(testFile);
|
||||
if (!stat.isFile() || stat.ctime < Date.now() - 86400000) {
|
||||
download();
|
||||
}
|
||||
} catch (e) {
|
||||
download();
|
||||
}
|
||||
} catch (e) {
|
||||
download();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user