class WavefrontDisplay::Alert
Format human-readable output for alerts.
Public Instance Methods
do_affected_hosts()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 78 def do_affected_hosts if data == [nil] puts 'Alert event is not attached to any hosts.' else long_output end end
do_describe()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 30 def do_describe readable_time(:created, :lastProcessedMillis, :lastNotificationMillis, :createdEpochMillis, :updatedEpochMillis, :updated) drop_fields(:conditionQBEnabled, :displayExpressionQBEnabled, :displayExpressionQBSerialization) long_output end
do_firing()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 20 def do_firing readable_time_arr(:time) multicolumn(:id, :time, :name) end
do_history()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 39 def do_history drop_fields(:inTrash) long_output end
do_latest()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 53 def do_latest puts data.max end
do_list()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 10 def do_list long_output %i[id minutes target status tags hostsUsed condition displayExpression severity additionalInformation] end
do_list_brief()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 16 def do_list_brief multicolumn(:id, :status, :name) end
do_queries()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 66 def do_queries if options[:brief] multicolumn(:condition) else multicolumn(:id, :condition) end end
do_snooze()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 44 def do_snooze w = options[:time] ? "for #{options[:time]} seconds" : 'indefinitely' puts "Snoozed alert '#{options[:'<id>']}' #{w}." end
do_snoozed()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 25 def do_snoozed readable_time_arr(:time) multicolumn(:id, :time, :name) end
do_summary()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 57 def do_summary kw = data.keys.map(&:size).max + 2 data.sort.each do |k, v| next if v.zero? && !options[:all] puts format("%-#{kw}<key>s%<value>s", key: k, value: v) end end
do_unsnooze()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 49 def do_unsnooze puts "Unsnoozed alert '#{options[:'<id>']}'." end
do_version()
click to toggle source
# File lib/wavefront-cli/display/alert.rb, line 74 def do_version puts data.max end