Sha256: 32fa6e941c94a77122665fa01a1ea8d9f16854ef0f33ec34a061151b5110c44d

Contents?: true

Size: 834 Bytes

Versions: 20

Compression:

Stored size: 834 Bytes

Contents

module Opsicle
  class Stack

    def initialize(client)
      @client = client
    end

    def stack_summary(options={})
      # Only call the API again if you need to
      @stack_summary = nil if options[:reload]
      @deployment ||= @client.api_call('describe_stack_summary',
                                       :stack_id => @client.config.opsworks_config[:stack_id]
                                      )[:stack_summary]
    end
    private :stack_summary

    def name
      stack_summary[:name]
    end

    def stack_id
      stack_summary[:stack_id]
    end

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

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

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
opsicle-2.15.0 lib/opsicle/stack.rb
opsicle-2.14.2 lib/opsicle/stack.rb
opsicle-2.14.1 lib/opsicle/stack.rb
opsicle-2.14.0 lib/opsicle/stack.rb
opsicle-2.13.1 lib/opsicle/stack.rb
opsicle-2.13.0 lib/opsicle/stack.rb
opsicle-2.12.5 lib/opsicle/stack.rb
opsicle-2.12.3 lib/opsicle/stack.rb
opsicle-2.12.2 lib/opsicle/stack.rb
opsicle-2.12.1 lib/opsicle/stack.rb
opsicle-2.12.0 lib/opsicle/stack.rb
opsicle-2.11.3 lib/opsicle/stack.rb
opsicle-2.11.1 lib/opsicle/stack.rb
opsicle-2.11.0 lib/opsicle/stack.rb
opsicle-2.10.1 lib/opsicle/stack.rb
opsicle-2.10.0 lib/opsicle/stack.rb
opsicle-2.9.6 lib/opsicle/stack.rb
opsicle-2.9.4 lib/opsicle/stack.rb
opsicle-2.9.3 lib/opsicle/stack.rb
opsicle-2.9.2 lib/opsicle/stack.rb