Skip to content

Commit d6bb5f7

Browse files
committed
Generate code using new template with additional perform_request arg
1 parent 56f642e commit d6bb5f7

File tree

460 files changed

+3493
-473
lines changed

Some content is hidden

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

460 files changed

+3493
-473
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/async_search/delete.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ module Actions
3030
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
3131
#
3232
def delete(arguments = {})
33+
request_opts = { endpoint: arguments[:endpoint] || "async_search.delete" }
34+
35+
defined_params = [:id].inject({}) do |set_variables, variable|
36+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
37+
set_variables
38+
end
39+
request_opts[:defined_params] = defined_params unless defined_params.empty?
40+
3341
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
3442

3543
arguments = arguments.clone
@@ -44,7 +52,7 @@ def delete(arguments = {})
4452
params = {}
4553

4654
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers)
55+
perform_request(method, path, params, body, headers, request_opts)
4856
)
4957
end
5058
end

elasticsearch-api/lib/elasticsearch/api/actions/async_search/get.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ module Actions
3333
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
3434
#
3535
def get(arguments = {})
36+
request_opts = { endpoint: arguments[:endpoint] || "async_search.get" }
37+
38+
defined_params = [:id].inject({}) do |set_variables, variable|
39+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
40+
set_variables
41+
end
42+
request_opts[:defined_params] = defined_params unless defined_params.empty?
43+
3644
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
3745

3846
arguments = arguments.clone
@@ -47,7 +55,7 @@ def get(arguments = {})
4755
params = Utils.process_params(arguments)
4856

4957
Elasticsearch::API::Response.new(
50-
perform_request(method, path, params, body, headers)
58+
perform_request(method, path, params, body, headers, request_opts)
5159
)
5260
end
5361
end

elasticsearch-api/lib/elasticsearch/api/actions/async_search/status.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ module Actions
3030
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
3131
#
3232
def status(arguments = {})
33+
request_opts = { endpoint: arguments[:endpoint] || "async_search.status" }
34+
35+
defined_params = [:id].inject({}) do |set_variables, variable|
36+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
37+
set_variables
38+
end
39+
request_opts[:defined_params] = defined_params unless defined_params.empty?
40+
3341
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
3442

3543
arguments = arguments.clone
@@ -44,7 +52,7 @@ def status(arguments = {})
4452
params = {}
4553

4654
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers)
55+
perform_request(method, path, params, body, headers, request_opts)
4856
)
4957
end
5058
end

elasticsearch-api/lib/elasticsearch/api/actions/async_search/submit.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ module Actions
7272
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
7373
#
7474
def submit(arguments = {})
75+
request_opts = { endpoint: arguments[:endpoint] || "async_search.submit" }
76+
77+
defined_params = [:index].inject({}) do |set_variables, variable|
78+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
79+
set_variables
80+
end
81+
request_opts[:defined_params] = defined_params unless defined_params.empty?
82+
7583
arguments = arguments.clone
7684
headers = arguments.delete(:headers) || {}
7785

@@ -88,7 +96,7 @@ def submit(arguments = {})
8896
params = Utils.process_params(arguments)
8997

9098
Elasticsearch::API::Response.new(
91-
perform_request(method, path, params, body, headers)
99+
perform_request(method, path, params, body, headers, request_opts)
92100
)
93101
end
94102
end

elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ module Actions
3030
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html
3131
#
3232
def delete_autoscaling_policy(arguments = {})
33+
request_opts = { endpoint: arguments[:endpoint] || "autoscaling.delete_autoscaling_policy" }
34+
35+
defined_params = [:name].inject({}) do |set_variables, variable|
36+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
37+
set_variables
38+
end
39+
request_opts[:defined_params] = defined_params unless defined_params.empty?
40+
3341
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
3442

3543
arguments = arguments.clone
@@ -44,7 +52,7 @@ def delete_autoscaling_policy(arguments = {})
4452
params = {}
4553

4654
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers)
55+
perform_request(method, path, params, body, headers, request_opts)
4856
)
4957
end
5058
end

elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module Actions
2929
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html
3030
#
3131
def get_autoscaling_capacity(arguments = {})
32+
request_opts = { endpoint: arguments[:endpoint] || "autoscaling.get_autoscaling_capacity" }
33+
3234
arguments = arguments.clone
3335
headers = arguments.delete(:headers) || {}
3436

@@ -39,7 +41,7 @@ def get_autoscaling_capacity(arguments = {})
3941
params = {}
4042

4143
Elasticsearch::API::Response.new(
42-
perform_request(method, path, params, body, headers)
44+
perform_request(method, path, params, body, headers, request_opts)
4345
)
4446
end
4547
end

elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ module Actions
3030
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html
3131
#
3232
def get_autoscaling_policy(arguments = {})
33+
request_opts = { endpoint: arguments[:endpoint] || "autoscaling.get_autoscaling_policy" }
34+
35+
defined_params = [:name].inject({}) do |set_variables, variable|
36+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
37+
set_variables
38+
end
39+
request_opts[:defined_params] = defined_params unless defined_params.empty?
40+
3341
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
3442

3543
arguments = arguments.clone
@@ -44,7 +52,7 @@ def get_autoscaling_policy(arguments = {})
4452
params = {}
4553

4654
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers)
55+
perform_request(method, path, params, body, headers, request_opts)
4856
)
4957
end
5058
end

elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ module Actions
3131
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html
3232
#
3333
def put_autoscaling_policy(arguments = {})
34+
request_opts = { endpoint: arguments[:endpoint] || "autoscaling.put_autoscaling_policy" }
35+
36+
defined_params = [:name].inject({}) do |set_variables, variable|
37+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
38+
set_variables
39+
end
40+
request_opts[:defined_params] = defined_params unless defined_params.empty?
41+
3442
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
3543
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
3644

@@ -46,7 +54,7 @@ def put_autoscaling_policy(arguments = {})
4654
params = {}
4755

4856
Elasticsearch::API::Response.new(
49-
perform_request(method, path, params, body, headers)
57+
perform_request(method, path, params, body, headers, request_opts)
5058
)
5159
end
5260
end

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ module Actions
4141
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
4242
#
4343
def bulk(arguments = {})
44+
request_opts = { endpoint: arguments[:endpoint] || "bulk" }
45+
46+
defined_params = [:index].inject({}) do |set_variables, variable|
47+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
48+
set_variables
49+
end
50+
request_opts[:defined_params] = defined_params unless defined_params.empty?
51+
4452
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
4553

4654
arguments = arguments.clone
@@ -66,7 +74,7 @@ def bulk(arguments = {})
6674

6775
headers.merge!("Content-Type" => "application/x-ndjson")
6876
Elasticsearch::API::Response.new(
69-
perform_request(method, path, params, payload, headers)
77+
perform_request(method, path, params, payload, headers, request_opts)
7078
)
7179
end
7280
end

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ module Actions
3737
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html
3838
#
3939
def aliases(arguments = {})
40+
request_opts = { endpoint: arguments[:endpoint] || "cat.aliases" }
41+
42+
defined_params = [:name].inject({}) do |set_variables, variable|
43+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
44+
set_variables
45+
end
46+
request_opts[:defined_params] = defined_params unless defined_params.empty?
47+
4048
arguments = arguments.clone
4149
headers = arguments.delete(:headers) || {}
4250

@@ -54,7 +62,7 @@ def aliases(arguments = {})
5462
params[:h] = Utils.__listify(params[:h]) if params[:h]
5563

5664
Elasticsearch::API::Response.new(
57-
perform_request(method, path, params, body, headers)
65+
perform_request(method, path, params, body, headers, request_opts)
5866
)
5967
end
6068
end

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ module Actions
3838
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html
3939
#
4040
def allocation(arguments = {})
41+
request_opts = { endpoint: arguments[:endpoint] || "cat.allocation" }
42+
43+
defined_params = [:node_id].inject({}) do |set_variables, variable|
44+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
45+
set_variables
46+
end
47+
request_opts[:defined_params] = defined_params unless defined_params.empty?
48+
4149
arguments = arguments.clone
4250
headers = arguments.delete(:headers) || {}
4351

@@ -55,7 +63,7 @@ def allocation(arguments = {})
5563
params[:h] = Utils.__listify(params[:h]) if params[:h]
5664

5765
Elasticsearch::API::Response.new(
58-
perform_request(method, path, params, body, headers)
66+
perform_request(method, path, params, body, headers, request_opts)
5967
)
6068
end
6169
end

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ module Actions
3737
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-component-templates.html
3838
#
3939
def component_templates(arguments = {})
40+
request_opts = { endpoint: arguments[:endpoint] || "cat.component_templates" }
41+
42+
defined_params = [:name].inject({}) do |set_variables, variable|
43+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
44+
set_variables
45+
end
46+
request_opts[:defined_params] = defined_params unless defined_params.empty?
47+
4048
arguments = arguments.clone
4149
headers = arguments.delete(:headers) || {}
4250

