Module: Elasticsearch::XPack::API::IndexLifecycleManagement::Actions
- Included in:
- IndexLifecycleManagementClient
- Defined in:
- lib/elasticsearch/xpack/api/namespace/index_lifecycle_management.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/stop.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/retry.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/start.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/explain.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_policy.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_status.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/put_policy.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/move_to_step.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/retry_policy.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/delete_policy.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_lifecycle.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/put_lifecycle.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/remove_policy.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/params_registry.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/delete_lifecycle.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/explain_lifecycle.rb,
lib/elasticsearch/xpack/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb
Defined Under Namespace
Modules: ParamsRegistry
Instance Method Summary collapse
-
#delete_lifecycle(arguments = {}) ⇒ Object
Deletes the specified lifecycle policy definition.
-
#delete_policy(arguments = {}) ⇒ Object
Deletes a lifecycle policy.
-
#explain(arguments = {}) ⇒ Object
Shows an index’s current lifecycle status.
-
#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_policy(arguments = {}) ⇒ Object
Retrieves a lifecycle policy.
-
#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.
-
#put_policy(arguments = {}) ⇒ Object
Register a new watch in or update an existing one.
-
#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.
-
#retry_policy(arguments = {}) ⇒ Object
Retry 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.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/delete_lifecycle.rb', line 30 def delete_lifecycle(arguments = {}) raise ArgumentError, "Required argument 'policy' missing" unless arguments[:policy] headers = arguments.delete(:headers) || {} arguments = arguments.clone _policy = arguments.delete(:policy) method = Elasticsearch::API::HTTP_DELETE path = "_ilm/policy/#{Elasticsearch::API::Utils.__listify(_policy)}" params = {} body = nil perform_request(method, path, params, body, headers).body end |
#delete_policy(arguments = {}) ⇒ Object
Deletes a lifecycle policy
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/delete_policy.rb', line 31 def delete_policy(arguments = {}) raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id] method = Elasticsearch::API::HTTP_DELETE path = Elasticsearch::API::Utils.__pathify "_ilm/policy", Elasticsearch::API::Utils.__escape(arguments[:policy_id]) params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#explain(arguments = {}) ⇒ Object
Shows an index’s current lifecycle status
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/explain.rb', line 31 def explain(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] index = Elasticsearch::API::Utils.__escape(arguments.delete(:index)) method = Elasticsearch::API::HTTP_GET path = Elasticsearch::API::Utils.__pathify index, "_ilm/explain" params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#explain_lifecycle(arguments = {}) ⇒ Object
Retrieves information about the index’s current lifecycle state, such as the currently executing phase, action, and step.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/explain_lifecycle.rb', line 32 def explain_lifecycle(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] headers = arguments.delete(:headers) || {} arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = "#{Elasticsearch::API::Utils.__listify(_index)}/_ilm/explain" params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body, headers).body end |
#get_lifecycle(arguments = {}) ⇒ Object
Returns the specified policy definition. Includes the policy version and last modified date.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_lifecycle.rb', line 30 def get_lifecycle(arguments = {}) headers = arguments.delete(:headers) || {} arguments = arguments.clone _policy = arguments.delete(:policy) method = Elasticsearch::API::HTTP_GET path = if _policy "_ilm/policy/#{Elasticsearch::API::Utils.__listify(_policy)}" else "_ilm/policy" end params = {} body = nil perform_request(method, path, params, body, headers).body end |
#get_policy(arguments = {}) ⇒ Object
Retrieves a lifecycle policy
31 32 33 34 35 36 37 38 39 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_policy.rb', line 31 def get_policy(arguments = {}) method = Elasticsearch::API::HTTP_GET path = Elasticsearch::API::Utils.__pathify "_ilm/policy", Elasticsearch::API::Utils.__escape(arguments[:policy_id]) params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#get_status(arguments = {}) ⇒ Object
Retrieves the current index lifecycle management (ILM) status.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_status.rb', line 29 def get_status(arguments = {}) headers = arguments.delete(:headers) || {} arguments = arguments.clone method = Elasticsearch::API::HTTP_GET path = "_ilm/status" params = {} body = nil perform_request(method, path, params, body, headers).body end |
#migrate_to_data_tiers(arguments = {}) ⇒ Object
Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb', line 31 def migrate_to_data_tiers(arguments = {}) headers = arguments.delete(:headers) || {} arguments = arguments.clone method = Elasticsearch::API::HTTP_POST path = "_ilm/migrate_to_data_tiers" params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body, headers).body end |
#move_to_step(arguments = {}) ⇒ Object
Manually moves an index into the specified step and executes that step.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/move_to_step.rb', line 31 def move_to_step(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] headers = arguments.delete(:headers) || {} arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = "_ilm/move/#{Elasticsearch::API::Utils.__listify(_index)}" params = {} body = arguments[:body] perform_request(method, path, params, body, headers).body end |
#put_lifecycle(arguments = {}) ⇒ Object
Creates a lifecycle policy
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/put_lifecycle.rb', line 31 def put_lifecycle(arguments = {}) raise ArgumentError, "Required argument 'policy' missing" unless arguments[:policy] headers = arguments.delete(:headers) || {} arguments = arguments.clone _policy = arguments.delete(:policy) method = Elasticsearch::API::HTTP_PUT path = "_ilm/policy/#{Elasticsearch::API::Utils.__listify(_policy)}" params = {} body = arguments[:body] perform_request(method, path, params, body, headers).body end |
#put_policy(arguments = {}) ⇒ Object
Register a new watch in or update an existing one
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/put_policy.rb', line 32 def put_policy(arguments = {}) raise ArgumentError, "Required argument 'policy_id' missing" unless arguments[:policy_id] raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] method = Elasticsearch::API::HTTP_PUT path = Elasticsearch::API::Utils.__pathify "_ilm/policy", Elasticsearch::API::Utils.__escape(arguments[:policy_id]) params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#remove_policy(arguments = {}) ⇒ Object
Removes the assigned lifecycle policy and stops managing the specified index
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/remove_policy.rb', line 30 def remove_policy(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] headers = arguments.delete(:headers) || {} arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = "#{Elasticsearch::API::Utils.__listify(_index)}/_ilm/remove" params = {} body = nil perform_request(method, path, params, body, headers).body end |
#retry(arguments = {}) ⇒ Object
Retries executing the policy for an index that is in the ERROR step.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/retry.rb', line 30 def retry(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] headers = arguments.delete(:headers) || {} arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = "#{Elasticsearch::API::Utils.__listify(_index)}/_ilm/retry" params = {} body = nil perform_request(method, path, params, body, headers).body end |
#retry_policy(arguments = {}) ⇒ Object
Retry executing the policy for an index that is in the ERROR step
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/retry_policy.rb', line 31 def retry_policy(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] method = Elasticsearch::API::HTTP_POST index = Elasticsearch::API::Utils.__escape(arguments.delete(:index)) path = Elasticsearch::API::Utils.__pathify index, "_ilm/retry" params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#start(arguments = {}) ⇒ Object
Start the index lifecycle management (ILM) plugin.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/start.rb', line 29 def start(arguments = {}) headers = arguments.delete(:headers) || {} arguments = arguments.clone method = Elasticsearch::API::HTTP_POST path = "_ilm/start" params = {} body = nil perform_request(method, path, params, body, headers).body end |
#stop(arguments = {}) ⇒ Object
Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/elasticsearch/xpack/api/actions/index_lifecycle_management/stop.rb', line 29 def stop(arguments = {}) headers = arguments.delete(:headers) || {} arguments = arguments.clone method = Elasticsearch::API::HTTP_POST path = "_ilm/stop" params = {} body = nil perform_request(method, path, params, body, headers).body end |