Class: Stackster::Stack
- Inherits:
-
Object
- Object
- Stackster::Stack
- Defined in:
- lib/stackster/stack.rb
Instance Method Summary collapse
- #attributes ⇒ Object
-
#create(args) ⇒ Object
ToDo - maybe in stack creater Rescure stack creation errors and verify entry is not saved.
-
#destroy ⇒ Object
To do - maybe in stack destroyer Rescue stack creation exception and only delete on success.
- #display ⇒ Object
- #events(limit = 3) ⇒ Object
-
#initialize(args) ⇒ Stack
constructor
A new instance of Stack.
- #instances ⇒ Object
- #outputs ⇒ Object
- #parameters ⇒ Object
- #resources ⇒ Object
- #status ⇒ Object
- #template ⇒ Object
-
#update(args) ⇒ Object
To Do - maybe in stack udpater Rescure stack creation errors and verify entry is not saved.
- #wait_for_stable ⇒ Object
Constructor Details
#initialize(args) ⇒ Stack
Returns a new instance of Stack.
12 13 14 15 16 17 18 |
# File 'lib/stackster/stack.rb', line 12 def initialize(args) @name = args[:name] @config = Config.new :config => args[:config], :logger => args[:logger] ||= StacksterLogger.new @entry = Entry.new :name => @name, :config => @config end |
Instance Method Details
#attributes ⇒ Object
49 50 51 |
# File 'lib/stackster/stack.rb', line 49 def attributes stack_reader.attributes end |
#create(args) ⇒ Object
ToDo - maybe in stack creater Rescure stack creation errors and verify entry is not saved
22 23 24 25 26 27 |
# File 'lib/stackster/stack.rb', line 22 def create(args) @template_file = args[:template] @entry.set_attributes args[:attributes] stack_creater.create @entry.save end |
#destroy ⇒ Object
To do - maybe in stack destroyer Rescue stack creation exception and only delete on success
40 41 42 43 |
# File 'lib/stackster/stack.rb', line 40 def destroy stack_destroyer.destroy @entry.delete_attributes end |
#display ⇒ Object
45 46 47 |
# File 'lib/stackster/stack.rb', line 45 def display stack_formater.display end |
#events(limit = 3) ⇒ Object
61 62 63 |
# File 'lib/stackster/stack.rb', line 61 def events(limit=3) stack_reader.events limit end |
#instances ⇒ Object
65 66 67 |
# File 'lib/stackster/stack.rb', line 65 def instances stack_reader.instances end |
#outputs ⇒ Object
53 54 55 |
# File 'lib/stackster/stack.rb', line 53 def outputs stack_reader.outputs end |
#parameters ⇒ Object
77 78 79 |
# File 'lib/stackster/stack.rb', line 77 def parameters stack_reader.parameters end |
#resources ⇒ Object
69 70 71 |
# File 'lib/stackster/stack.rb', line 69 def resources stack_reader.resources end |
#status ⇒ Object
57 58 59 |
# File 'lib/stackster/stack.rb', line 57 def status stack_reader.status end |
#template ⇒ Object
73 74 75 |
# File 'lib/stackster/stack.rb', line 73 def template stack_reader.template end |
#update(args) ⇒ Object
To Do - maybe in stack udpater Rescure stack creation errors and verify entry is not saved
31 32 33 34 35 36 |
# File 'lib/stackster/stack.rb', line 31 def update(args) @template_body = template @entry.set_attributes args[:attributes] stack_updater.update_stack_if_parameters_changed args[:attributes] @entry.save end |
#wait_for_stable ⇒ Object
81 82 83 |
# File 'lib/stackster/stack.rb', line 81 def wait_for_stable stack_status.wait_for_stable end |