Skip to content

Commit 9023aad

Browse files
committed
Add path patterns and endpoint as args to perform_request
1 parent f82e9f2 commit 9023aad

File tree

466 files changed

+1284
-921
lines changed

Some content is hidden

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

466 files changed

+1284
-921
lines changed

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

Lines changed: 2 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/current/async-search.html
30+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/async-search.html
3131
#
3232
def delete(arguments = {})
3333
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -44,7 +44,7 @@ def delete(arguments = {})
4444
params = {}
4545

4646
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers)
47+
perform_request(method, path, params, body, headers, ["/_async_search/{id}"], 'async_search.delete')
4848
)
4949
end
5050
end

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

Lines changed: 2 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/current/async-search.html
33+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/async-search.html
3434
#
3535
def get(arguments = {})
3636
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -47,7 +47,7 @@ def get(arguments = {})
4747
params = Utils.process_params(arguments)
4848

4949
Elasticsearch::API::Response.new(
50-
perform_request(method, path, params, body, headers)
50+
perform_request(method, path, params, body, headers, ["/_async_search/{id}"], 'async_search.get')
5151
)
5252
end
5353
end

elasticsearch-api/lib/elasticsearch/api/actions/async_search/status.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/current/async-search.html
30+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/async-search.html
3131
#
3232
def status(arguments = {})
3333
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -44,7 +44,8 @@ def status(arguments = {})
4444
params = {}
4545

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

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

Lines changed: 3 additions & 2 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/current/async-search.html
72+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/async-search.html
7373
#
7474
def submit(arguments = {})
7575
arguments = arguments.clone
@@ -88,7 +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)
91+
perform_request(method, path, params, body, headers, ["/_async_search", "/{index}/_async_search"],
92+
'async_search.submit')
9293
)
9394
end
9495
end

elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.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] :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/current/autoscaling-delete-autoscaling-policy.html
30+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/autoscaling-delete-autoscaling-policy.html
3131
#
3232
def delete_autoscaling_policy(arguments = {})
3333
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
@@ -44,7 +44,8 @@ def delete_autoscaling_policy(arguments = {})
4444
params = {}
4545

4646
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers)
47+
perform_request(method, path, params, body, headers, ["/_autoscaling/policy/{name}"],
48+
'autoscaling.delete_autoscaling_policy')
4849
)
4950
end
5051
end

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

Lines changed: 3 additions & 2 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/current/autoscaling-get-autoscaling-capacity.html
29+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/autoscaling-get-autoscaling-capacity.html
3030
#
3131
def get_autoscaling_capacity(arguments = {})
3232
arguments = arguments.clone
@@ -39,7 +39,8 @@ def get_autoscaling_capacity(arguments = {})
3939
params = {}
4040

4141
Elasticsearch::API::Response.new(
42-
perform_request(method, path, params, body, headers)
42+
perform_request(method, path, params, body, headers, ["/_autoscaling/capacity"],
43+
'autoscaling.get_autoscaling_capacity')
4344
)
4445
end
4546
end

elasticsearch-api/lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.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] :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/current/autoscaling-get-autoscaling-policy.html
30+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/autoscaling-get-autoscaling-policy.html
3131
#
3232
def get_autoscaling_policy(arguments = {})
3333
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
@@ -44,7 +44,8 @@ def get_autoscaling_policy(arguments = {})
4444
params = {}
4545

4646
Elasticsearch::API::Response.new(
47-
perform_request(method, path, params, body, headers)
47+
perform_request(method, path, params, body, headers, ["/_autoscaling/policy/{name}"],
48+
'autoscaling.get_autoscaling_policy')
4849
)
4950
end
5051
end

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

Lines changed: 3 additions & 2 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/current/autoscaling-put-autoscaling-policy.html
31+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/autoscaling-put-autoscaling-policy.html
3232
#
3333
def put_autoscaling_policy(arguments = {})
3434
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
@@ -46,7 +46,8 @@ def put_autoscaling_policy(arguments = {})
4646
params = {}
4747

4848
Elasticsearch::API::Response.new(
49-
perform_request(method, path, params, body, headers)
49+
perform_request(method, path, params, body, headers, ["/_autoscaling/policy/{name}"],
50+
'autoscaling.put_autoscaling_policy')
5051
)
5152
end
5253
end

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

Lines changed: 2 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/current/docs-bulk.html
41+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/docs-bulk.html
4242
#
4343
def bulk(arguments = {})
4444
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
@@ -66,7 +66,7 @@ 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)
69+
perform_request(method, path, params, payload, headers, ["/_bulk", "/{index}/_bulk"], 'bulk')
7070
)
7171
end
7272
end

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

Lines changed: 3 additions & 2 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/current/cat-alias.html
37+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-alias.html
3838
#
3939
def aliases(arguments = {})
4040
arguments = arguments.clone
@@ -54,7 +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)
57+
perform_request(method, path, params, body, headers, ["/_cat/aliases", "/_cat/aliases/{name}"],
58+
'cat.aliases')
5859
)
5960
end
6061
end

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

