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

#acl_commands, #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
18
# File 'lib/wavefront-cli/commands/query.rb', line 10

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

#_optionsObject



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

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',
   '-F, --format-opts=STRING  comma-separated options to pass to ' \
                              'output formatter',
   '-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



41
42
43
44
45
46
47
48
# File 'lib/wavefront-cli/commands/query.rb', line 41

def postscript
  'The query command has an additional output format. Using ' \
  "'-f wavefront' produces output suitable for feeding back into a " \
  "proxy. Other output formats are 'yaml', 'json', 'ruby', "\
  "and 'csv'. CSV format options are 'headers' (print column headers); " \
  "'tagkeys' (print tags as key=value rather than value); and 'quote' " \
  '(force quoting of every CSV element).'.cmd_fold(TW, 0)
end