Class: Wakame::Actions::ShutdownVM
- Inherits:
-
Wakame::Action
- Object
- Wakame::Action
- Wakame::Actions::ShutdownVM
- Defined in:
- lib/wakame/actions/shutdown_vm.rb
Constant Summary
Constants included from AttributeHelper
AttributeHelper::CONVERT_CLASSES, AttributeHelper::PRIMITIVE_CLASSES
Instance Attribute Summary
Attributes inherited from Wakame::Action
Instance Method Summary collapse
-
#initialize(agent) ⇒ ShutdownVM
constructor
A new instance of ShutdownVM.
- #run ⇒ Object
Methods inherited from Wakame::Action
#actor_request, #agent_monitor, #all_subactions_complete?, #bind_triggered_rule, #flush_subactions, #master, #notes, #notify, #notify_queue, #on_canceled, #on_failed, #service_cluster, #status=, #subactions, #sync_actor_request, #trigger_action, #walk_subactions
Methods included from ThreadImmutable
#bind_thread, included, #target_thread, #target_thread?, #thread_check
Methods included from AttributeHelper
Constructor Details
#initialize(agent) ⇒ ShutdownVM
Returns a new instance of ShutdownVM.
4 5 6 |
# File 'lib/wakame/actions/shutdown_vm.rb', line 4 def initialize(agent) @agent = agent end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/wakame/actions/shutdown_vm.rb', line 8 def run if @agent.agent_id == master.master_local_agent_id Wakame.log.info("Skip to shutdown VM as the master is running on this node: #{@agent.agent_id}") return end VmManipulator.create.stop_instance(@agent[:instance_id]) end |