Method: Elasticsearch::API::IndexLifecycleManagement::Actions#get_lifecycle

Defined in:
lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb

#get_lifecycle(arguments = {}) ⇒ Object

Returns the specified policy definition. Includes the policy version and last modified date.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :policy (String)

    The name of the index lifecycle policy

  • :headers (Hash)

    Custom HTTP headers

See Also:

[View source]

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb', line 32

def get_lifecycle(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _policy = arguments.delete(:policy)

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

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end