Class: Awful::Firehose
  
  
  
  
  
    - Inherits:
- 
      Cli
      
        
        show all
      
    
    - Defined in:
- lib/awful/firehose.rb
 
  
    
      Constant Summary
      collapse
    
    
      
        - COLORS =
          
        
- {
  ACTIVE:   :green,
  DELETING: :red,
}
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  Methods inherited from Cli
  #initialize, #ll, #version
  
  Constructor Details
  
    This class inherits a constructor from Awful::Cli
  
 
  
    Instance Method Details
    
      
  
  
    #dump(name)  ⇒ Object 
  
  
  
  
    | 
56
57
58
59
60 | # File 'lib/awful/firehose.rb', line 56
def dump(name)
  firehose.describe_delivery_stream(delivery_stream_name: name).delivery_stream_description.output do |stream|
    puts YAML.dump(stringify_keys(stream.to_hash))
  end
end | 
 
    
      
  
  
    | 
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 | # File 'lib/awful/firehose.rb', line 38
def ls
  paginate_delivery_streams(:delivery_stream_names) do |start|
    firehose.list_delivery_streams(exclusive_start_delivery_stream_name: start)
  end.output do |streams|
    if options[:long]
      print_table streams.map { |name|
        s = firehose.describe_delivery_stream(delivery_stream_name: name).delivery_stream_description
        op = s.has_more_destinations ? '>' : ''
        [s.delivery_stream_name, op + s.destinations.count.to_s, color(s.delivery_stream_status), s.delivery_stream_type, 'v' + s.version_id.to_s, s.create_timestamp]
      }
    else
      puts streams
    end
  end
end |