class WavefrontCli::Metric

CLI coverage for the v2 'metric' API. Also includes commands which call the currently unstable 'chart' API.

Public Instance Methods

do_describe() click to toggle source

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

# File lib/wavefront-cli/metric.rb, line 14
def do_describe
  wf.detail(options[:'<metric>'], options[:glob] || [], options[:offset])
end
do_list_all() click to toggle source
# File lib/wavefront-cli/metric.rb, line 22
def do_list_all
  wf_chart_api_object.metrics_under('')
end
do_list_under() click to toggle source
# File lib/wavefront-cli/metric.rb, line 18
def do_list_under
  wf_chart_api_object.metrics_under(options[:'<metric>'])
end
extra_validation() click to toggle source
# File lib/wavefront-cli/metric.rb, line 26
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 ID."
  end
end

Private Instance Methods

wf_chart_api_object() click to toggle source
# File lib/wavefront-cli/metric.rb, line 38
def wf_chart_api_object
  require 'wavefront-sdk/unstable/chart'
  Wavefront::Unstable::Chart.new(mk_creds, mk_opts)
end