From cee6cccd4d57f0f540fe3e79a30ccde3791daad5 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Mon, 28 Jul 2025 10:55:03 +0100 Subject: [PATCH 1/2] [API]Time parameters :master_timeout and :timeout have been added to the following APIs: * index_lifecycle_management ** delete_lifecycle ** get_lifecycle ** put_lifecycle ** start ** stop ** explain_lifecycle - Only :master_timeout * ingest: ** delete_geoip_database ** delete_ip_location_database ** put_geoip_database ** put_ip_location_database --- .../actions/index_lifecycle_management/delete_lifecycle.rb | 4 +++- .../actions/index_lifecycle_management/explain_lifecycle.rb | 1 + .../api/actions/index_lifecycle_management/get_lifecycle.rb | 4 +++- .../api/actions/index_lifecycle_management/put_lifecycle.rb | 4 +++- .../api/actions/index_lifecycle_management/start.rb | 4 +++- .../api/actions/index_lifecycle_management/stop.rb | 4 +++- .../elasticsearch/api/actions/ingest/delete_geoip_database.rb | 4 +++- .../api/actions/ingest/delete_ip_location_database.rb | 4 +++- .../elasticsearch/api/actions/ingest/put_geoip_database.rb | 4 +++- .../api/actions/ingest/put_ip_location_database.rb | 4 +++- 10 files changed, 28 insertions(+), 9 deletions(-) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb index 555083b3ce..93e8677f5a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb @@ -25,6 +25,8 @@ module Actions # Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. # # @option arguments [String] :policy The name of the index lifecycle policy + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ilm-delete-lifecycle.html @@ -48,7 +50,7 @@ def delete_lifecycle(arguments = {}) method = Elasticsearch::API::HTTP_DELETE path = "_ilm/policy/#{Utils.__listify(_policy)}" - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb index 1a4c00f2ec..bbc0da52f4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb @@ -27,6 +27,7 @@ module Actions # @option arguments [String] :index The name of the index to explain # @option arguments [Boolean] :only_managed filters the indices included in the response to ones managed by ILM # @option arguments [Boolean] :only_errors filters the indices included in the response to ones in an ILM error state, implies only_managed + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node # @option arguments [Hash] :headers Custom HTTP headers # # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ilm-explain-lifecycle.html diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb index 04481cf72f..385b0eb08d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb @@ -25,6 +25,8 @@ module Actions # Returns the specified policy definition. Includes the policy version and last modified date. # # @option arguments [String] :policy The name of the index lifecycle policy + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ilm-get-lifecycle.html @@ -50,7 +52,7 @@ def get_lifecycle(arguments = {}) else '_ilm/policy' end - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb index 38dd14ac13..f54c7a3de0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb @@ -25,6 +25,8 @@ module Actions # Creates a lifecycle policy # # @option arguments [String] :policy The name of the index lifecycle policy + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # @option arguments [Hash] :body The lifecycle policy definition to register # @@ -49,7 +51,7 @@ def put_lifecycle(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = "_ilm/policy/#{Utils.__listify(_policy)}" - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb index faf1b940fd..908ff8751c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb @@ -24,6 +24,8 @@ module IndexLifecycleManagement module Actions # Start the index lifecycle management (ILM) plugin. # + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ilm-start.html @@ -38,7 +40,7 @@ def start(arguments = {}) method = Elasticsearch::API::HTTP_POST path = '_ilm/start' - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb index 5ed6f59440..1bfae4b2cc 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb @@ -24,6 +24,8 @@ module IndexLifecycleManagement module Actions # Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin # + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ilm-stop.html @@ -38,7 +40,7 @@ def stop(arguments = {}) method = Elasticsearch::API::HTTP_POST path = '_ilm/stop' - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_geoip_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_geoip_database.rb index 3567c55cbf..4da80202ef 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_geoip_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_geoip_database.rb @@ -25,6 +25,8 @@ module Actions # Deletes a geoip database configuration # # @option arguments [List] :id A comma-separated list of geoip database configurations to delete + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-geoip-database-api.html @@ -48,7 +50,7 @@ def delete_geoip_database(arguments = {}) method = Elasticsearch::API::HTTP_DELETE path = "_ingest/geoip/database/#{Utils.__listify(_id)}" - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_ip_location_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_ip_location_database.rb index e2552e7192..3798079ebc 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_ip_location_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_ip_location_database.rb @@ -25,6 +25,8 @@ module Actions # Deletes an ip location database configuration # # @option arguments [List] :id A comma-separated list of ip location database configurations to delete + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-ip-location-database-api.html @@ -48,7 +50,7 @@ def delete_ip_location_database(arguments = {}) method = Elasticsearch::API::HTTP_DELETE path = "_ingest/ip_location/database/#{Utils.__listify(_id)}" - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_geoip_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_geoip_database.rb index adeaafcacc..b28d4e63b6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_geoip_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_geoip_database.rb @@ -25,6 +25,8 @@ module Actions # Puts the configuration for a geoip database to be downloaded # # @option arguments [String] :id The id of the database configuration + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # @option arguments [Hash] :body The database configuration definition (*Required*) # @@ -50,7 +52,7 @@ def put_geoip_database(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = "_ingest/geoip/database/#{Utils.__listify(_id)}" - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_ip_location_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_ip_location_database.rb index 0255f03d5c..f47c6e42e7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_ip_location_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_ip_location_database.rb @@ -25,6 +25,8 @@ module Actions # Puts the configuration for a ip location database to be downloaded # # @option arguments [String] :id The id of the database configuration + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # @option arguments [Hash] :body The database configuration definition (*Required*) # @@ -50,7 +52,7 @@ def put_ip_location_database(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = "_ingest/ip_location/database/#{Utils.__listify(_id)}" - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) From 12951b08e8eb6705fd2912ad5a694d28f69de4f1 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Mon, 28 Jul 2025 10:40:54 +0100 Subject: [PATCH 2/2] Updates ingest ip specs --- .../api/actions/ingest/delete_geoip_database_spec.rb | 2 +- .../api/actions/ingest/delete_ip_location_database_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/ingest/delete_geoip_database_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/ingest/delete_geoip_database_spec.rb index 4a3e4e9b6e..a7a3622777 100644 --- a/elasticsearch-api/spec/elasticsearch/api/actions/ingest/delete_geoip_database_spec.rb +++ b/elasticsearch-api/spec/elasticsearch/api/actions/ingest/delete_geoip_database_spec.rb @@ -34,6 +34,6 @@ end it 'performs the request' do - expect(client_double.ingest.delete_geoip_database(id: 'foo', body: {})).to be_a Elasticsearch::API::Response + expect(client_double.ingest.delete_geoip_database(id: 'foo')).to be_a Elasticsearch::API::Response end end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/ingest/delete_ip_location_database_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/ingest/delete_ip_location_database_spec.rb index f070341d1d..429faebe9c 100644 --- a/elasticsearch-api/spec/elasticsearch/api/actions/ingest/delete_ip_location_database_spec.rb +++ b/elasticsearch-api/spec/elasticsearch/api/actions/ingest/delete_ip_location_database_spec.rb @@ -34,6 +34,6 @@ end it 'performs the request' do - expect(client_double.ingest.delete_ip_location_database(id: 'foo', body: {})).to be_a Elasticsearch::API::Response + expect(client_double.ingest.delete_ip_location_database(id: 'foo')).to be_a Elasticsearch::API::Response end end