Class: Wakame::Actions::MigrateService
- Inherits:
-
Wakame::Action
- Object
- Wakame::Action
- Wakame::Actions::MigrateService
- Includes:
- Util
- Defined in:
- lib/wakame/actions/migrate_service.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(service_instance, dest_agent = nil) ⇒ MigrateService
constructor
A new instance of MigrateService.
- #run ⇒ Object
Methods included from Util
#arrange_agent, #deploy_configuration, #start_instance, #test_agent_candidate
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(service_instance, dest_agent = nil) ⇒ MigrateService
Returns a new instance of MigrateService.
9 10 11 12 |
# File 'lib/wakame/actions/migrate_service.rb', line 9 def initialize(service_instance, dest_agent=nil) @service_instance = service_instance @destination_agent = dest_agent end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/wakame/actions/migrate_service.rb', line 14 def run raise CancelActionError if @service_instance.status == Service::STATUS_MIGRATING EM. { @service_instance.update_status(Service::STATUS_MIGRATING) } prop = @service_instance.property if prop.duplicable clone_service(prop) flush_subactions trigger_action(StopService.new(@service_instance)) else trigger_action(StopService.new(@service_instance)) flush_subactions clone_service(prop) end flush_subactions end |