Skip to content

Commit 65e080d

Browse files
committed
Update perform_request method signature to use opts hash
1 parent eba5384 commit 65e080d

File tree

468 files changed

+1333
-1314
lines changed

Some content is hidden

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

468 files changed

+1333
-1314
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Actions
2727
# @option arguments [String] :id The async search ID
2828
# @option arguments [Hash] :headers Custom HTTP headers
2929
#
30-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/async-search.html
30+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
3131
#
3232
def delete(arguments = {})
3333
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -44,7 +44,8 @@ def delete(arguments = {})
4444
params = {}
4545

4646
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers, ["/_async_search/{id}"], 'async_search.delete')
47+
perform_request(method, path, params, body, headers,
48+
{ :path_templates => ["/_async_search/{id}"], :endpoint => 'async_search.delete' })
4849
)
4950
end
5051
end

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module Actions
3030
# @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response
3131
# @option arguments [Hash] :headers Custom HTTP headers
3232
#
33-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/async-search.html
33+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
3434
#
3535
def get(arguments = {})
3636
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -47,7 +47,8 @@ def get(arguments = {})
4747
params = Utils.process_params(arguments)
4848

4949
Elasticsearch::API::Response.new(
50-
perform_request(method, path, params, body, headers, ["/_async_search/{id}"], 'async_search.get')
50+
perform_request(method, path, params, body, headers,
51+
{ :path_templates => ["/_async_search/{id}"], :endpoint => 'async_search.get' })
5152
)
5253
end
5354
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Actions
2727
# @option arguments [String] :id The async search ID
2828
# @option arguments [Hash] :headers Custom HTTP headers
2929
#
30-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/async-search.html
30+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
3131
#
3232
def status(arguments = {})
3333
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -44,8 +44,8 @@ def status(arguments = {})
4444
params = {}
4545

4646
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers, ["/_async_search/status/{id}"],
48-
'async_search.status')
47+
perform_request(method, path, params, body, headers,
48+
{ :path_templates => ["/_async_search/status/{id}"], :endpoint => 'async_search.status' })
4949
)
5050
end
5151
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ module Actions
6969
# @option arguments [Hash] :headers Custom HTTP headers
7070
# @option arguments [Hash] :body The search definition using the Query DSL
7171
#
72-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/async-search.html
72+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
7373
#
7474
def submit(arguments = {})
7575
arguments = arguments.clone
@@ -88,8 +88,8 @@ def submit(arguments = {})
8888
params = Utils.process_params(arguments)
8989

9090
Elasticsearch::API::Response.new(
91-
perform_request(method, path, params, body, headers, ["/_async_search", "/{index}/_async_search"],
92-
'async_search.submit')
91+
perform_request(method, path, params, body, headers,
92+
{ :path_templates => ["/_async_search", "/{index}/_async_search"], :endpoint => 'async_search.submit' })
9393
)
9494
end
9595
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Actions
2727
# @option arguments [String] :name the name of the autoscaling policy
2828
# @option arguments [Hash] :headers Custom HTTP headers
2929
#
30-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/autoscaling-delete-autoscaling-policy.html
30+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html
3131
#
3232
def delete_autoscaling_policy(arguments = {})
3333
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
@@ -44,8 +44,8 @@ def delete_autoscaling_policy(arguments = {})
4444
params = {}
4545

4646
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers, ["/_autoscaling/policy/{name}"],
48-
'autoscaling.delete_autoscaling_policy')
47+
perform_request(method, path, params, body, headers,
48+
{ :path_templates => ["/_autoscaling/policy/{name}"], :endpoint => 'autoscaling.delete_autoscaling_policy' })
4949
)
5050
end
5151
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module Actions
2626
#
2727
# @option arguments [Hash] :headers Custom HTTP headers
2828
#
29-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/autoscaling-get-autoscaling-capacity.html
29+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html
3030
#
3131
def get_autoscaling_capacity(arguments = {})
3232
arguments = arguments.clone
@@ -39,8 +39,8 @@ def get_autoscaling_capacity(arguments = {})
3939
params = {}
4040

