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
Delete a lifecycle policy.
-
#explain_lifecycle(arguments = {}) ⇒ Object
Explain the lifecycle state.
-
#get_lifecycle(arguments = {}) ⇒ Object
Get lifecycle policies.
-
#get_status(arguments = {}) ⇒ Object
Get the ILM status.
-
#migrate_to_data_tiers(arguments = {}) ⇒ Object
Migrate to data tiers routing.
-
#move_to_step(arguments = {}) ⇒ Object
Move to a lifecycle step.
-
#put_lifecycle(arguments = {}) ⇒ Object
Create or update a lifecycle policy.
-
#remove_policy(arguments = {}) ⇒ Object
Remove policies from an index.
-
#retry(arguments = {}) ⇒ Object
Retry a policy.
-
#start(arguments = {}) ⇒ Object
Start the ILM plugin.
-
#stop(arguments = {}) ⇒ Object
Stop the ILM plugin.
Instance Method Details
#delete_lifecycle(arguments = {}) ⇒ Object
Delete a lifecycle policy
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/delete_lifecycle.rb', line 34 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 = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#explain_lifecycle(arguments = {}) ⇒ Object
Explain the lifecycle state
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb', line 35 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
Get lifecycle policies
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 59 60 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb', line 34 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 = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_status(arguments = {}) ⇒ Object
Get the 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
Migrate 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
Move to a lifecycle 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 58 |
# 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 'body' missing" unless arguments[:body] 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
Create or update a lifecycle policy
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb', line 35 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 'body' missing" unless arguments[:body] 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 = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#remove_policy(arguments = {}) ⇒ Object
Remove policies from an 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
Retry a policy
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 ILM plugin
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/start.rb', line 33 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 = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#stop(arguments = {}) ⇒ Object
Stop the ILM plugin
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb', line 33 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 = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |