Class: WavefrontCommandQuery

Inherits:
WavefrontCommandBase show all
Defined in:
lib/wavefront-cli/commands/query.rb

Overview

Define the query command.

Instance Method Summary collapse

Methods inherited from WavefrontCommandBase

#commands, #common_options, #docopt, #global_options, #opt_row, #option_column_width, #options, #sdk_class, #sdk_file, #tag_commands, #word

Instance Method Details

#_commandsObject



10
11
12
13
14
15
16
17
# File 'lib/wavefront-cli/commands/query.rb', line 10

def _commands
  ['aliases [-DV] [-c file] [-P profile]',
   "#{CMN} [-g granularity] [-s time] [-e time] [-f format] " \
         '[-WikvO] [-S mode] [-N name] [-p points] <query>',
   "raw #{CMN} [-H host] [-s time] [-e time] [-f format] <metric>",
   "run #{CMN} [-g granularity] [-s time] [-e time] [-f format] " \
         '[-WkivO] [-S mode] [-N name] [-p points] <alias>']
end

#_optionsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/wavefront-cli/commands/query.rb', line 19

def _options
  [common_options,
   '-g, --granularity=STRING  query granularity (d, h, m, or s)',
   '-s, --start=TIME          start of query window',
   '-e, --end=TIME            end of query window',
   '-N, --name=STRING         name identifying query',
   '-p, --points=INTEGER      maximum number of points to return',
   '-i, --inclusive           include matching series with no ' \
   'points inside the query window',
   '-v, --events              include events for matching series',
   '-S, --summarize=STRING    summarization strategy for bucketing ' \
   'points (mean, median, min, max, sum, count, last, first)',
   '-O, --obsolete            include metrics unreported for > 4 weeks',
   '-H, --host=STRING         host or source to query on',
   '-f, --format=STRING       output format',
   '-k, --nospark             do not show sparkline',
   '-W, --nowarn              do not show API warning messages']
end

#descriptionObject



6
7
8
# File 'lib/wavefront-cli/commands/query.rb', line 6

def description
  'query the Wavefront API'
end

#postscriptObject



38
39
40
41
42
# File 'lib/wavefront-cli/commands/query.rb', line 38

def postscript
  'The query command has an additional output format. Using ' \
  "'-f wavefront' produces output suitable for feeding back into a " \
  'proxy.'.cmd_fold(TW, 0)
end