Module: WavefrontCli::Mixin::Tag

Included in:
Alert, Dashboard, DerivedMetric, Event, Source
Defined in:
lib/wavefront-cli/command_mixins/tag.rb

Overview

Standard tag commands

Instance Method Summary collapse

Instance Method Details

#do_tag_addObject



13
14
15
# File 'lib/wavefront-cli/command_mixins/tag.rb', line 13

def do_tag_add
  wf.tag_add(options[:'<id>'], options[:'<tag>'].first)
end

#do_tag_clearObject



25
26
27
# File 'lib/wavefront-cli/command_mixins/tag.rb', line 25

def do_tag_clear
  wf.tag_set(options[:'<id>'], [])
end

#do_tag_deleteObject



17
18
19
# File 'lib/wavefront-cli/command_mixins/tag.rb', line 17

def do_tag_delete
  wf.tag_delete(options[:'<id>'], options[:'<tag>'].first)
end

#do_tag_pathsearchObject



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/wavefront-cli/command_mixins/tag.rb', line 29

def do_tag_pathsearch
  require 'wavefront-sdk/search'
  wfs = Wavefront::Search.new(mk_creds, mk_opts)

  query = { key: 'tagpath',
            value: options[:'<word>'],
            matchingMethod: 'TAGPATH',
            negated: false }

  wfs.search(search_key, query, range_hash)
end

#do_tag_setObject



21
22
23
# File 'lib/wavefront-cli/command_mixins/tag.rb', line 21

def do_tag_set
  wf.tag_set(options[:'<id>'], options[:'<tag>'])
end

#do_tagsObject



9
10
11
# File 'lib/wavefront-cli/command_mixins/tag.rb', line 9

def do_tags
  wf.tags(options[:'<id>'])
end