Class: Roark::AmiCreateWorkflow
- Inherits:
-
Object
- Object
- Roark::AmiCreateWorkflow
- Defined in:
- lib/roark/ami_create_workflow.rb
Instance Method Summary collapse
- #add_tags ⇒ Object
- #authorize_account_ids ⇒ Object
- #create_ami ⇒ Object
- #create_instance ⇒ Object
- #destroy_instance ⇒ Object
- #execute ⇒ Object
-
#initialize(args) ⇒ AmiCreateWorkflow
constructor
A new instance of AmiCreateWorkflow.
- #stop_instance ⇒ Object
- #wait_for_ami ⇒ Object
- #wait_for_instance ⇒ Object
- #wait_for_instance_to_stop ⇒ Object
Constructor Details
#initialize(args) ⇒ AmiCreateWorkflow
Returns a new instance of AmiCreateWorkflow.
4 5 6 7 8 9 10 11 |
# File 'lib/roark/ami_create_workflow.rb', line 4 def initialize(args) @account_ids = args[:account_ids] @ami = args[:ami] @tags = args[:tags] @parameters = args[:parameters] @template = args[:template] @logger = Roark.logger end |
Instance Method Details
#add_tags ⇒ Object
51 52 53 |
# File 'lib/roark/ami_create_workflow.rb', line 51 def @ami. @tags end |
#authorize_account_ids ⇒ Object
55 56 57 |
# File 'lib/roark/ami_create_workflow.rb', line 55 def @ami. @account_ids end |
#create_ami ⇒ Object
39 40 41 |
# File 'lib/roark/ami_create_workflow.rb', line 39 def create_ami @ami.create_ami end |
#create_instance ⇒ Object
22 23 24 25 |
# File 'lib/roark/ami_create_workflow.rb', line 22 def create_instance @ami.create_instance :parameters => @parameters, :template => @template end |
#destroy_instance ⇒ Object
47 48 49 |
# File 'lib/roark/ami_create_workflow.rb', line 47 def destroy_instance @ami.destroy_instance end |
#execute ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/roark/ami_create_workflow.rb', line 13 def execute %w(create_instance wait_for_instance stop_instance wait_for_instance_to_stop create_ami wait_for_ami destroy_instance add_tags authorize_account_ids).each do |m| response = self.send m.to_sym return response unless response.success? end Response.new :code => 0, :message => "AMI create workflow completed succesfully." end |
#stop_instance ⇒ Object
31 32 33 |
# File 'lib/roark/ami_create_workflow.rb', line 31 def stop_instance @ami.stop_instance end |
#wait_for_ami ⇒ Object
43 44 45 |
# File 'lib/roark/ami_create_workflow.rb', line 43 def wait_for_ami @ami.wait_for_ami end |
#wait_for_instance ⇒ Object
27 28 29 |
# File 'lib/roark/ami_create_workflow.rb', line 27 def wait_for_instance @ami.wait_for_instance end |
#wait_for_instance_to_stop ⇒ Object
35 36 37 |
# File 'lib/roark/ami_create_workflow.rb', line 35 def wait_for_instance_to_stop @ami.wait_for_instance_to_stop end |