Skip to content

Commit d312a6a

Browse files
committed
[API] Adds master_timeout, timeout parameter to snapshot_lifecycle_management endpoints
* slm.delete_lifecycle * slm.execute_lifecycle * slm.execute_retention * slm.get_lifecycle * slm.get_stats * slm.get_status * slm.put_lifecycle
1 parent 98ec993 commit d312a6a

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

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/8.17/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/8.17/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/8.17/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/8.17/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/8.17/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/8.17/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)