Skip to content

Commit adc01e3

Browse files
committed
[API] Adds timeout, local parameters
* cluster.exists_component_template - adds master_timeout, local parameters * cluster.get_component_template - adds master_timeout, local parameters * snapshot_lifecycle_management.delete_lifecycle - adds master_timeout, timeout parameters * snapshot_lifecycle_management.execute_lifecycle - adds master_timeout, timeout parameters * snapshot_lifecycle_management.execute_retention - adds master_timeout, timeout parameters * snapshot_lifecycle_management.get_lifecycle - adds master_timeout, timeout parameters * snapshot_lifecycle_management.get_stats - adds master_timeout, timeout parameters * snapshot_lifecycle_management.get_status - adds master_timeout, timeout parameters * snapshot_lifecycle_management.put_lifecycle - adds master_timeout, timeout parameters
1 parent e4ad6e9 commit adc01e3

File tree

9 files changed

+25
-11
lines changed

9 files changed

+25
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ module Actions
2525
# Returns information about whether a particular component template exist
2626
#
2727
# @option arguments [String] :name The name of the template
28-
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29-
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
28+
# @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked
29+
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated*
3030
# @option arguments [Hash] :headers Custom HTTP headers
3131
#
3232
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-component-template.html

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ module Actions
2525
# Returns one or more component templates
2626
#
2727
# @option arguments [List] :name The comma separated names of the component templates
28-
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29-
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
28+
# @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked
29+
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated*
3030
# @option arguments [Boolean] :include_defaults Return all default configurations for the component template (default: false)
3131
# @option arguments [Hash] :headers Custom HTTP headers
3232
#

elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ module Actions
2525
# Deletes an existing snapshot lifecycle policy.
2626
#
2727
# @option arguments [String] :policy_id The id of the snapshot lifecycle policy to remove
28+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29+
# @option arguments [Time] :timeout Explicit operation timeout
2830
# @option arguments [Hash] :headers Custom HTTP headers
2931
#
3032
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html
@@ -48,7 +50,7 @@ def delete_lifecycle(arguments = {})
4850

4951
method = Elasticsearch::API::HTTP_DELETE
5052
path = "_slm/policy/#{Utils.__listify(_policy_id)}"
51-
params = {}
53+
params = Utils.process_params(arguments)
5254

5355
Elasticsearch::API::Response.new(
5456
perform_request(method, path, params, body, headers, request_opts)

elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ module Actions
2525
# Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.
2626
#
2727
# @option arguments [String] :policy_id The id of the snapshot lifecycle policy to be executed
28+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29+
# @option arguments [Time] :timeout Explicit operation timeout
2830
# @option arguments [Hash] :headers Custom HTTP headers
2931
#
3032
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html
@@ -48,7 +50,7 @@ def execute_lifecycle(arguments = {})
4850

4951
method = Elasticsearch::API::HTTP_PUT
5052
path = "_slm/policy/#{Utils.__listify(_policy_id)}/_execute"
51-
params = {}
53+
params = Utils.process_params(arguments)
5254

5355
Elasticsearch::API::Response.new(
5456
perform_request(method, path, params, body, headers, request_opts)

elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module SnapshotLifecycleManagement
2424
module Actions
2525
# Deletes any snapshots that are expired according to the policy's retention rules.
2626
#
27+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
28+
# @option arguments [Time] :timeout Explicit operation timeout
2729
# @option arguments [Hash] :headers Custom HTTP headers
2830
#
2931
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html
@@ -38,7 +40,7 @@ def execute_retention(arguments = {})
3840

3941
method = Elasticsearch::API::HTTP_POST
4042
path = '_slm/_execute_retention'
41-
params = {}
43+
params = Utils.process_params(arguments)
4244

4345
Elasticsearch::API::Response.new(
4446
perform_request(method, path, params, body, headers, request_opts)

elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ module Actions
2525
# Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.
2626
#
2727
# @option arguments [List] :policy_id Comma-separated list of snapshot lifecycle policies to retrieve
28+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29+
# @option arguments [Time] :timeout Explicit operation timeout
2830
# @option arguments [Hash] :headers Custom HTTP headers
2931
#
3032
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html
@@ -50,7 +52,7 @@ def get_lifecycle(arguments = {})
5052
else
5153
'_slm/policy'
5254
end
53-
params = {}
55+
params = Utils.process_params(arguments)
5456

5557
Elasticsearch::API::Response.new(
5658
perform_request(method, path, params, body, headers, request_opts)

elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module SnapshotLifecycleManagement
2424
module Actions
2525
# Returns global and policy-level statistics about actions taken by snapshot lifecycle management.
2626
#
27+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
28+
# @option arguments [Time] :timeout Explicit operation timeout
2729
# @option arguments [Hash] :headers Custom HTTP headers
2830
#
2931
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-stats.html
@@ -38,7 +40,7 @@ def get_stats(arguments = {})
3840

3941
method = Elasticsearch::API::HTTP_GET
4042
path = '_slm/stats'
41-
params = {}
43+
params = Utils.process_params(arguments)
4244

4345
Elasticsearch::API::Response.new(
4446
perform_request(method, path, params, body, headers, request_opts)

elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module SnapshotLifecycleManagement
2424
module Actions
2525
# Retrieves the status of snapshot lifecycle management (SLM).
2626
#
27+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
28+
# @option arguments [Time] :timeout Explicit operation timeout
2729
# @option arguments [Hash] :headers Custom HTTP headers
2830
#
2931
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html
@@ -38,7 +40,7 @@ def get_status(arguments = {})
3840

3941
method = Elasticsearch::API::HTTP_GET
4042
path = '_slm/status'
41-
params = {}
43+
params = Utils.process_params(arguments)
4244

4345
Elasticsearch::API::Response.new(
4446
perform_request(method, path, params, body, headers, request_opts)

elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ module Actions
2525
# Creates or updates a snapshot lifecycle policy.
2626
#
2727
# @option arguments [String] :policy_id The id of the snapshot lifecycle policy
28+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
29+
# @option arguments [Time] :timeout Explicit operation timeout
2830
# @option arguments [Hash] :headers Custom HTTP headers
2931
# @option arguments [Hash] :body The snapshot lifecycle policy definition to register
3032
#
@@ -49,7 +51,7 @@ def put_lifecycle(arguments = {})
4951

5052
method = Elasticsearch::API::HTTP_PUT
5153
path = "_slm/policy/#{Utils.__listify(_policy_id)}"
52-
params = {}
54+
params = Utils.process_params(arguments)
5355

5456
Elasticsearch::API::Response.new(
5557
perform_request(method, path, params, body, headers, request_opts)

0 commit comments

Comments
 (0)