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
Delete a policy.
-
#execute_lifecycle(arguments = {}) ⇒ Object
Run a policy.
-
#execute_retention(arguments = {}) ⇒ Object
Run a retention policy.
-
#get_lifecycle(arguments = {}) ⇒ Object
Get policy information.
-
#get_stats(arguments = {}) ⇒ Object
Get snapshot lifecycle management statistics.
-
#get_status(arguments = {}) ⇒ Object
Get the snapshot lifecycle management status.
-
#put_lifecycle(arguments = {}) ⇒ Object
Create or update a policy.
-
#start(arguments = {}) ⇒ Object
Start snapshot lifecycle management.
-
#stop(arguments = {}) ⇒ Object
Stop snapshot lifecycle management.
Instance Method Details
#delete_lifecycle(arguments = {}) ⇒ Object
Delete a policy
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb', line 34 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 |
#execute_lifecycle(arguments = {}) ⇒ Object
Run a policy
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb', line 34 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 |
#execute_retention(arguments = {}) ⇒ Object
Run a retention policy
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb', line 33 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 |
#get_lifecycle(arguments = {}) ⇒ Object
Get policy information
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb', line 34 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_stats(arguments = {}) ⇒ Object
Get snapshot lifecycle management statistics
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb', line 33 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_status(arguments = {}) ⇒ Object
Get the snapshot lifecycle management status
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb', line 33 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 |
#put_lifecycle(arguments = {}) ⇒ Object
Create or update a policy
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb', line 35 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 'body' missing" unless arguments[:body] 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 |
#start(arguments = {}) ⇒ Object
Start snapshot lifecycle management
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb', line 33 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 |
#stop(arguments = {}) ⇒ Object
Stop snapshot lifecycle management
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb', line 33 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 |