Module: Elasticsearch::API::SnapshotLifecycleManagement::Actions
- Included in:
- SnapshotLifecycleManagementClient
- Defined in:
- lib/elasticsearch/api/namespace/snapshot_lifecycle_management.rb,
lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb,
lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb,
lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb,
lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb,
lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb,
lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb,
lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb,
lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb,
lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb
Instance Method Summary collapse
-
#delete_lifecycle(arguments = {}) ⇒ Object
Deletes an existing snapshot lifecycle policy.
-
#execute_lifecycle(arguments = {}) ⇒ Object
Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.
-
#execute_retention(arguments = {}) ⇒ Object
Deletes any snapshots that are expired according to the policy’s retention rules.
-
#get_lifecycle(arguments = {}) ⇒ Object
Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.
-
#get_stats(arguments = {}) ⇒ Object
Returns global and policy-level statistics about actions taken by snapshot lifecycle management.
-
#get_status(arguments = {}) ⇒ Object
Retrieves the status of snapshot lifecycle management (SLM).
-
#put_lifecycle(arguments = {}) ⇒ Object
Creates or updates a snapshot lifecycle policy.
-
#start(arguments = {}) ⇒ Object
Turns on snapshot lifecycle management (SLM).
-
#stop(arguments = {}) ⇒ Object
Turns off snapshot lifecycle management (SLM).
Instance Method Details
#delete_lifecycle(arguments = {}) ⇒ Object
Deletes an existing snapshot lifecycle policy.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb', line 29 def delete_lifecycle(arguments = {}) raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id] headers = arguments.delete(:headers) || {} body = nil arguments = arguments.clone _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_DELETE path = "_slm/policy/#{Utils.__listify(_policy_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#execute_lifecycle(arguments = {}) ⇒ Object
Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb', line 29 def execute_lifecycle(arguments = {}) raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id] headers = arguments.delete(:headers) || {} body = nil arguments = arguments.clone _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_PUT path = "_slm/policy/#{Utils.__listify(_policy_id)}/_execute" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#execute_retention(arguments = {}) ⇒ Object
Deletes any snapshots that are expired according to the policy’s retention rules.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb', line 28 def execute_retention(arguments = {}) headers = arguments.delete(:headers) || {} body = nil arguments = arguments.clone method = Elasticsearch::API::HTTP_POST path = "_slm/_execute_retention" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#get_lifecycle(arguments = {}) ⇒ Object
Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb', line 29 def get_lifecycle(arguments = {}) headers = arguments.delete(:headers) || {} body = nil arguments = arguments.clone _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_GET path = if _policy_id "_slm/policy/#{Utils.__listify(_policy_id)}" else "_slm/policy" end params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#get_stats(arguments = {}) ⇒ Object
Returns global and policy-level statistics about actions taken by snapshot lifecycle management.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb', line 28 def get_stats(arguments = {}) headers = arguments.delete(:headers) || {} body = nil arguments = arguments.clone method = Elasticsearch::API::HTTP_GET path = "_slm/stats" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#get_status(arguments = {}) ⇒ Object
Retrieves the status of snapshot lifecycle management (SLM).
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb', line 28 def get_status(arguments = {}) headers = arguments.delete(:headers) || {} body = nil arguments = arguments.clone method = Elasticsearch::API::HTTP_GET path = "_slm/status" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#put_lifecycle(arguments = {}) ⇒ Object
Creates or updates a snapshot lifecycle policy.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb', line 30 def put_lifecycle(arguments = {}) raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id] headers = arguments.delete(:headers) || {} body = arguments.delete(:body) arguments = arguments.clone _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_PUT path = "_slm/policy/#{Utils.__listify(_policy_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#start(arguments = {}) ⇒ Object
Turns on snapshot lifecycle management (SLM).
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb', line 28 def start(arguments = {}) headers = arguments.delete(:headers) || {} body = nil arguments = arguments.clone method = Elasticsearch::API::HTTP_POST path = "_slm/start" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#stop(arguments = {}) ⇒ Object
Turns off snapshot lifecycle management (SLM).
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb', line 28 def stop(arguments = {}) headers = arguments.delete(:headers) || {} body = nil arguments = arguments.clone method = Elasticsearch::API::HTTP_POST path = "_slm/stop" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |