Skip to content

Commit a649c17

Browse files
committed
Update code generation (#969)
* Updated code generation scripts to use the new spec * API generation * Fix bad link
1 parent 6d8544d commit a649c17

File tree

285 files changed

+3636
-3161
lines changed

Some content is hidden

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

285 files changed

+3636
-3161
lines changed

api/api/bulk.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
function buildBulk (opts) {
1111
// eslint-disable-next-line no-unused-vars
1212
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
13+
<<<<<<< HEAD
1314
/**
1415
* Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request
1516
*
@@ -26,6 +27,8 @@ function buildBulk (opts) {
2627
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
2728
* @param {object} body - The operation definition and data (action-data pairs), separated by newlines
2829
*/
30+
=======
31+
>>>>>>> 69247496... Update code generation (#969)
2932

3033
const acceptedQuerystring = [
3134
'wait_for_active_shards',
@@ -56,6 +59,11 @@ function buildBulk (opts) {
5659
filterPath: 'filter_path'
5760
}
5861

62+
/**
63+
* Perform a bulk request
64+
* Allows to perform multiple index/update/delete operations in a single request.
65+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html
66+
*/
5967
return function bulk (params, options, callback) {
6068
options = options || {}
6169
if (typeof options === 'function') {
@@ -90,10 +98,6 @@ function buildBulk (opts) {
9098
var { method, body, index, type, ...querystring } = params
9199
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
92100

93-
if (method == null) {
94-
method = 'POST'
95-
}
96-
97101
var ignore = options.ignore
98102
if (typeof ignore === 'number') {
99103
options.ignore = [ignore]
@@ -102,10 +106,13 @@ function buildBulk (opts) {
102106
var path = ''
103107

104108
if ((index) != null && (type) != null) {
109+
if (method == null) method = 'POST'
105110
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'
106111
} else if ((index) != null) {
112+
if (method == null) method = 'POST'
107113
path = '/' + encodeURIComponent(index) + '/' + '_bulk'
108114
} else {
115+
if (method == null) method = 'POST'
109116
path = '/' + '_bulk'
110117
}
111118

api/api/cat.aliases.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
function buildCatAliases (opts) {
1111
// eslint-disable-next-line no-unused-vars
1212
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
13+
<<<<<<< HEAD
1314
/**
1415
* Perform a [cat.aliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html) request
1516
*
@@ -22,6 +23,8 @@ function buildCatAliases (opts) {
2223
* @param {list} s - Comma-separated list of column names or column aliases to sort by
2324
* @param {boolean} v - Verbose mode. Display column headers
2425
*/
26+
=======
27+
>>>>>>> 69247496... Update code generation (#969)
2528

2629
const acceptedQuerystring = [
2730
'format',
@@ -44,6 +47,11 @@ function buildCatAliases (opts) {
4447
filterPath: 'filter_path'
4548
}
4649

50+
/**
51+
* Perform a cat.aliases request
52+
* Shows information about currently configured aliases to indices including filter and routing infos.
53+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html
54+
*/
4755
return function catAliases (params, options, callback) {
4856
options = options || {}
4957
if (typeof options === 'function') {
@@ -56,12 +64,6 @@ function buildCatAliases (opts) {
5664
options = {}
5765
}
5866

59-
// check required parameters
60-
if (params.body != null) {
61-
const err = new ConfigurationError('This API does not require a body')
62-
return handleError(err, callback)
63-
}
64-
6567
// validate headers object
6668
if (options.headers != null && typeof options.headers !== 'object') {
6769
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
@@ -72,10 +74,6 @@ function buildCatAliases (opts) {
7274
var { method, body, name, ...querystring } = params
7375
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
7476

75-
if (method == null) {
76-
method = 'GET'
77-
}
78-
7977
var ignore = options.ignore
8078
if (typeof ignore === 'number') {
8179
options.ignore = [ignore]
@@ -84,8 +82,10 @@ function buildCatAliases (opts) {
8482
var path = ''
8583

8684
if ((name) != null) {
85+
if (method == null) method = 'GET'
8786
path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
8887
} else {
88+
if (method == null) method = 'GET'
8989
path = '/' + '_cat' + '/' + 'aliases'
9090
}
9191

api/api/cat.allocation.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
function buildCatAllocation (opts) {
1111
// eslint-disable-next-line no-unused-vars
1212
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
13+
<<<<<<< HEAD
1314
/**
1415
* Perform a [cat.allocation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request
1516
*
@@ -23,6 +24,8 @@ function buildCatAllocation (opts) {
2324
* @param {list} s - Comma-separated list of column names or column aliases to sort by
2425
* @param {boolean} v - Verbose mode. Display column headers
2526
*/
27+
=======
28+
>>>>>>> 69247496... Update code generation (#969)
2629

2730
const acceptedQuerystring = [
2831
'format',
@@ -46,6 +49,11 @@ function buildCatAllocation (opts) {
4649
filterPath: 'filter_path'
4750
}
4851

52+
/**
53+
* Perform a cat.allocation request
54+
* Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using.
55+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html
56+
*/
4957
return function catAllocation (params, options, callback) {
5058
options = options || {}
5159
if (typeof options === 'function') {
@@ -58,12 +66,6 @@ function buildCatAllocation (opts) {
5866
options = {}
5967
}
6068

61-
// check required parameters
62-
if (params.body != null) {
63-
const err = new ConfigurationError('This API does not require a body')
64-
return handleError(err, callback)
65-
}
66-
6769
// validate headers object
6870
if (options.headers != null && typeof options.headers !== 'object') {
6971
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
@@ -74,10 +76,6 @@ function buildCatAllocation (opts) {
7476
var { method, body, nodeId, node_id, ...querystring } = params
7577
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
7678

77-
if (method == null) {
78-
method = 'GET'
79-
}
80-
8179
var ignore = options.ignore
8280
if (typeof ignore === 'number') {
8381
options.ignore = [ignore]
@@ -86,8 +84,10 @@ function buildCatAllocation (opts) {
8684
var path = ''
8785

8886
if ((node_id || nodeId) != null) {
87+
if (method == null) method = 'GET'
8988
path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
9089
} else {
90+
if (method == null) method = 'GET'
9191
path = '/' + '_cat' + '/' + 'allocation'
9292
}
9393

api/api/cat.count.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
function buildCatCount (opts) {
1111
// eslint-disable-next-line no-unused-vars
1212
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
13+
<<<<<<< HEAD
1314
/**
1415
* Perform a [cat.count](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request
1516
*
@@ -22,6 +23,8 @@ function buildCatCount (opts) {
2223
* @param {list} s - Comma-separated list of column names or column aliases to sort by
2324
* @param {boolean} v - Verbose mode. Display column headers
2425
*/
26+
=======
27+
>>>>>>> 69247496... Update code generation (#969)
2528

2629
const acceptedQuerystring = [
2730
'format',
@@ -44,6 +47,11 @@ function buildCatCount (opts) {
4447
filterPath: 'filter_path'
4548
}
4649

50+
/**
51+
* Perform a cat.count request
52+
* Provides quick access to the document count of the entire cluster, or individual indices.
53+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html
54+
*/
4755
return function catCount (params, options, callback) {
4856
options = options || {}
4957
if (typeof options === 'function') {
@@ -56,12 +64,6 @@ function buildCatCount (opts) {
5664
options = {}
5765
}
5866

59-
// check required parameters
60-
if (params.body != null) {
61-
const err = new ConfigurationError('This API does not require a body')
62-
return handleError(err, callback)
63-
}
64-
6567
// validate headers object
6668
if (options.headers != null && typeof options.headers !== 'object') {
6769
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
@@ -72,10 +74,6 @@ function buildCatCount (opts) {
7274
var { method, body, index, ...querystring } = params
7375
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
7476

75-
if (method == null) {
76-
method = 'GET'
77-
}
78-
7977
var ignore = options.ignore
8078
if (typeof ignore === 'number') {
8179
options.ignore = [ignore]
@@ -84,8 +82,10 @@ function buildCatCount (opts) {
8482
var path = ''
8583

8684
if ((index) != null) {
85+
if (method == null) method = 'GET'
8786
path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
8887
} else {
88+
if (method == null) method = 'GET'
8989
path = '/' + '_cat' + '/' + 'count'
9090
}
9191

api/api/cat.fielddata.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
function buildCatFielddata (opts) {
1111
// eslint-disable-next-line no-unused-vars
1212
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
13+
<<<<<<< HEAD
1314
/**
1415
* Perform a [cat.fielddata](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html) request
1516
*
@@ -24,6 +25,8 @@ function buildCatFielddata (opts) {
2425
* @param {boolean} v - Verbose mode. Display column headers
2526
* @param {list} fields - A comma-separated list of fields to return in the output
2627
*/
28+
=======
29+
>>>>>>> 69247496... Update code generation (#969)
2730

2831
const acceptedQuerystring = [
2932
'format',
@@ -48,6 +51,11 @@ function buildCatFielddata (opts) {
4851
filterPath: 'filter_path'
4952
}
5053

54+
/**
55+
* Perform a cat.fielddata request
56+
* Shows how much heap memory is currently being used by fielddata on every data node in the cluster.
57+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html
58+
*/
5159
return function catFielddata (params, options, callback) {
5260
options = options || {}
5361
if (typeof options === 'function') {
@@ -60,12 +68,6 @@ function buildCatFielddata (opts) {
6068
options = {}
6169
}
6270

63-
// check required parameters
64-
if (params.body != null) {
65-
const err = new ConfigurationError('This API does not require a body')
66-
return handleError(err, callback)
67-
}
68-
6971
// validate headers object
7072
if (options.headers != null && typeof options.headers !== 'object') {
7173
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
@@ -76,10 +78,6 @@ function buildCatFielddata (opts) {
7678
var { method, body, fields, ...querystring } = params
7779
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
7880

79-
if (method == null) {
80-
method = 'GET'
81-
}
82-
8381
var ignore = options.ignore
8482
if (typeof ignore === 'number') {
8583
options.ignore = [ignore]
@@ -88,8 +86,10 @@ function buildCatFielddata (opts) {
8886
var path = ''
8987

9088
if ((fields) != null) {
89+
if (method == null) method = 'GET'
9190
path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
9291
} else {
92+
if (method == null) method = 'GET'
9393
path = '/' + '_cat' + '/' + 'fielddata'
9494
}
9595

api/api/cat.health.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
function buildCatHealth (opts) {
1111
// eslint-disable-next-line no-unused-vars
1212
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
13+
<<<<<<< HEAD
1314
/**
1415
* Perform a [cat.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html) request
1516
*
@@ -22,6 +23,8 @@ function buildCatHealth (opts) {
2223
* @param {boolean} ts - Set to false to disable timestamping
2324
* @param {boolean} v - Verbose mode. Display column headers
2425
*/
26+
=======
27+
>>>>>>> 69247496... Update code generation (#969)
2528

2629
const acceptedQuerystring = [
2730
'format',
@@ -45,6 +48,11 @@ function buildCatHealth (opts) {
4548
filterPath: 'filter_path'
4649
}
4750

51+
/**
52+
* Perform a cat.health request
53+
* Returns a concise representation of the cluster health.
54+
* https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html
55+
*/
4856
return function catHealth (params, options, callback) {
4957
options = options || {}
5058
if (typeof options === 'function') {
@@ -57,12 +65,6 @@ function buildCatHealth (opts) {
5765
options = {}
5866
}
5967

60-
// check required parameters
61-
if (params.body != null) {
62-
const err = new ConfigurationError('This API does not require a body')
63-
return handleError(err, callback)
64-
}
65-
6668
// validate headers object
6769
if (options.headers != null && typeof options.headers !== 'object') {
6870
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
@@ -73,17 +75,14 @@ function buildCatHealth (opts) {
7375
var { method, body, ...querystring } = params
7476
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
7577

76-
if (method == null) {
77-
method = 'GET'
78-
}
79-
8078
var ignore = options.ignore
8179
if (typeof ignore === 'number') {
8280
options.ignore = [ignore]
8381
}
8482

8583
var path = ''
8684

85+
if (method == null) method = 'GET'
8786
path = '/' + '_cat' + '/' + 'health'
8887

8988
// build request object

0 commit comments

Comments
 (0)