class WavefrontDisplay::Dashboard
Format human-readable output for dashboards.
Public Instance Methods
do_acls()
click to toggle source
# File lib/wavefront-cli/display/dashboard.rb, line 41 def do_acls data.each do |dash| display_acl('view and modify', dash[:modifyAcl]) display_acl('view', dash[:viewAcl]) end end
do_describe()
click to toggle source
# File lib/wavefront-cli/display/dashboard.rb, line 14 def do_describe drop_fields(:parameterDetails) readable_time(:createdEpochMillis, :updatedEpochMillis) data[:sections] = data[:sections].map { |s| s[:name] } long_output end
do_favs()
click to toggle source
# File lib/wavefront-cli/display/dashboard.rb, line 30 def do_favs if data.empty? puts 'No favourites.' else multicolumn(:id) end end
do_list()
click to toggle source
# File lib/wavefront-cli/display/dashboard.rb, line 10 def do_list long_output end
do_queries()
click to toggle source
# File lib/wavefront-cli/display/dashboard.rb, line 21 def do_queries if options[:brief] @data = data.to_h.values.flatten.map { |q| { query: q } } multicolumn(:query) else long_output end end
Private Instance Methods
display_acl(title, acl_data)
click to toggle source
# File lib/wavefront-cli/display/dashboard.rb, line 54 def display_acl(title, acl_data) puts title if acl_data.empty? puts ' <none>' else acl_data.each { |e| puts format(' %<name>s (%<id>s)', e) } end end