Skip to content

Commit 5a7dac9

Browse files
committed
[API] Generate oss API code
1 parent 29d1f5e commit 5a7dac9

File tree

138 files changed

+799
-457
lines changed

Some content is hidden

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

138 files changed

+799
-457
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ module Actions
2020
# @option arguments [List] :_source_excludes Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
2121
# @option arguments [List] :_source_includes Default list of fields to extract and return from the _source field, can be overridden on each sub-request
2222
# @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with
23-
23+
# @option arguments [Hash] :headers Custom HTTP headers
2424
# @option arguments [Hash] :body The operation definition and data (action-data pairs), separated by newlines (*Required*)
2525
#
26-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/docs-bulk.html
26+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html
2727
#
2828
def bulk(arguments = {})
2929
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
3030

31+
headers = arguments.delete(:headers) || {}
32+
3133
arguments = arguments.clone
3234

3335
_index = arguments.delete(:index)
@@ -51,7 +53,8 @@ def bulk(arguments = {})
5153
payload = body
5254
end
5355

54-
perform_request(method, path, params, payload, { "Content-Type" => "application/x-ndjson" }).body
56+
headers.merge!("Content-Type" => "application/x-ndjson")
57+
perform_request(method, path, params, payload, headers).body
5558
end
5659

5760
# Register this action with its valid params when the module is loaded.

elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ module Actions
1818
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
1919
# (options: open,closed,hidden,none,all)
2020

21+
# @option arguments [Hash] :headers Custom HTTP headers
2122
#
22-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-alias.html
23+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html
2324
#
2425
def aliases(arguments = {})
26+
headers = arguments.delete(:headers) || {}
27+
2528
arguments = arguments.clone
2629

2730
_name = arguments.delete(:name)
@@ -31,12 +34,12 @@ def aliases(arguments = {})
3134
"_cat/aliases/#{Utils.__listify(_name)}"
3235
else
3336
"_cat/aliases"
34-
end
37+
end
3538
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
3639
params[:h] = Utils.__listify(params[:h]) if params[:h]
3740

3841
body = nil
39-
perform_request(method, path, params, body).body
42+
perform_request(method, path, params, body, headers).body
4043
end
4144

4245
# Register this action with its valid params when the module is loaded.

elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ module Actions
1919
# @option arguments [Boolean] :help Return help information
2020
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
2121
# @option arguments [Boolean] :v Verbose mode. Display column headers
22-
22+
# @option arguments [Hash] :headers Custom HTTP headers
2323
#
24-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-allocation.html
24+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html
2525
#
2626
def allocation(arguments = {})
27+
headers = arguments.delete(:headers) || {}
28+
2729
arguments = arguments.clone
2830

2931
_node_id = arguments.delete(:node_id)
@@ -33,12 +35,12 @@ def allocation(arguments = {})
3335
"_cat/allocation/#{Utils.__listify(_node_id)}"
3436
else
3537
"_cat/allocation"
36-
end
38+
end
3739
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
3840
params[:h] = Utils.__listify(params[:h]) if params[:h]
3941

4042
body = nil
41-
perform_request(method, path, params, body).body
43+
perform_request(method, path, params, body, headers).body
4244
end
4345

4446
# Register this action with its valid params when the module is loaded.

elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ module Actions
1414
# @option arguments [Boolean] :help Return help information
1515
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
1616
# @option arguments [Boolean] :v Verbose mode. Display column headers
17-
17+
# @option arguments [Hash] :headers Custom HTTP headers
1818
#
19-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-count.html
19+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html
2020
#
2121
def count(arguments = {})
22+
headers = arguments.delete(:headers) || {}
23+
2224
arguments = arguments.clone
2325

2426
_index = arguments.delete(:index)
@@ -28,12 +30,12 @@ def count(arguments = {})
2830
"_cat/count/#{Utils.__listify(_index)}"
2931
else
3032
"_cat/count"
31-
end
33+
end
3234
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
3335
params[:h] = Utils.__listify(params[:h]) if params[:h]
3436

3537
body = nil
36-
perform_request(method, path, params, body).body
38+
perform_request(method, path, params, body, headers).body
3739
end
3840

3941
# Register this action with its valid params when the module is loaded.

elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ module Actions
1818
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
1919
# @option arguments [Boolean] :v Verbose mode. Display column headers
2020
# @option arguments [List] :fields A comma-separated list of fields to return in the output
21-
21+
# @option arguments [Hash] :headers Custom HTTP headers
2222
#
23-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-fielddata.html
23+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html
2424
#
2525
def fielddata(arguments = {})
26+
headers = arguments.delete(:headers) || {}
27+
2628
arguments = arguments.clone
2729

2830
_fields = arguments.delete(:fields)
@@ -32,11 +34,11 @@ def fielddata(arguments = {})
3234
"_cat/fielddata/#{Utils.__listify(_fields)}"
3335
else
3436
"_cat/fielddata"
35-
end
37+
end
3638
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
3739

3840
body = nil
39-
perform_request(method, path, params, body).body
41+
perform_request(method, path, params, body, headers).body
4042
end
4143

4244
# Register this action with its valid params when the module is loaded.

elasticsearch-api/lib/elasticsearch/api/actions/cat/health.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ module Actions
1313
# @option arguments [Boolean] :help Return help information
1414
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
1515
# @option arguments [String] :time The unit in which to display time values
16-
# (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
16+
# (options: d,h,m,s,ms,micros,nanos)
1717

1818
# @option arguments [Boolean] :ts Set to false to disable timestamping
1919
# @option arguments [Boolean] :v Verbose mode. Display column headers
20-
20+
# @option arguments [Hash] :headers Custom HTTP headers
2121
#
22-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-health.html
22+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html
2323
#
2424
def health(arguments = {})
25+
headers = arguments.delete(:headers) || {}
26+
2527
arguments = arguments.clone
2628

2729
method = Elasticsearch::API::HTTP_GET
@@ -30,7 +32,7 @@ def health(arguments = {})
3032
params[:h] = Utils.__listify(params[:h]) if params[:h]
3133

3234
body = nil
33-
perform_request(method, path, params, body).body
35+
perform_request(method, path, params, body, headers).body
3436
end
3537

3638
# Register this action with its valid params when the module is loaded.

elasticsearch-api/lib/elasticsearch/api/actions/cat/help.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ module Actions
1010
#
1111
# @option arguments [Boolean] :help Return help information
1212
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
13-
13+
# @option arguments [Hash] :headers Custom HTTP headers
1414
#
15-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat.html
15+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html
1616
#
1717
def help(arguments = {})
18+
headers = arguments.delete(:headers) || {}
19+
1820
arguments = arguments.clone
1921

2022
method = Elasticsearch::API::HTTP_GET
2123
path = "_cat"
2224
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
2325

2426
body = nil
25-
perform_request(method, path, params, body).body
27+
perform_request(method, path, params, body, headers).body
2628
end
2729

2830
# Register this action with its valid params when the module is loaded.

elasticsearch-api/lib/elasticsearch/api/actions/cat/indices.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ module Actions
3030
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
3131
# (options: open,closed,hidden,none,all)
3232

33+
# @option arguments [Hash] :headers Custom HTTP headers
3334
#
34-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-indices.html
35+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html
3536
#
3637
def indices(arguments = {})
38+
headers = arguments.delete(:headers) || {}
39+
3740
arguments = arguments.clone
3841

3942
_index = arguments.delete(:index)
@@ -43,12 +46,12 @@ def indices(arguments = {})
4346
"_cat/indices/#{Utils.__listify(_index)}"
4447
else
4548
"_cat/indices"
46-
end
49+
end
4750
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4851
params[:h] = Utils.__listify(params[:h]) if params[:h]
4952

5053
body = nil
51-
perform_request(method, path, params, body).body
54+
perform_request(method, path, params, body, headers).body
5255
end
5356

5457
# Register this action with its valid params when the module is loaded.

elasticsearch-api/lib/elasticsearch/api/actions/cat/master.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ module Actions
1515
# @option arguments [Boolean] :help Return help information
1616
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
1717
# @option arguments [Boolean] :v Verbose mode. Display column headers
18-
18+
# @option arguments [Hash] :headers Custom HTTP headers
1919
#
20-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-master.html
20+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html
2121
#
2222
def master(arguments = {})
23+
headers = arguments.delete(:headers) || {}
24+
2325
arguments = arguments.clone
2426

2527
method = Elasticsearch::API::HTTP_GET
2628
path = "_cat/master"
2729
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
2830

2931
body = nil
30-
perform_request(method, path, params, body).body
32+
perform_request(method, path, params, body, headers).body
3133
end
3234

3335
# Register this action with its valid params when the module is loaded.

elasticsearch-api/lib/elasticsearch/api/actions/cat/nodeattrs.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ module Actions
1515
# @option arguments [Boolean] :help Return help information
1616
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
1717
# @option arguments [Boolean] :v Verbose mode. Display column headers
18-
18+
# @option arguments [Hash] :headers Custom HTTP headers
1919
#
20-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-nodeattrs.html
20+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html
2121
#
2222
def nodeattrs(arguments = {})
23+
headers = arguments.delete(:headers) || {}
24+
2325
arguments = arguments.clone
2426

2527
method = Elasticsearch::API::HTTP_GET
2628
path = "_cat/nodeattrs"
2729
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
2830

2931
body = nil
30-
perform_request(method, path, params, body).body
32+
perform_request(method, path, params, body, headers).body
3133
end
3234

3335
# Register this action with its valid params when the module is loaded.

0 commit comments

Comments
 (0)