Class: Opsicle::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/opsicle/stack.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Stack

Returns a new instance of Stack.



4
5
6
# File 'lib/opsicle/stack.rb', line 4

def initialize(client)
  @client = client
end

Instance Method Details

#layer_name(layer_id) ⇒ Object



29
30
31
# File 'lib/opsicle/stack.rb', line 29

def layer_name(layer_id)
  layers.detect{ |layer| layer[:layer_id] == layer_id }[:name]
end

#layersObject



25
26
27
# File 'lib/opsicle/stack.rb', line 25

def layers
  @layers ||= @client.api_call('describe_layers', stack_id: @client.config.opsworks_config[:stack_id])[:layers]
end

#nameObject



17
18
19
# File 'lib/opsicle/stack.rb', line 17

def name
  stack_summary[:name]
end

#stack_idObject



21
22
23
# File 'lib/opsicle/stack.rb', line 21

def stack_id
  stack_summary[:stack_id]
end