Class: Hoss::Index::Chef
- Inherits:
-
Object
- Object
- Hoss::Index::Chef
- Defined in:
- lib/hoss/index/chef.rb
Instance Attribute Summary collapse
-
#es ⇒ Object
readonly
Returns the value of attribute es.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#log ⇒ Object
readonly
Returns the value of attribute log.
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
-
#ridley ⇒ Object
readonly
Returns the value of attribute ridley.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Chef
constructor
A new instance of Chef.
Constructor Details
#initialize(opts) ⇒ Chef
Returns a new instance of Chef.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/hoss/index/chef.rb', line 13 def initialize opts @resources = opts[:chef_resources] @index = opts[:index_name] @log = opts[:logger] @ridley = Ridley.from_chef_config opts.knife @es = Elasticsearch::Client.new \ host: opts.elasticsearch_host, reload_connections: true, reload_on_failure: true, trace: opts.trace?, log: opts.trace? ? @log : nil log.debug \ event: 'reindex', opts: opts started = Time.now reindex log.info \ event: 'reindexed', elapsed: Time.now - started end |
Instance Attribute Details
#es ⇒ Object (readonly)
Returns the value of attribute es.
11 12 13 |
# File 'lib/hoss/index/chef.rb', line 11 def es @es end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
11 12 13 |
# File 'lib/hoss/index/chef.rb', line 11 def index @index end |
#log ⇒ Object (readonly)
Returns the value of attribute log.
11 12 13 |
# File 'lib/hoss/index/chef.rb', line 11 def log @log end |
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
11 12 13 |
# File 'lib/hoss/index/chef.rb', line 11 def resources @resources end |
#ridley ⇒ Object (readonly)
Returns the value of attribute ridley.
11 12 13 |
# File 'lib/hoss/index/chef.rb', line 11 def ridley @ridley end |