Sha256: e418dcef53975a8df6ec1e6e9af47eb8ade091550c2e796c32d0b74ae092f97c

Contents?: true

Size: 845 Bytes

Versions: 29

Compression:

Stored size: 845 Bytes

Contents

require "text-table"

class Lono::Sets
  class List
    include Lono::AwsServices

    def initialize(options={})
      @options = options
    end

    def run
      table = Text::Table.new
      table.head = ["Stack Set Name", "Status"]
      summaries = stack_sets_summaries
      summaries.each do |s|
        table.rows << [s.stack_set_name, s.status]
      end
      puts table
    end

  private
    def stack_sets_summaries
      next_token, summaries = :start, []
      while next_token
        o = {}
        o[:next_token] = next_token unless next_token == :start or next_token.nil?
        o[:status] = @options[:status].upcase if @options[:status] && @options[:status] != "all"
        resp = cfn.list_stack_sets(o)
        next_token = resp.next_token
        summaries += resp.summaries
      end
      summaries
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
lono-7.2.1 lib/lono/sets/list.rb
lono-7.2.0 lib/lono/sets/list.rb
lono-7.1.0 lib/lono/sets/list.rb
lono-7.0.5 lib/lono/sets/list.rb
lono-7.0.4 lib/lono/sets/list.rb
lono-7.0.3 lib/lono/sets/list.rb
lono-7.0.2 lib/lono/sets/list.rb
lono-7.0.1 lib/lono/sets/list.rb
lono-7.0.0 lib/lono/sets/list.rb