Class: WavefrontDisplay::Source
- Defined in:
- lib/wavefront-cli/display/source.rb
Overview
Format human-readable output for webhooks.
Constant Summary
Constants included from WavefrontCli::Constants
WavefrontCli::Constants::DEFAULT_OPTS, WavefrontCli::Constants::HUMAN_TIME_FORMAT, WavefrontCli::Constants::HUMAN_TIME_FORMAT_MS
Instance Attribute Summary
Attributes inherited from Base
#data, #hide_blank, #indent, #indent_step, #indent_str, #kw, #options
Instance Method Summary collapse
- #do_list ⇒ Object
- #do_list_brief ⇒ Object
-
#drop_cluster_sources ⇒ Object
Filter out the Wavefront cluster sources.
Methods inherited from Base
#_two_columns, #do_delete, #do_import, #do_tag_add, #do_tag_clear, #do_tag_delete, #do_tag_set, #do_tags, #do_undelete, #drop_fields, #friendly_name, #human_time, #indent_wrap, #initialize, #key_width, #long_output, #multicolumn, #print_array, #print_line, #readable_time, #run, #run_error, #set_indent, #terse_output
Constructor Details
This class inherits a constructor from WavefrontDisplay::Base
Instance Method Details
#do_list ⇒ Object
8 9 10 11 |
# File 'lib/wavefront-cli/display/source.rb', line 8 def do_list drop_cluster_sources long_output end |
#do_list_brief ⇒ Object
13 14 15 16 |
# File 'lib/wavefront-cli/display/source.rb', line 13 def do_list_brief drop_cluster_sources terse_output(:id, :description) end |
#drop_cluster_sources ⇒ Object
Filter out the Wavefront cluster sources
20 21 22 23 24 |
# File 'lib/wavefront-cli/display/source.rb', line 20 def drop_cluster_sources data.sort_by! { |k, _v| k } return if [:all] data.delete_if { |k| k.id =~ /prod-[\da-f]{2}-/ } end |