Class: WavefrontDisplay::Source
- Defined in:
- lib/wavefront-cli/display/source.rb
Overview
Format human-readable output for sources.
Constant Summary
Constants included from WavefrontCli::Constants
WavefrontCli::Constants::ALL_PAGE_SIZE, WavefrontCli::Constants::DEFAULT_CONFIG, WavefrontCli::Constants::DEFAULT_OPTS, WavefrontCli::Constants::HUMAN_TIME_FORMAT, WavefrontCli::Constants::HUMAN_TIME_FORMAT_MS
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #do_list ⇒ Object
- #do_list_brief ⇒ Object
- #do_search_brief ⇒ Object
-
#drop_cluster_sources ⇒ Object
Filter out the Wavefront cluster sources.
-
#drop_hidden_sources ⇒ Object
Filter out any sources with ‘hidden=true’.
- #massage_data ⇒ Object
Methods inherited from Base
#_prioritize_keys, #do_delete, #do_import, #do_list_fields, #do_queries, #do_search, #do_tag_add, #do_tag_clear, #do_tag_delete, #do_tag_set, #do_tags, #do_undelete, #drop_fields, #filter_data, #filter_fields_as_arr, #friendly_name, #human_time, #initialize, #key_width, #long_output, #multicolumn, #pagination_line, #prioritize_keys, #priority_keys, #readable_time, #readable_time_arr, #run, #run_error, #run_list, #run_search, #time_formats
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 massage_data long_output end |
#do_list_brief ⇒ Object
13 14 15 16 |
# File 'lib/wavefront-cli/display/source.rb', line 13 def do_list_brief massage_data multicolumn(:id, :description) end |
#do_search_brief ⇒ Object
24 25 26 |
# File 'lib/wavefront-cli/display/source.rb', line 24 def do_search_brief multicolumn(:id) end |
#drop_cluster_sources ⇒ Object
Filter out the Wavefront cluster sources. Don’t sort them, or using offset and cursor becomes confusing.
37 38 39 |
# File 'lib/wavefront-cli/display/source.rb', line 37 def drop_cluster_sources data.delete_if { |k| k.id =~ /prod-[\da-f]{2}-/ } end |
#drop_hidden_sources ⇒ Object
Filter out any sources with ‘hidden=true’
30 31 32 |
# File 'lib/wavefront-cli/display/source.rb', line 30 def drop_hidden_sources data.delete_if { |k| k.['hidden'] == true } end |
#massage_data ⇒ Object
18 19 20 21 22 |
# File 'lib/wavefront-cli/display/source.rb', line 18 def massage_data return if [:all] drop_cluster_sources drop_hidden_sources end |