wavefront-client 3.5.2 → 3.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9396cafd5d5f3e458c9147b3e381fc11f3dee48d
4
- data.tar.gz: 936de304d4419dd50a5c23dc0f6003e8f9e50841
3
+ metadata.gz: beeb02e2fa86d2049cf941fe782f4a57aff4320a
4
+ data.tar.gz: 1a7fc2bdf6fd1f8015856519daee209889199377
5
5
  SHA512:
6
- metadata.gz: 93c35116bd36d60d178289c31126c4743f6ff69e690782e0826ef25a3a0682d123762f6791acbd85e3415ad899fb854baa53a64dc79cbaa0262e65a10cecbe4d
7
- data.tar.gz: 478854bc64520703ea2cf5694b918c3f43fa2788a5699462407e9fe028c04496ebe77d9bc8f22eab1a82371489122f7e466bb3413e63048cfc2cf5e816bfc62a
6
+ metadata.gz: 0f3b60f1c518d9dae1cce42fe8b246c2f60d561008ef6ce941029db9d1ad029f61994e1fd102da4583729f574e2687b7fd22f9ef01affab80b6de1866cf9a25b
7
+ data.tar.gz: a3a604a315860308f795c813abfe45a3cd0cf9c9d50d8c85529429a5f854a0c2742b58f81bef024d2f9025c70096a10c62a968c46f3716f65cf6d7cf209c808d
data/bin/wavefront CHANGED
@@ -46,6 +46,7 @@ Global options:
46
46
  -c, --config=FILE path to configuration file [default: #{DEF_CF}]
47
47
  -P, --profile=NAME profile in configuration file [default: default]
48
48
  -D, --debug enable debug mode
49
+ -V, --verbose be verbose
49
50
  -h, --help show this message
50
51
  )
51
52
 
@@ -55,7 +56,7 @@ Global options:
55
56
  usage = {
56
57
  ts: %(
57
58
  Usage:
58
- #{ME} ts [-c file] [-P profile] [-E endpoint] [-t token] [-OD]
59
+ #{ME} ts [-c file] [-P profile] [-E endpoint] [-t token] [-ODV]
59
60
  [-S | -m | -H | -d] [-s time] [-e time] [-f format] [-p num]
60
61
  [-X bool] <query>
61
62
  #{global_opts}
@@ -81,7 +82,7 @@ Options:
81
82
 
82
83
  alerts: %(
83
84
  Usage:
84
- #{ME} alerts [-c file] [-P profile] [-E endpoint] [-t token]
85
+ #{ME} alerts [-c file] [-P profile] [-E endpoint] [-t token] [-V]
85
86
  [-f format] [-p tag] [ -s tag] <state>
86
87
  #{global_opts}
87
88
  Options:
@@ -108,7 +109,6 @@ Usage:
108
109
  #{global_opts}
109
110
  Options:
110
111
  -i, --instant create an instantaneous event
111
- -V, --verbose be verbose
112
112
  -s, --start=TIME time at which event begins
113
113
  -e, --end=TIME time at which event ends
114
114
  -l, --level=LEVEL level of event (#{EVENT_LEVELS.join(', ')})
@@ -139,7 +139,6 @@ Options:
139
139
  -m, --metric=STRING the metric path to which contents of a file will be
140
140
  assigned. If the file contains a metric name, the two
141
141
  will be concatenated
142
- -V, --verbose be verbose
143
142
 
144
143
  Files are whitespace separated, and fields can be defined with the -F
145
144
  option. Use 't' for timestamp; 'm' for metric name; 'v' for value
@@ -147,19 +146,19 @@ and 'T' for tags. Put 'T' last.
147
146
  ),
148
147
  source: %(
149
148
  Usage:
150
- #{ME} source list [-c file] [-P profile] [-E endpoint] [-t token]
149
+ #{ME} source list [-c file] [-P profile] [-E endpoint] [-t token] [-V]
151
150
  [-f format] [-T tag ...] [-at] [-s source] [-l limit] <pattern>
152
- #{ME} source show [-c file] [-P profile] [-E endpoint] [-t token]
151
+ #{ME} source show [-c file] [-P profile] [-E endpoint] [-t token] [-V]
153
152
  [-f format] <host> ...
154
153
  #{ME} source describe [-c file] [-P profile] [-E endpoint] [-t token]
155
- [-H host ... ] <description>
154
+ [-V] [-H host ... ] <description>
156
155
  #{ME} source undescribe [-c file] [-P profile] [-E endpoint] [-t token]
157
- [<host>] ...
156
+ [-V] [<host>] ...
158
157
  #{ME} source tag add [-c file] [-P profile] [-E endpoint] [-t token]
159
- [-H host ... ] <tag> ...
158
+ [-V] [-H host ... ] <tag> ...
160
159
  #{ME} source tag delete [-c file] [-P profile] [-E endpoint] [-t token]
161
- [-H host ... ] <tag> ...
162
- #{ME} source untag [-c file] [-P profile] [-E endpoint] [-t token]
160
+ [-V] [-H host ... ] <tag> ...
161
+ #{ME} source untag [-c file] [-P profile] [-E endpoint] [-t token] [-V]
163
162
  [<host>] ...
164
163
  #{ME} source --help
165
164
  #{global_opts}
@@ -10,7 +10,8 @@ class Wavefront::Cli::Sources < Wavefront::Cli
10
10
  attr_accessor :wf, :out_format, :show_hidden, :show_tags
11
11
 
12
12
  def setup_wf
13
- @wf = Wavefront::Metadata.new(options[:token])
13
+ @wf = Wavefront::Metadata.new(options[:token], options[:endpoint],
14
+ false, { verbose: options[:verbose] })
14
15
  end
15
16
 
16
17
  def run
@@ -16,6 +16,6 @@ See the License for the specific language governing permissions and
16
16
 
17
17
  module Wavefront
18
18
  class Client
19
- VERSION = "3.5.2"
19
+ VERSION = "3.5.3"
20
20
  end
21
21
  end
@@ -40,14 +40,16 @@ module Wavefront
40
40
  include Wavefront::Validators
41
41
  DEFAULT_PATH = '/api/manage/source/'.freeze
42
42
 
43
- attr_reader :headers, :host
43
+ attr_reader :headers, :host, :verbose, :endpoint
44
44
 
45
- def initialize(token, host=DEFAULT_HOST, debug=false)
45
+ def initialize(token, host=DEFAULT_HOST, debug=false, options = {})
46
46
  #
47
47
  # 'host' is the Wavefront API endpoint
48
48
  #
49
49
  @headers = {'X-AUTH-TOKEN' => token}
50
50
  @base_uri = URI::HTTPS.build(:host => host, :path => DEFAULT_PATH)
51
+ @endpoint = host
52
+ @verbose = options[:verbose] || false
51
53
  debug(debug)
52
54
  end
53
55
 
@@ -193,7 +195,7 @@ module Wavefront
193
195
  private
194
196
 
195
197
  def build_uri(path_ext = '', options = {})
196
- options[:host] ||= DEFAULT_HOST
198
+ options[:host] ||= endpoint
197
199
  options[:path] ||= DEFAULT_PATH
198
200
 
199
201
  URI::HTTPS.build(
@@ -204,14 +206,17 @@ module Wavefront
204
206
  end
205
207
 
206
208
  def call_get(uri)
209
+ puts "GET #{uri.to_s}" if verbose
207
210
  RestClient.get(uri.to_s, headers)
208
211
  end
209
212
 
210
213
  def call_delete(uri)
214
+ puts "DELETE #{uri.to_s}" if verbose
211
215
  RestClient.delete(uri.to_s, headers)
212
216
  end
213
217
 
214
218
  def call_post(uri, query = nil)
219
+ puts "POST #{uri.to_s} #{query}" if verbose
215
220
  h = headers
216
221
 
217
222
  RestClient.post(uri.to_s, query,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wavefront-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.2
4
+ version: 3.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Pointer
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2016-11-11 00:00:00.000000000 Z
16
+ date: 2016-11-23 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler