Method: Elasticsearch::API::IndexLifecycleManagement::Actions#delete_lifecycle

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

#delete_lifecycle(arguments = {}) ⇒ Object

Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted.

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

Raises:

  • (ArgumentError)

See Also:



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

def delete_lifecycle(arguments = {})
  raise ArgumentError, "Required argument 'policy' missing" unless arguments[:policy]

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

  body = nil

  _policy = arguments.delete(:policy)

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

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