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.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb', line 29 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 |
#explain_lifecycle(arguments = {}) ⇒ Object
Retrieves information about the index’s current lifecycle state, such as the currently executing phase, action, and step.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb', line 31 def explain_lifecycle(arguments = {}) 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) ) end |
#get_lifecycle(arguments = {}) ⇒ Object
Returns the specified policy definition. Includes the policy version and last modified date.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb', line 29 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 |
#get_status(arguments = {}) ⇒ Object
Retrieves the current index lifecycle management (ILM) status.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/get_status.rb', line 28 def get_status(arguments = {}) 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) ) end |
#migrate_to_data_tiers(arguments = {}) ⇒ Object
Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb', line 30 def migrate_to_data_tiers(arguments = {}) 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) ) end |
#move_to_step(arguments = {}) ⇒ Object
Manually moves an index into the specified step and executes that step.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb', line 30 def move_to_step(arguments = {}) 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) ) end |
#put_lifecycle(arguments = {}) ⇒ Object
Creates a lifecycle policy
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb', line 30 def put_lifecycle(arguments = {}) 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) ) end |
#remove_policy(arguments = {}) ⇒ Object
Removes the assigned lifecycle policy and stops managing the specified index
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/remove_policy.rb', line 29 def remove_policy(arguments = {}) 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) ) end |
#retry(arguments = {}) ⇒ Object
Retries executing the policy for an index that is in the ERROR step.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb', line 29 def retry(arguments = {}) 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) ) end |
#start(arguments = {}) ⇒ Object
Start the index lifecycle management (ILM) plugin.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/start.rb', line 28 def start(arguments = {}) 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) ) end |
#stop(arguments = {}) ⇒ Object
Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb', line 28 def stop(arguments = {}) 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) ) end |