Class: Wakame::Command::MigrateService
- Inherits:
-
Object
- Object
- Wakame::Command::MigrateService
show all
- Includes:
- Wakame::Command
- Defined in:
- lib/wakame/command/migrate_service.rb
Instance Method Summary
collapse
included, #options=, #params
Instance Method Details
#run ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/wakame/command/migrate_service.rb', line 5
def run
svc = nil
svc = service_cluster.find_service(options["service_id"])
if svc.nil?
raise "Unknown Service ID: #{options["service_id"]}"
end
agent = nil
if options["agent_id"]
agent = master.agent_monitor.agent_pool.find_agent(options["agent_id"])
if agent.nil?
raise "Unknown Agent ID: #{options["agent_id"]}"
end
end
trigger_action(Wakame::Actions::MigrateService.new(svc, agent))
end
|