Module: Elasticsearch::API::IndexLifecycleManagement::Actions
- Included in:
- IndexLifecycleManagementClient
- Defined in:
- lib/elasticsearch/api/namespace/index_lifecycle_management.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/start.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/get_status.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/remove_policy.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb,
lib/elasticsearch/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb
Instance Method Summary collapse
-
#delete_lifecycle(arguments = {}) ⇒ Object
Deletes the specified lifecycle policy definition.
-
#explain_lifecycle(arguments = {}) ⇒ Object
Retrieves information about the index’s current lifecycle state, such as the currently executing phase, action, and step.
-
#get_lifecycle(arguments = {}) ⇒ Object
Returns the specified policy definition.
-
#get_status(arguments = {}) ⇒ Object
Retrieves the current index lifecycle management (ILM) status.
-
#migrate_to_data_tiers(arguments = {}) ⇒ Object
Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing.
-
#move_to_step(arguments = {}) ⇒ Object
Manually moves an index into the specified step and executes that step.
-
#put_lifecycle(arguments = {}) ⇒ Object
Creates a lifecycle policy.
-
#remove_policy(arguments = {}) ⇒ Object
Removes the assigned lifecycle policy and stops managing the specified index.
-
#retry(arguments = {}) ⇒ Object
Retries executing the policy for an index that is in the ERROR step.
-
#start(arguments = {}) ⇒ Object
Start the index lifecycle management (ILM) plugin.
-
#stop(arguments = {}) ⇒ Object
Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin.
Instance Method Details
#delete_lifecycle(arguments = {}) ⇒ Object
Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb', line 32 def delete_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.delete_lifecycle' } defined_params = [:policy].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' 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, request_opts) ) end |
#explain_lifecycle(arguments = {}) ⇒ Object
Retrieves information about the index’s current lifecycle state, such as the currently executing phase, action, and step.
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/index_lifecycle_management/explain_lifecycle.rb', line 34 def explain_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.explain_lifecycle' } defined_params = [:index].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 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = "#{Utils.__listify(_index)}/_ilm/explain" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_lifecycle(arguments = {}) ⇒ Object
Returns the specified policy definition. Includes the policy version and last modified date.
32 33 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/index_lifecycle_management/get_lifecycle.rb', line 32 def get_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.get_lifecycle' } defined_params = [:policy].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 = 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, request_opts) ) end |
#get_status(arguments = {}) ⇒ Object
Retrieves the current index lifecycle management (ILM) status.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/get_status.rb', line 31 def get_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.get_status' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_GET path = '_ilm/status' params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#migrate_to_data_tiers(arguments = {}) ⇒ Object
Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb', line 33 def migrate_to_data_tiers(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.migrate_to_data_tiers' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_ilm/migrate_to_data_tiers' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#move_to_step(arguments = {}) ⇒ Object
Manually moves an index into the specified step and executes that step.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb', line 33 def move_to_step(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.move_to_step' } defined_params = [:index].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 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = "_ilm/move/#{Utils.__listify(_index)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_lifecycle(arguments = {}) ⇒ Object
Creates a lifecycle policy
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb', line 33 def put_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.put_lifecycle' } defined_params = [:policy].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' missing" unless arguments[:policy] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _policy = arguments.delete(:policy) method = Elasticsearch::API::HTTP_PUT path = "_ilm/policy/#{Utils.__listify(_policy)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#remove_policy(arguments = {}) ⇒ Object
Removes the assigned lifecycle policy and stops managing the specified index
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/remove_policy.rb', line 32 def remove_policy(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.remove_policy' } defined_params = [:index].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 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = "#{Utils.__listify(_index)}/_ilm/remove" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#retry(arguments = {}) ⇒ Object
Retries executing the policy for an index that is in the ERROR step.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb', line 32 def retry(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.retry' } defined_params = [:index].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 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = "#{Utils.__listify(_index)}/_ilm/retry" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#start(arguments = {}) ⇒ Object
Start the index lifecycle management (ILM) plugin.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/start.rb', line 31 def start(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.start' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_POST path = '_ilm/start' params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#stop(arguments = {}) ⇒ Object
Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb', line 31 def stop(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.stop' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_POST path = '_ilm/stop' params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |