Class: ElasticManager
- Inherits:
-
Object
- Object
- ElasticManager
- Defined in:
- lib/elastic_manager.rb
Overview
Main
Constant Summary
Constants included from Logging
Constants included from Config
Instance Method Summary collapse
-
#initialize ⇒ ElasticManager
constructor
A new instance of ElasticManager.
- #run ⇒ Object
Methods included from SnapDelete
#do_snapdelete, #snapdelete, #snapdelete_populate_indices
Methods included from Logging
configure_logger_for, #log, log_level, logger_for
Methods included from Delete
#delete, #delete_populate_indices, #do_delete
Methods included from Snapshot
#do_snapshot, #snapshot, #snapshot_populate_indices
Methods included from Chill
#chill, #chill_populate_indices, #do_chill
Methods included from Close
#close, #close_populate_indices, #do_close
Methods included from Open
#do_open, #open, #open_populate_indices
Methods included from Utils
#already?, #delete_without_snapshot?, #elastic_action_with_log, #fail_and_exit, #index_exist?, #json_parse, #make_index_name, #prechecks, #prepare_vars, #skip_index?, #true?
Methods included from Config
#check_settings, #env_parser, #load_from_env, #make_default_config, #validate_config
Constructor Details
#initialize ⇒ ElasticManager
Returns a new instance of ElasticManager.
29 30 31 32 33 |
# File 'lib/elastic_manager.rb', line 29 def initialize @config = load_from_env @elastic = Request::Elastic.new(@config) end |
Instance Method Details
#run ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/elastic_manager.rb', line 35 def run if @config['task'].casecmp('open').zero? open elsif @config['task'].casecmp('close').zero? close elsif @config['task'].casecmp('chill').zero? chill elsif @config['task'].casecmp('snapshot').zero? snapshot elsif @config['task'].casecmp('delete').zero? delete elsif @config['task'].casecmp('snapdelete').zero? snapdelete else fail_and_exit('wrong task') end end |