Class: Awful::Kinesis
  
  
  
  
  
    - Inherits:
 
    - 
      Cli
      
        
        show all
      
    
 
  
  
  
  
  
  
  
  
  
  
    - Defined in:
 
    - lib/awful/kinesis.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 
  
  
  
  
    
      
55
56
57
58
59 
     | 
    
      # File 'lib/awful/kinesis.rb', line 55
def dump(name)
  kinesis.describe_stream(stream_name: name).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 
     | 
    
      # File 'lib/awful/kinesis.rb', line 38
def ls
  paginate_streams(:stream_names) do |start|
    kinesis.list_streams(exclusive_start_stream_name: start)
  end.output do |streams|
    if options[:long]
      print_table streams.map { |name|
        s = kinesis.describe_stream(stream_name: name).stream_description
        op = s.has_more_shards ? '>' : ''
        [s.stream_name, op + s.shards.count.to_s, color(s.stream_status), s.encryption_type, s.retention_period_hours.to_s + 'h', s.stream_creation_timestamp]
      }
    else
      puts streams
    end
  end
end
     |