4141
Elasticsearch::API::Response.new(
42-
perform_request(method, path, params, body, headers, ["/_autoscaling/capacity"],
43-
'autoscaling.get_autoscaling_capacity')
42+
perform_request(method, path, params, body, headers,
43+
{ :path_templates => ["/_autoscaling/capacity"], :endpoint => 'autoscaling.get_autoscaling_capacity' })
4444
)
4545
end
4646
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Actions
2727
# @option arguments [String] :name the name of the autoscaling policy
2828
# @option arguments [Hash] :headers Custom HTTP headers
2929
#
30-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/autoscaling-get-autoscaling-policy.html
30+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html
3131
#
3232
def get_autoscaling_policy(arguments = {})
3333
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
@@ -44,8 +44,8 @@ def get_autoscaling_policy(arguments = {})
4444
params = {}
4545

4646
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers, ["/_autoscaling/policy/{name}"],
48-
'autoscaling.get_autoscaling_policy')
47+
perform_request(method, path, params, body, headers,
48+
{ :path_templates => ["/_autoscaling/policy/{name}"], :endpoint => 'autoscaling.get_autoscaling_policy' })
4949
)
5050
end
5151
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module Actions
2828
# @option arguments [Hash] :headers Custom HTTP headers
2929
# @option arguments [Hash] :body the specification of the autoscaling policy (*Required*)
3030
#
31-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/autoscaling-put-autoscaling-policy.html
31+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html
3232
#
3333
def put_autoscaling_policy(arguments = {})
3434
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
@@ -46,8 +46,8 @@ def put_autoscaling_policy(arguments = {})
4646
params = {}
4747

4848
Elasticsearch::API::Response.new(
49-
perform_request(method, path, params, body, headers, ["/_autoscaling/policy/{name}"],
50-
'autoscaling.put_autoscaling_policy')
49+
perform_request(method, path, params, body, headers,
50+
{ :path_templates => ["/_autoscaling/policy/{name}"], :endpoint => 'autoscaling.put_autoscaling_policy' })
5151
)
5252
end
5353
end

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module Actions
3838
# @option arguments [String|Array] :body The operation definition and data (action-data pairs), separated by newlines. Array of Strings, Header/Data pairs,
3939
# or the conveniency "combined" format can be passed, refer to Elasticsearch::API::Utils.__bulkify documentation.
4040
#
41-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/docs-bulk.html
41+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
4242
#
4343
def bulk(arguments = {})
4444
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
@@ -66,7 +66,8 @@ def bulk(arguments = {})
6666

6767
headers.merge!("Content-Type" => "application/x-ndjson")
6868
Elasticsearch::API::Response.new(
69-
perform_request(method, path, params, payload, headers, ["/_bulk", "/{index}/_bulk"], 'bulk')
69+
perform_request(method, path, params, payload, headers,
70+
{ :path_templates => ["/_bulk", "/{index}/_bulk"], :endpoint => 'bulk' })
7071
)
7172
end
7273
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module Actions
3434
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
3535
# @option arguments [Hash] :headers Custom HTTP headers
3636
#
37-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-alias.html
37+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html
3838
#
3939
def aliases(arguments = {})
4040
arguments = arguments.clone
@@ -54,8 +54,8 @@ def aliases(arguments = {})
5454
params[:h] = Utils.__listify(params[:h]) if params[:h]
5555

5656
Elasticsearch::API::Response.new(
57-
perform_request(method, path, params, body, headers, ["/_cat/aliases", "/_cat/aliases/{name}"],
58-
'cat.aliases')
57+
perform_request(method, path, params, body, headers,
58+
{ :path_templates => ["/_cat/aliases", "/_cat/aliases/{name}"], :endpoint => 'cat.aliases' })
5959
)
6060
end
6161
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module Actions
3535
# @option arguments [Boolean] :v Verbose mode. Display column headers
3636
# @option arguments [Hash] :headers Custom HTTP headers
3737
#
38-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-allocation.html
38+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html
3939
#
4040
def allocation(arguments = {})
4141
arguments = arguments.clone
@@ -55,8 +55,8 @@ def allocation(arguments = {})
5555
params[:h] = Utils.__listify(params[:h]) if params[:h]
5656

5757
Elasticsearch::API::Response.new(
58-
perform_request(method, path, params, body, headers, ["/_cat/allocation", "/_cat/allocation/{node_id}"],
59-
'cat.allocation')
58+
perform_request(method, path, params, body, headers,
59+
{ :path_templates => ["/_cat/allocation", "/_cat/allocation/{node_id}"], :endpoint => 'cat.allocation' })
6060
)
6161
end
6262
end

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module Actions
3434
# @option arguments [Boolean] :v Verbose mode. Display column headers
3535
# @option arguments [Hash] :headers Custom HTTP headers
3636
#
37-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-component-templates.html
37+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-component-templates.html
3838
#
3939
def component_templates(arguments = {})
4040
arguments = arguments.clone
@@ -54,7 +54,7 @@ def component_templates(arguments = {})
5454

5555
Elasticsearch::API::Response.new(
5656
perform_request(method, path, params, body, headers,
57-
["/_cat/component_templates", "/_cat/component_templates/{name}"], 'cat.component_templates')
57+
{ :path_templates => ["/_cat/component_templates", "/_cat/component_templates/{name}"], :endpoint => 'cat.component_templates' })
5858
)
5959
end
6060
end

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module Actions
3232
# @option arguments [Boolean] :v Verbose mode. Display column headers
3333
# @option arguments [Hash] :headers Custom HTTP headers
3434
#
35-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-count.html
35+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html
3636
#
3737
def count(arguments = {})
3838
arguments = arguments.clone
@@ -52,7 +52,8 @@ def count(arguments = {})
5252
params[:h] = Utils.__listify(params[:h]) if params[:h]
5353

5454
Elasticsearch::API::Response.new(
55-
perform_request(method, path, params, body, headers, ["/_cat/count", "/_cat/count/{index}"], 'cat.count')
55+
perform_request(method, path, params, body, headers,
56+
{ :path_templates => ["/_cat/count", "/_cat/count/{index}"], :endpoint => 'cat.count' })
5657
)
5758
end
5859
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module Actions
3333
# @option arguments [Boolean] :v Verbose mode. Display column headers
3434
# @option arguments [Hash] :headers Custom HTTP headers
3535
#
36-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-fielddata.html
36+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html
3737
#
3838
def fielddata(arguments = {})
3939
arguments = arguments.clone
@@ -52,8 +52,8 @@ def fielddata(arguments = {})
5252
params = Utils.process_params(arguments)
5353

5454
Elasticsearch::API::Response.new(
55-
perform_request(method, path, params, body, headers, ["/_cat/fielddata", "/_cat/fielddata/{fields}"],
56-
'cat.fielddata')
55+
perform_request(method, path, params, body, headers,
56+
{ :path_templates => ["/_cat/fielddata", "/_cat/fielddata/{fields}"], :endpoint => 'cat.fielddata' })
5757
)
5858
end
5959
end

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module Actions
3333
# @option arguments [Boolean] :v Verbose mode. Display column headers
3434
# @option arguments [Hash] :headers Custom HTTP headers
3535
#
36-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-health.html
36+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-health.html
3737
#
3838
def health(arguments = {})
3939
arguments = arguments.clone
@@ -47,7 +47,8 @@ def health(arguments = {})
4747
params[:h] = Utils.__listify(params[:h]) if params[:h]
4848

4949
Elasticsearch::API::Response.new(
50-
perform_request(method, path, params, body, headers, ["/_cat/health"], 'cat.health')
50+
perform_request(method, path, params, body, headers,
51+
{ :path_templates => ["/_cat/health"], :endpoint => 'cat.health' })
5152
)
5253
end
5354
end

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module Actions
2828
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
2929
# @option arguments [Hash] :headers Custom HTTP headers
3030
#
31-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat.html
31+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html
3232
#
3333
def help(arguments = {})
3434
arguments = arguments.clone
@@ -41,7 +41,8 @@ def help(arguments = {})
4141
params = Utils.process_params(arguments)
4242

4343
Elasticsearch::API::Response.new(
44-
perform_request(method, path, params, body, headers, ["/_cat"], 'cat.help')
44+
perform_request(method, path, params, body, headers,
45+
{ :path_templates => ["/_cat"], :endpoint => 'cat.help' })
4546
)
4647
end
4748
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module Actions
3939
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
4040
# @option arguments [Hash] :headers Custom HTTP headers
4141
#
42-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-indices.html
42+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html
4343
#
4444
def indices(arguments = {})
4545
arguments = arguments.clone
@@ -59,8 +59,8 @@ def indices(arguments = {})
5959
params[:h] = Utils.__listify(params[:h]) if params[:h]
6060

6161
Elasticsearch::API::Response.new(
62-
perform_request(method, path, params, body, headers, ["/_cat/indices", "/_cat/indices/{index}"],
63-
'cat.indices')
62+
perform_request(method, path, params, body, headers,
63+
{ :path_templates => ["/_cat/indices", "/_cat/indices/{index}"], :endpoint => 'cat.indices' })
6464
)
6565
end
6666
end

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module Actions
3333
# @option arguments [Boolean] :v Verbose mode. Display column headers
3434
# @option arguments [Hash] :headers Custom HTTP headers
3535
#
36-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-master.html
36+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-master.html
3737
#
3838
def master(arguments = {})
3939
arguments = arguments.clone
@@ -46,7 +46,8 @@ def master(arguments = {})
4646
params = Utils.process_params(arguments)
4747

4848
Elasticsearch::API::Response.new(
49-
perform_request(method, path, params, body, headers, ["/_cat/master"], 'cat.master')
49+
perform_request(method, path, params, body, headers,
50+
{ :path_templates => ["/_cat/master"], :endpoint => 'cat.master' })
5051
)
5152
end
5253
end

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module Actions
3535
# @option arguments [Boolean] :v Verbose mode. Display column headers
3636
# @option arguments [Hash] :headers Custom HTTP headers
3737
#
38-
# @see http://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-dfanalytics.html
38+
# @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html
3939
#
4040
def ml_data_frame_analytics(arguments = {})
4141
arguments = arguments.clone
@@ -55,7 +55,7 @@ def ml_data_frame_analytics(arguments = {})
5555

5656
Elasticsearch::API::Response.new(
5757
perform_request(method, path, params, body, headers,
58-
["/_cat/ml/data_frame/analytics", "/_cat/ml/data_frame/analytics/{id}"], 'cat.ml_data_frame_analytics')
58+
{ :path_templates => ["/_cat/ml/data_frame/analytics", "/_cat/ml/data_frame/analytics/{id}"], :endpoint => 'cat.ml_data_frame_analytics' })
5959
)
6060
end
6161
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module Actions
3434
# @option arguments [Boolean] :v Verbose mode. Display column headers
3535
# @option arguments [Hash] :headers Custom HTTP headers
3636
#
37-
# @see http://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-datafeeds.html
37+
# @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html
3838
#
3939
def ml_datafeeds(arguments = {})
4040
arguments = arguments.clone
@@ -53,8 +53,8 @@ def ml_datafeeds(arguments = {})
5353
params = Utils.process_params(arguments)
5454

5555
Elasticsearch::API::Response.new(
56-
perform_request(method, path, params, body, headers, ["/_cat/ml/datafeeds", "/_cat/ml/datafeeds/{datafeed_id}"],
57-
'cat.ml_datafeeds')
56+
perform_request(method, path, params, body, headers,
57+
{ :path_templates => ["/_cat/ml/datafeeds", "/_cat/ml/datafeeds/{datafeed_id}"], :endpoint => 'cat.ml_datafeeds' })
5858
)
5959
end
6060
end

0 commit comments

Comments
 (0)