module Elasticsearch::API::SnapshotLifecycleManagement::Actions
Public Instance Methods
Source
# File lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb, line 38 def delete_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.delete_lifecycle' } defined_params = [:policy_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_DELETE path = "_slm/policy/#{Utils.listify(_policy_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Delete a policy. Delete a snapshot lifecycle policy definition. This operation prevents any future snapshots from being taken but does not cancel in-progress snapshots or remove previously-taken snapshots.
@option arguments [String] :policy_id The id of the snapshot lifecycle policy to remove (Required) @option arguments [Time] :master_timeout The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
@option arguments [Time] :timeout The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-slm-delete-lifecycle
Source
# File lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb, line 38 def execute_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.execute_lifecycle' } defined_params = [:policy_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_PUT path = "_slm/policy/#{Utils.listify(_policy_id)}/_execute" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Run a policy. Immediately create a snapshot according to the snapshot lifecycle policy without waiting for the scheduled time. The snapshot policy is normally applied according to its schedule, but you might want to manually run a policy before performing an upgrade or other maintenance.
@option arguments [String] :policy_id The id of the snapshot lifecycle policy to be executed (Required) @option arguments [Time] :master_timeout The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
@option arguments [Time] :timeout The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-slm-execute-lifecycle
Source
# File lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb, line 37 def execute_retention(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.execute_retention' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_POST path = '_slm/_execute_retention' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Run a retention policy. Manually apply the retention policy to force immediate removal of snapshots that are expired according to the snapshot lifecycle policy retention rules. The retention policy is normally applied according to its schedule.
@option arguments [Time] :master_timeout The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
@option arguments [Time] :timeout The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-slm-execute-retention
Source
# File lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb, line 37 def get_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.get_lifecycle' } defined_params = [:policy_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _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 = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Get policy information. Get snapshot lifecycle policy definitions and information about the latest snapshot attempts.
@option arguments [String, Array<String>] :policy_id Comma-separated list of snapshot lifecycle policies to retrieve @option arguments [Time] :master_timeout The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
@option arguments [Time] :timeout The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-slm-get-lifecycle
Source
# File lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb, line 34 def get_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.get_stats' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_GET path = '_slm/stats' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Get snapshot lifecycle management statistics. Get global and policy-level statistics about actions taken by snapshot lifecycle management.
@option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. @option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-slm-get-stats
Source
# File lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb, line 37 def get_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.get_status' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_GET path = '_slm/status' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Get the snapshot lifecycle management status.
@option arguments [Time] :master_timeout The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to +-1+. Server default: 30s.
@option arguments [Time] :timeout The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to +-1+. Server default: 30s.
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-slm-get-status
Source
# File lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb, line 42 def put_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.put_lifecycle' } defined_params = [:policy_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_PUT path = "_slm/policy/#{Utils.listify(_policy_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Create or update a policy. Create or update a snapshot lifecycle policy. If the policy already exists, this request increments the policy version. Only the latest version of a policy is stored.
@option arguments [String] :policy_id The identifier for the snapshot lifecycle policy you want to create or update. (Required) @option arguments [Time] :master_timeout The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to +-1+. Server default: 30s.
@option arguments [Time] :timeout The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to +-1+. Server default: 30s.
@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body request body
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-slm-put-lifecycle
Source
# File lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb, line 39 def start(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.start' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_POST path = '_slm/start' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Start snapshot lifecycle management. Snapshot
lifecycle management (SLM) starts automatically when a cluster is formed. Manually starting SLM is necessary only if it has been stopped using the stop SLM API
.
@option arguments [Time] :master_timeout The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to +-1+. Server default: 30s.
@option arguments [Time] :timeout The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to +-1+. Server default: 30s.
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-slm-start
Source
# File lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb, line 43 def stop(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.stop' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_POST path = '_slm/stop' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Stop snapshot lifecycle management. Stop all snapshot lifecycle management (SLM) operations and the SLM plugin. This API
is useful when you are performing maintenance on a cluster and need to prevent SLM from performing any actions on your data streams or indices. Stopping SLM does not stop any snapshots that are in progress. You can manually trigger snapshots with the run snapshot lifecycle policy API
even if SLM is stopped. The API
returns a response as soon as the request is acknowledged, but the plugin might continue to run until in-progress operations complete and it can be safely stopped. Use the get snapshot lifecycle management status API
to see if SLM is running.
@option arguments [Time] :master_timeout The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to +-1+. Server default: 30s.
@option arguments [Time] :timeout The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to +-1+. Server default: 30s.
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-slm-stop