Skip to content

Commit ba660ed

Browse files
committed
[API] Request body was incorrectly marked as not required in several APIs.
This commit generates the code for commit 62d200f5597fbf3529686f7ae7063d6b0a77f1cb of `elasticsearch-specification`, adding the body requirement in these 68 APIs: `clear_scroll` `close_point_in_time` `cluster.allocation_explain` `cluster.reroute` `count` `explain` `field_caps` `fleet.search` `graph.explore` `index_lifecycle_management.move_to_step` `index_lifecycle_management.put_lifecycle` `indices.analyze` `indices.clone` `indices.create` `indices.put_data_lifecycle` `indices.put_data_stream_options` `indices.rollover` `indices.shrink` `indices.split` `indices.validate_query` `inference.completion` `inference.inference` `inference.put_ai21` `inference.put_alibabacloud` `inference.put_amazonbedrock` `inference.put_amazonsagemaker` `inference.put_anthropic` `inference.put_azureaistudio` `inference.put_azureopenai` `inference.put_cohere` `inference.put_contextualai` `inference.put_custom` `inference.put_deepseek` `inference.put_elasticsearch` `inference.put_elser` `inference.put_googleaistudio` `inference.put_googlevertexai` `inference.put_hugging_face` `inference.put_jinaai` `inference.put_llama` `inference.put_mistral` `inference.put_openai` `inference.put_voyageai` `inference.put_watsonx` `inference.rerank` `inference.sparse_embedding` `inference.stream_completion` `inference.text_embedding` `license.post` `machine_learning.delete_expired_data` `machine_learning.flush_job` `machine_learning.get_buckets` `machine_learning.get_calendars` `machine_learning.get_categories` `machine_learning.get_influencers` `machine_learning.get_model_snapshots` `machine_learning.get_overall_buckets` `machine_learning.get_records` `machine_learning.revert_model_snapshot` `machine_learning.start_datafeed` `open_point_in_time` `render_search_template` `scripts_painless_execute` `scroll` `search` `snapshot_lifecycle_management.put_lifecycle` `terms_enum` `update_by_query`
1 parent 665a6a4 commit ba660ed

Some content is hidden

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

69 files changed

+103
-115
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ module Actions
5151
def clear_scroll(arguments = {})
5252
request_opts = { endpoint: arguments[:endpoint] || 'clear_scroll' }
5353

54+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
55+
5456
arguments = arguments.clone
5557
headers = arguments.delete(:headers) || {}
5658

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ module Actions
4646
def close_point_in_time(arguments = {})
4747
request_opts = { endpoint: arguments[:endpoint] || 'close_point_in_time' }
4848

49+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
50+
4951
arguments = arguments.clone
5052
headers = arguments.delete(:headers) || {}
5153

elasticsearch-api/lib/elasticsearch/api/actions/cluster/allocation_explain.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,14 @@ module Actions
5656
def allocation_explain(arguments = {})
5757
request_opts = { endpoint: arguments[:endpoint] || 'cluster.allocation_explain' }
5858

59+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
60+
5961
arguments = arguments.clone
6062
headers = arguments.delete(:headers) || {}
6163

6264
body = arguments.delete(:body)
6365

64-
method = if body
65-
Elasticsearch::API::HTTP_POST
66-
else
67-
Elasticsearch::API::HTTP_GET
68-
end
69-
66+
method = Elasticsearch::API::HTTP_POST
7067
path = '_cluster/allocation/explain'
7168
params = Utils.process_params(arguments)
7269

elasticsearch-api/lib/elasticsearch/api/actions/cluster/reroute.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ module Actions
5959
def reroute(arguments = {})
6060
request_opts = { endpoint: arguments[:endpoint] || 'cluster.reroute' }
6161

62+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
63+
6264
arguments = arguments.clone
6365
headers = arguments.delete(:headers) || {}
6466

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ def count(arguments = {})
9494
end
9595
request_opts[:defined_params] = defined_params unless defined_params.empty?
9696

97+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
98+
9799
arguments = arguments.clone
98100
headers = arguments.delete(:headers) || {}
99101

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def explain(arguments = {})
7575
end
7676
request_opts[:defined_params] = defined_params unless defined_params.empty?
7777

78+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
7879
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
7980
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
8081

@@ -87,12 +88,7 @@ def explain(arguments = {})
8788

8889
_index = arguments.delete(:index)
8990

90-
method = if body
91-
Elasticsearch::API::HTTP_POST
92-
else
93-
Elasticsearch::API::HTTP_GET
94-
end
95-
91+
method = Elasticsearch::API::HTTP_POST
9692
path = "#{Utils.listify(_index)}/_explain/#{Utils.listify(_id)}"
9793
params = Utils.process_params(arguments)
9894

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,16 @@ def field_caps(arguments = {})
7272
end
7373
request_opts[:defined_params] = defined_params unless defined_params.empty?
7474

75+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
76+
7577
arguments = arguments.clone
7678
headers = arguments.delete(:headers) || {}
7779

7880
body = arguments.delete(:body)
7981

8082
_index = arguments.delete(:index)
8183

82-
method = if body
83-
Elasticsearch::API::HTTP_POST
84-
else
85-
Elasticsearch::API::HTTP_GET
86-
end
87-
84+
method = Elasticsearch::API::HTTP_POST
8885
path = if _index
8986
"#{Utils.listify(_index)}/_field_caps"
9087
else

elasticsearch-api/lib/elasticsearch/api/actions/fleet/search.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def search(arguments = {})
102102
end
103103
request_opts[:defined_params] = defined_params unless defined_params.empty?
104104

105+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
105106
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
106107

107108
arguments = arguments.clone
@@ -111,12 +112,7 @@ def search(arguments = {})
111112

112113
_index = arguments.delete(:index)
113114

114-
method = if body
115-
Elasticsearch::API::HTTP_POST
116-
else
117-
Elasticsearch::API::HTTP_GET
118-
end
119-
115+
method = Elasticsearch::API::HTTP_POST
120116
path = "#{Utils.listify(_index)}/_fleet/_fleet_search"
121117
params = Utils.process_params(arguments)
122118

elasticsearch-api/lib/elasticsearch/api/actions/graph/explore.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def explore(arguments = {})
5858
end
5959
request_opts[:defined_params] = defined_params unless defined_params.empty?
6060

61+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
6162
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
6263

6364
arguments = arguments.clone
@@ -67,12 +68,7 @@ def explore(arguments = {})
6768

6869
_index = arguments.delete(:index)
6970

70-
method = if body
71-
Elasticsearch::API::HTTP_POST
72-
else
73-
Elasticsearch::API::HTTP_GET
74-
end
75-
71+
method = Elasticsearch::API::HTTP_POST
7672
path = "#{Utils.listify(_index)}/_graph/explore"
7773
params = Utils.process_params(arguments)
7874

elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def move_to_step(arguments = {})
5959
end
6060
request_opts[:defined_params] = defined_params unless defined_params.empty?
6161

62+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
6263
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
6364

6465
arguments = arguments.clone

0 commit comments

Comments
 (0)