Class: Nifty::Events::Opennebula::ExpirationEvent
- Includes:
- Utils::EventsCommon
- Defined in:
- lib/nifty/events/opennebula/expiration_event.rb
Overview
OpenNebula expiration event
Instance Attribute Summary collapse
-
#image_handler ⇒ Object
Returns the value of attribute image_handler.
-
#template_handler ⇒ Object
Returns the value of attribute template_handler.
Attributes inherited from Event
#client, #datastores, #parameters
Attributes inherited from Event
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(appliance, transfer_method, client, datastores, parameters) ⇒ ExpirationEvent
constructor
A new instance of ExpirationEvent.
- #run ⇒ Object
Methods included from Utils::EventsCommon
Constructor Details
#initialize(appliance, transfer_method, client, datastores, parameters) ⇒ ExpirationEvent
Returns a new instance of ExpirationEvent.
17 18 19 20 21 22 |
# File 'lib/nifty/events/opennebula/expiration_event.rb', line 17 def initialize(appliance, transfer_method, client, datastores, parameters) super(appliance, transfer_method, client, datastores, parameters) @image_handler = Nifty::Backends::Utils::Opennebula::ImageHandler.new(client) @template_handler = Nifty::Backends::Utils::Opennebula::TemplateHandler.new(client) end |
Instance Attribute Details
#image_handler ⇒ Object
Returns the value of attribute image_handler.
12 13 14 |
# File 'lib/nifty/events/opennebula/expiration_event.rb', line 12 def image_handler @image_handler end |
#template_handler ⇒ Object
Returns the value of attribute template_handler.
12 13 14 |
# File 'lib/nifty/events/opennebula/expiration_event.rb', line 12 def template_handler @template_handler end |
Class Method Details
.event? ⇒ Boolean
8 9 10 |
# File 'lib/nifty/events/opennebula/expiration_event.rb', line 8 def self.event? true end |
Instance Method Details
#run ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/nifty/events/opennebula/expiration_event.rb', line 25 def run logger.debug("Runnig event #{self.inspect}") expire_appliance(template_handler, image_handler, appliance, parameters) rescue Nifty::Errors::Backends::OpennebulaError, Nifty::Errors::ApiCallTimeoutError => ex fail Nifty::Errors::Events::EventError, ex end |