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

0 commit comments

Comments
 (0)