1010function 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
0 commit comments