Skip to content

Commit b19f0d5

Browse files
committed
API generation
1 parent 070dd23 commit b19f0d5

File tree

256 files changed

+2094
-18640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+2094
-18640
lines changed

api/api/bulk.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildBulk (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request
29+
* Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-bulk.html) request
3030
*
3131
* @param {string} index - Default index for items which don't provide one
3232
* @param {string} type - Default document type for items which don't provide one
@@ -35,9 +35,10 @@ function buildBulk (opts) {
3535
* @param {string} routing - Specific routing value
3636
* @param {time} timeout - Explicit operation timeout
3737
* @param {string} type - Default document type for items which don't provide one
38+
* @param {list} fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request
3839
* @param {list} _source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
39-
* @param {list} _source_excludes - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
40-
* @param {list} _source_includes - Default list of fields to extract and return from the _source field, can be overridden on each sub-request
40+
* @param {list} _source_exclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
41+
* @param {list} _source_include - Default list of fields to extract and return from the _source field, can be overridden on each sub-request
4142
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
4243
* @param {object} body - The operation definition and data (action-data pairs), separated by newlines
4344
*/
@@ -48,9 +49,10 @@ function buildBulk (opts) {
4849
'routing',
4950
'timeout',
5051
'type',
52+
'fields',
5153
'_source',
52-
'_source_excludes',
53-
'_source_includes',
54+
'_source_exclude',
55+
'_source_include',
5456
'pipeline',
5557
'pretty',
5658
'human',
@@ -61,8 +63,8 @@ function buildBulk (opts) {
6163

6264
const snakeCase = {
6365
waitForActiveShards: 'wait_for_active_shards',
64-
_sourceExcludes: '_source_excludes',
65-
_sourceIncludes: '_source_includes',
66+
_sourceExclude: '_source_exclude',
67+
_sourceInclude: '_source_include',
6668
errorTrace: 'error_trace',
6769
filterPath: 'filter_path'
6870
}
@@ -79,6 +81,15 @@ function buildBulk (opts) {
7981
options = {}
8082
}
8183

84+
// promises support
85+
if (callback == null) {
86+
return new Promise((resolve, reject) => {
87+
bulk(params, options, (err, body) => {
88+
err ? reject(err) : resolve(body)
89+
})
90+
})
91+
}
92+
8293
// check required parameters
8394
if (params['body'] == null) {
8495
return callback(

api/api/cat.aliases.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatAliases (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.aliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html) request
29+
* Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-alias.html) request
3030
*
3131
* @param {list} name - A comma-separated list of alias names to return
3232
* @param {string} format - a short version of the Accept header, e.g. json, yaml
@@ -71,6 +71,15 @@ function buildCatAliases (opts) {
7171
options = {}
7272
}
7373

74+
// promises support
75+
if (callback == null) {
76+
return new Promise((resolve, reject) => {
77+
catAliases(params, options, (err, body) => {
78+
err ? reject(err) : resolve(body)
79+
})
80+
})
81+
}
82+
7483
// check required parameters
7584
if (params.body != null) {
7685
return callback(

api/api/cat.allocation.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatAllocation (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.allocation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request
29+
* Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-allocation.html) request
3030
*
3131
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information
3232
* @param {string} format - a short version of the Accept header, e.g. json, yaml
@@ -73,6 +73,15 @@ function buildCatAllocation (opts) {
7373
options = {}
7474
}
7575

76+
// promises support
77+
if (callback == null) {
78+
return new Promise((resolve, reject) => {
79+
catAllocation(params, options, (err, body) => {
80+
err ? reject(err) : resolve(body)
81+
})
82+
})
83+
}
84+
7685
// check required parameters
7786
if (params.body != null) {
7887
return callback(

api/api/cat.count.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatCount (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.count](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request
29+
* Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-count.html) request
3030
*
3131
* @param {list} index - A comma-separated list of index names to limit the returned information
3232
* @param {string} format - a short version of the Accept header, e.g. json, yaml
@@ -71,6 +71,15 @@ function buildCatCount (opts) {
7171
options = {}
7272
}
7373

74+
// promises support
75+
if (callback == null) {
76+
return new Promise((resolve, reject) => {
77+
catCount(params, options, (err, body) => {
78+
err ? reject(err) : resolve(body)
79+
})
80+
})
81+
}
82+
7483
// check required parameters
7584
if (params.body != null) {
7685
return callback(

api/api/cat.fielddata.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatFielddata (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.fielddata](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html) request
29+
* Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-fielddata.html) request
3030
*
3131
* @param {list} fields - A comma-separated list of fields to return the fielddata size
3232
* @param {string} format - a short version of the Accept header, e.g. json, yaml
@@ -75,6 +75,15 @@ function buildCatFielddata (opts) {
7575
options = {}
7676
}
7777

78+
// promises support
79+
if (callback == null) {
80+
return new Promise((resolve, reject) => {
81+
catFielddata(params, options, (err, body) => {
82+
err ? reject(err) : resolve(body)
83+
})
84+
})
85+
}
86+
7887
// check required parameters
7988
if (params.body != null) {
8089
return callback(

api/api/cat.health.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatHealth (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html) request
29+
* Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-health.html) request
3030
*
3131
* @param {string} format - a short version of the Accept header, e.g. json, yaml
3232
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
@@ -72,6 +72,15 @@ function buildCatHealth (opts) {
7272
options = {}
7373
}
7474

75+
// promises support
76+
if (callback == null) {
77+
return new Promise((resolve, reject) => {
78+
catHealth(params, options, (err, body) => {
79+
err ? reject(err) : resolve(body)
80+
})
81+
})
82+
}
83+
7584
// check required parameters
7685
if (params.body != null) {
7786
return callback(

api/api/cat.help.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatHelp (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.help](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request
29+
* Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat.html) request
3030
*
3131
* @param {boolean} help - Return help information
3232
* @param {list} s - Comma-separated list of column names or column aliases to sort by
@@ -59,6 +59,15 @@ function buildCatHelp (opts) {
5959
options = {}
6060
}
6161

62+
// promises support
63+
if (callback == null) {
64+
return new Promise((resolve, reject) => {
65+
catHelp(params, options, (err, body) => {
66+
err ? reject(err) : resolve(body)
67+
})
68+
})
69+
}
70+
6271
// check required parameters
6372
if (params.body != null) {
6473
return callback(

api/api/cat.indices.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatIndices (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.indices](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html) request
29+
* Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-indices.html) request
3030
*
3131
* @param {list} index - A comma-separated list of index names to limit the returned information
3232
* @param {string} format - a short version of the Accept header, e.g. json, yaml
@@ -77,6 +77,15 @@ function buildCatIndices (opts) {
7777
options = {}
7878
}
7979

80+
// promises support
81+
if (callback == null) {
82+
return new Promise((resolve, reject) => {
83+
catIndices(params, options, (err, body) => {
84+
err ? reject(err) : resolve(body)
85+
})
86+
})
87+
}
88+
8089
// check required parameters
8190
if (params.body != null) {
8291
return callback(

api/api/cat.master.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatMaster (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.master](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html) request
29+
* Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-master.html) request
3030
*
3131
* @param {string} format - a short version of the Accept header, e.g. json, yaml
3232
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
@@ -70,6 +70,15 @@ function buildCatMaster (opts) {
7070
options = {}
7171
}
7272

73+
// promises support
74+
if (callback == null) {
75+
return new Promise((resolve, reject) => {
76+
catMaster(params, options, (err, body) => {
77+
err ? reject(err) : resolve(body)
78+
})
79+
})
80+
}
81+
7382
// check required parameters
7483
if (params.body != null) {
7584
return callback(

api/api/cat.nodeattrs.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatNodeattrs (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.nodeattrs](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html) request
29+
* Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-nodeattrs.html) request
3030
*
3131
* @param {string} format - a short version of the Accept header, e.g. json, yaml
3232
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
@@ -70,6 +70,15 @@ function buildCatNodeattrs (opts) {
7070
options = {}
7171
}
7272

73+
// promises support
74+
if (callback == null) {
75+
return new Promise((resolve, reject) => {
76+
catNodeattrs(params, options, (err, body) => {
77+
err ? reject(err) : resolve(body)
78+
})
79+
})
80+
}
81+
7382
// check required parameters
7483
if (params.body != null) {
7584
return callback(

api/api/cat.nodes.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatNodes (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.nodes](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html) request
29+
* Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-nodes.html) request
3030
*
3131
* @param {string} format - a short version of the Accept header, e.g. json, yaml
3232
* @param {boolean} full_id - Return the full node ID instead of the shortened version (default: false)
@@ -73,6 +73,15 @@ function buildCatNodes (opts) {
7373
options = {}
7474
}
7575

76+
// promises support
77+
if (callback == null) {
78+
return new Promise((resolve, reject) => {
79+
catNodes(params, options, (err, body) => {
80+
err ? reject(err) : resolve(body)
81+
})
82+
})
83+
}
84+
7685
// check required parameters
7786
if (params.body != null) {
7887
return callback(

api/api/cat.pending_tasks.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatPendingTasks (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.pending_tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html) request
29+
* Perform a [cat.pending_tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-pending-tasks.html) request
3030
*
3131
* @param {string} format - a short version of the Accept header, e.g. json, yaml
3232
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
@@ -70,6 +70,15 @@ function buildCatPendingTasks (opts) {
7070
options = {}
7171
}
7272

73+
// promises support
74+
if (callback == null) {
75+
return new Promise((resolve, reject) => {
76+
catPendingTasks(params, options, (err, body) => {
77+
err ? reject(err) : resolve(body)
78+
})
79+
})
80+
}
81+
7382
// check required parameters
7483
if (params.body != null) {
7584
return callback(

api/api/cat.plugins.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatPlugins (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.plugins](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html) request
29+
* Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-plugins.html) request
3030
*
3131
* @param {string} format - a short version of the Accept header, e.g. json, yaml
3232
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
@@ -70,6 +70,15 @@ function buildCatPlugins (opts) {
7070
options = {}
7171
}
7272

73+
// promises support
74+
if (callback == null) {
75+
return new Promise((resolve, reject) => {
76+
catPlugins(params, options, (err, body) => {
77+
err ? reject(err) : resolve(body)
78+
})
79+
})
80+
}
81+
7382
// check required parameters
7483
if (params.body != null) {
7584
return callback(

api/api/cat.recovery.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function buildCatRecovery (opts) {
2626
// eslint-disable-next-line no-unused-vars
2727
const { makeRequest, ConfigurationError, result } = opts
2828
/**
29-
* Perform a [cat.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html) request
29+
* Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-recovery.html) request
3030
*
3131
* @param {list} index - A comma-separated list of index names to limit the returned information
3232
* @param {string} format - a short version of the Accept header, e.g. json, yaml
@@ -71,6 +71,15 @@ function buildCatRecovery (opts) {
7171
options = {}
7272
}
7373

74+
// promises support
75+
if (callback == null) {
76+
return new Promise((resolve, reject) => {
77+
catRecovery(params, options, (err, body) => {
78+
err ? reject(err) : resolve(body)
79+
})
80+
})
81+
}
82+
7483
// check required parameters
7584
if (params.body != null) {
7685
return callback(

0 commit comments

Comments
 (0)