module Elasticsearch::XPack::API::SnapshotLifecycleManagement::Actions

Public Instance Methods

delete_lifecycle(arguments = {}) click to toggle source

Deletes an existing snapshot lifecycle policy.

@option arguments [String] :policy_id The id of the snapshot lifecycle policy to remove @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/slm-api-delete-policy.html

# File lib/elasticsearch/xpack/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb, line 30
def delete_lifecycle(arguments = {})
  raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id]

  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _policy_id = arguments.delete(:policy_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_slm/policy/#{Elasticsearch::API::Utils.__listify(_policy_id)}"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
execute_lifecycle(arguments = {}) click to toggle source

Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.

@option arguments [String] :policy_id The id of the snapshot lifecycle policy to be executed @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/slm-api-execute-lifecycle.html

# File lib/elasticsearch/xpack/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb, line 30
def execute_lifecycle(arguments = {})
  raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id]

  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _policy_id = arguments.delete(:policy_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_slm/policy/#{Elasticsearch::API::Utils.__listify(_policy_id)}/_execute"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
execute_retention(arguments = {}) click to toggle source

Deletes any snapshots that are expired according to the policy's retention rules.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/slm-api-execute-retention.html

# File lib/elasticsearch/xpack/api/actions/snapshot_lifecycle_management/execute_retention.rb, line 29
def execute_retention(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_POST
  path   = "_slm/_execute_retention"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
get_lifecycle(arguments = {}) click to toggle source

Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.

@option arguments [List] :policy_id Comma-separated list of snapshot lifecycle policies to retrieve @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/slm-api-get-policy.html

# File lib/elasticsearch/xpack/api/actions/snapshot_lifecycle_management/get_lifecycle.rb, line 30
def get_lifecycle(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _policy_id = arguments.delete(:policy_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _policy_id
             "_slm/policy/#{Elasticsearch::API::Utils.__listify(_policy_id)}"
           else
             "_slm/policy"
           end
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
get_stats(arguments = {}) click to toggle source

Returns global and policy-level statistics about actions taken by snapshot lifecycle management.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/slm-api-get-stats.html

# File lib/elasticsearch/xpack/api/actions/snapshot_lifecycle_management/get_stats.rb, line 29
def get_stats(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_GET
  path   = "_slm/stats"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
get_status(arguments = {}) click to toggle source

Retrieves the status of snapshot lifecycle management (SLM).

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/slm-api-get-status.html

# File lib/elasticsearch/xpack/api/actions/snapshot_lifecycle_management/get_status.rb, line 29
def get_status(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_GET
  path   = "_slm/status"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
put_lifecycle(arguments = {}) click to toggle source

Creates or updates a snapshot lifecycle policy.

@option arguments [String] :policy_id The id of the snapshot lifecycle policy @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The snapshot lifecycle policy definition to register

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/slm-api-put-policy.html

# File lib/elasticsearch/xpack/api/actions/snapshot_lifecycle_management/put_lifecycle.rb, line 31
def put_lifecycle(arguments = {})
  raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id]

  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _policy_id = arguments.delete(:policy_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_slm/policy/#{Elasticsearch::API::Utils.__listify(_policy_id)}"
  params = {}

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end
start(arguments = {}) click to toggle source

Turns on snapshot lifecycle management (SLM).

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/slm-api-start.html

# File lib/elasticsearch/xpack/api/actions/snapshot_lifecycle_management/start.rb, line 29
def start(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_POST
  path   = "_slm/start"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
stop(arguments = {}) click to toggle source

Turns off snapshot lifecycle management (SLM).

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/slm-api-stop.html

# File lib/elasticsearch/xpack/api/actions/snapshot_lifecycle_management/stop.rb, line 29
def stop(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_POST
  path   = "_slm/stop"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end