Lines changed: 3 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 https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html
38+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-allocation.html
3939
#
4040
def allocation(arguments = {})
4141
arguments = arguments.clone
@@ -55,7 +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)
58+
perform_request(method, path, params, body, headers, ["/_cat/allocation", "/_cat/allocation/{node_id}"],
59+
'cat.allocation')
5960
)
6061
end
6162
end

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

Lines changed: 3 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/current/cat-component-templates.html
37+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-component-templates.html
3838
#
3939
def component_templates(arguments = {})
4040
arguments = arguments.clone
@@ -53,7 +53,8 @@ def component_templates(arguments = {})
5353
params = Utils.process_params(arguments)
5454

5555
Elasticsearch::API::Response.new(
56-
perform_request(method, path, params, body, headers)
56+
perform_request(method, path, params, body, headers,
57+
["/_cat/component_templates", "/_cat/component_templates/{name}"], 'cat.component_templates')
5758
)
5859
end
5960
end

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

Lines changed: 2 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/current/cat-count.html
35+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-count.html
3636
#
3737
def count(arguments = {})
3838
arguments = arguments.clone
@@ -52,7 +52,7 @@ 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)
55+
perform_request(method, path, params, body, headers, ["/_cat/count", "/_cat/count/{index}"], 'cat.count')
5656
)
5757
end
5858
end

elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.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/current/cat-fielddata.html
36+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-fielddata.html
3737
#
3838
def fielddata(arguments = {})
3939
arguments = arguments.clone
@@ -52,7 +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)
55+
perform_request(method, path, params, body, headers, ["/_cat/fielddata", "/_cat/fielddata/{fields}"],
56+
'cat.fielddata')
5657
)
5758
end
5859
end

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

Lines changed: 2 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/current/cat-health.html
36+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-health.html
3737
#
3838
def health(arguments = {})
3939
arguments = arguments.clone
@@ -47,7 +47,7 @@ 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)
50+
perform_request(method, path, params, body, headers, ["/_cat/health"], 'cat.health')
5151
)
5252
end
5353
end

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

Lines changed: 2 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/current/cat.html
31+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat.html
3232
#
3333
def help(arguments = {})
3434
arguments = arguments.clone
@@ -41,7 +41,7 @@ def help(arguments = {})
4141
params = Utils.process_params(arguments)
4242

4343
Elasticsearch::API::Response.new(
44-
perform_request(method, path, params, body, headers)
44+
perform_request(method, path, params, body, headers, ["/_cat"], 'cat.help')
4545
)
4646
end
4747
end

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

Lines changed: 3 additions & 2 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/current/cat-indices.html
42+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-indices.html
4343
#
4444
def indices(arguments = {})
4545
arguments = arguments.clone
@@ -59,7 +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)
62+
perform_request(method, path, params, body, headers, ["/_cat/indices", "/_cat/indices/{index}"],
63+
'cat.indices')
6364
)
6465
end
6566
end

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

Lines changed: 2 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/current/cat-master.html
36+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-master.html
3737
#
3838
def master(arguments = {})
3939
arguments = arguments.clone
@@ -46,7 +46,7 @@ def master(arguments = {})
4646
params = Utils.process_params(arguments)
4747

4848
Elasticsearch::API::Response.new(
49-
perform_request(method, path, params, body, headers)
49+
perform_request(method, path, params, body, headers, ["/_cat/master"], 'cat.master')
5050
)
5151
end
5252
end

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

Lines changed: 3 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/current/cat-dfanalytics.html
38+
# @see http://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-dfanalytics.html
3939
#
4040
def ml_data_frame_analytics(arguments = {})
4141
arguments = arguments.clone
@@ -54,7 +54,8 @@ def ml_data_frame_analytics(arguments = {})
5454
params = Utils.process_params(arguments)
5555

5656
Elasticsearch::API::Response.new(
57-
perform_request(method, path, params, body, headers)
57+
perform_request(method, path, params, body, headers,
58+
["/_cat/ml/data_frame/analytics", "/_cat/ml/data_frame/analytics/{id}"], 'cat.ml_data_frame_analytics')
5859
)
5960
end
6061
end

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

Lines changed: 3 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 http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html
37+
# @see http://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-datafeeds.html
3838
#
3939
def ml_datafeeds(arguments = {})
4040
arguments = arguments.clone
@@ -53,7 +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)
56+
perform_request(method, path, params, body, headers, ["/_cat/ml/datafeeds", "/_cat/ml/datafeeds/{datafeed_id}"],
57+
'cat.ml_datafeeds')
5758
)
5859
end
5960
end

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

Lines changed: 3 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/current/cat-anomaly-detectors.html
38+
# @see http://www.elastic.co/guide/en/elasticsearch/reference/8.10/cat-anomaly-detectors.html
3939
#
4040
def ml_jobs(arguments = {})
4141
arguments = arguments.clone
@@ -54,7 +54,8 @@ def ml_jobs(arguments = {})
5454
params = Utils.process_params(arguments)
5555

5656
Elasticsearch::API::Response.new(
57-
perform_request(method, path, params, body, headers)
57+
perform_request(method, path, params, body, headers,
58+
["/_cat/ml/anomaly_detectors", "/_cat/ml/anomaly_detectors/{job_id}"], 'cat.ml_jobs')
5859
)
5960
end
6061
end

0 commit comments

Comments
 (0)