@@ -53,7 +61,7 @@ def component_templates(arguments = {})
5361
params = Utils.process_params(arguments)
5462

5563
Elasticsearch::API::Response.new(
56-
perform_request(method, path, params, body, headers)
64+
perform_request(method, path, params, body, headers, request_opts)
5765
)
5866
end
5967
end

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ module Actions
3535
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html
3636
#
3737
def count(arguments = {})
38+
request_opts = { endpoint: arguments[:endpoint] || "cat.count" }
39+
40+
defined_params = [:index].inject({}) do |set_variables, variable|
41+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
42+
set_variables
43+
end
44+
request_opts[:defined_params] = defined_params unless defined_params.empty?
45+
3846
arguments = arguments.clone
3947
headers = arguments.delete(:headers) || {}
4048

@@ -52,7 +60,7 @@ def count(arguments = {})
5260
params[:h] = Utils.__listify(params[:h]) if params[:h]
5361

5462
Elasticsearch::API::Response.new(
55-
perform_request(method, path, params, body, headers)
63+
perform_request(method, path, params, body, headers, request_opts)
5664
)
5765
end
5866
end

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ module Actions
3636
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html
3737
#
3838
def fielddata(arguments = {})
39+
request_opts = { endpoint: arguments[:endpoint] || "cat.fielddata" }
40+
41+
defined_params = [:fields].inject({}) do |set_variables, variable|
42+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
43+
set_variables
44+
end
45+
request_opts[:defined_params] = defined_params unless defined_params.empty?
46+
3947
arguments = arguments.clone
4048
headers = arguments.delete(:headers) || {}
4149

@@ -52,7 +60,7 @@ def fielddata(arguments = {})
5260
params = Utils.process_params(arguments)
5361

5462
Elasticsearch::API::Response.new(
55-
perform_request(method, path, params, body, headers)
63+
perform_request(method, path, params, body, headers, request_opts)
5664
)
5765
end
5866
end

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ module Actions
3636
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-health.html
3737
#
3838
def health(arguments = {})
39+
request_opts = { endpoint: arguments[:endpoint] || "cat.health" }
40+
3941
arguments = arguments.clone
4042
headers = arguments.delete(:headers) || {}
4143

@@ -47,7 +49,7 @@ def health(arguments = {})
4749
params[:h] = Utils.__listify(params[:h]) if params[:h]
4850

4951
Elasticsearch::API::Response.new(
50-
perform_request(method, path, params, body, headers)
52+
perform_request(method, path, params, body, headers, request_opts)
5153
)
5254
end
5355
end

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ module Actions
3131
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html
3232
#
3333
def help(arguments = {})
34+
request_opts = { endpoint: arguments[:endpoint] || "cat.help" }
35+
3436
arguments = arguments.clone
3537
headers = arguments.delete(:headers) || {}
3638

@@ -41,7 +43,7 @@ def help(arguments = {})
4143
params = Utils.process_params(arguments)
4244

4345
Elasticsearch::API::Response.new(
44-
perform_request(method, path, params, body, headers)
46+
perform_request(method, path, params, body, headers, request_opts)
4547
)
4648
end
4749
end

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ module Actions
4242
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html
4343
#
4444
def indices(arguments = {})
45+
request_opts = { endpoint: arguments[:endpoint] || "cat.indices" }
46+
47+
defined_params = [:index].inject({}) do |set_variables, variable|
48+
set_variables[variable] = arguments[variable] if arguments.key?(variable)
49+
set_variables
50+
end
51+
request_opts[:defined_params] = defined_params unless defined_params.empty?
52+
4553
arguments = arguments.clone
4654
headers = arguments.delete(:headers) || {}
4755

@@ -59,7 +67,7 @@ def indices(arguments = {})
5967
params[:h] = Utils.__listify(params[:h]) if params[:h]
6068

6169
Elasticsearch::API::Response.new(
62-
perform_request(method, path, params, body, headers)
70+
perform_request(method, path, params, body, headers, request_opts)
6371
)
6472
end
6573
end

0 commit comments

Comments
 (0)