Class: WavefrontCli::Metric

Inherits:
Base
  • Object
show all
Defined in:
lib/wavefront-cli/metric.rb

Overview

CLI coverage for the v2 ‘metric’ API.

Constant Summary

Constants included from Constants

Constants::ALL_PAGE_SIZE, Constants::DEFAULT_CONFIG, Constants::DEFAULT_OPTS, Constants::HUMAN_TIME_FORMAT, Constants::HUMAN_TIME_FORMAT_MS

Instance Attribute Summary

Attributes inherited from Base

#klass, #klass_word, #options, #wf

Instance Method Summary collapse

Methods inherited from Base

#_sdk_class, #cannot_noop!, #check_status, #conds_to_query, #dispatch, #display, #display_api_error, #display_no_api_response, #do_delete, #do_import, #do_list, #do_search, #do_undelete, #do_update, #extract_values, #failed_validation_message, #format_var, #handle_error, #handle_response, #hcl_fields, #import_to_create, #initialize, #load_display_class, #load_file, #load_from_stdin, #mk_creds, #mk_opts, #no_api_response, #ok_exit, #one_or_all, #options_and_exit, #parseable_output, #range_hash, #run, #search_key, #smart_delete, #smart_delete_message, #validate_id, #validate_input, #validate_opts, #validate_tags, #validator_exception, #validator_method

Constructor Details

This class inherits a constructor from WavefrontCli::Base

Instance Method Details

#do_describeObject

There’s an extra describe flag that other classes don’t have.



11
12
13
# File 'lib/wavefront-cli/metric.rb', line 11

def do_describe
  wf.detail(options[:'<metric>'], options[:glob] || [], options[:offset])
end

#extra_validationObject



15
16
17
18
19
20
21
22
# File 'lib/wavefront-cli/metric.rb', line 15

def extra_validation
  return unless options[:'<metric>']
  begin
    wf_metric_name?(options[:'<metric>'])
  rescue Wavefront::Exception::InvalidMetricName
    abort "'#{options[:'<metric>']}' is not a valid metric."
  end
end