wavefront-client 3.5.1 → 3.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wavefront/cli/sources.rb +2 -2
- data/lib/wavefront/client/version.rb +1 -1
- data/lib/wavefront/metadata.rb +11 -5
- data/spec/wavefront/metadata_spec.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9396cafd5d5f3e458c9147b3e381fc11f3dee48d
|
4
|
+
data.tar.gz: 936de304d4419dd50a5c23dc0f6003e8f9e50841
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c35116bd36d60d178289c31126c4743f6ff69e690782e0826ef25a3a0682d123762f6791acbd85e3415ad899fb854baa53a64dc79cbaa0262e65a10cecbe4d
|
7
|
+
data.tar.gz: 478854bc64520703ea2cf5694b918c3f43fa2788a5699462407e9fe028c04496ebe77d9bc8f22eab1a82371489122f7e466bb3413e63048cfc2cf5e816bfc62a
|
@@ -54,7 +54,7 @@ class Wavefront::Cli::Sources < Wavefront::Cli
|
|
54
54
|
|
55
55
|
q[:lastEntityId] = start if start
|
56
56
|
|
57
|
-
display_data(
|
57
|
+
display_data(wf.show_sources(q), 'list_source')
|
58
58
|
end
|
59
59
|
|
60
60
|
def describe_handler(hosts, desc)
|
@@ -113,7 +113,7 @@ class Wavefront::Cli::Sources < Wavefront::Cli
|
|
113
113
|
def show_source_handler(sources)
|
114
114
|
sources.each do |s|
|
115
115
|
begin
|
116
|
-
result =
|
116
|
+
result = wf.show_source(s)
|
117
117
|
rescue RestClient::ResourceNotFound
|
118
118
|
puts "Source '#{s}' not found."
|
119
119
|
next
|
data/lib/wavefront/metadata.rb
CHANGED
@@ -18,6 +18,7 @@ require "wavefront/client/version"
|
|
18
18
|
require "wavefront/constants"
|
19
19
|
require "wavefront/exception"
|
20
20
|
require 'wavefront/validators'
|
21
|
+
require 'wavefront/mixins'
|
21
22
|
require 'rest_client'
|
22
23
|
require 'uri'
|
23
24
|
require 'logger'
|
@@ -119,10 +120,13 @@ module Wavefront
|
|
119
120
|
|
120
121
|
def show_sources(params = {})
|
121
122
|
#
|
122
|
-
#
|
123
|
+
# Return a list of sources as a Ruby object. Maps to
|
123
124
|
# GET /api/manage/source
|
124
125
|
# call it with a hash as described in the Wavefront API docs.
|
125
126
|
#
|
127
|
+
# See the Wavefront API docs for the format of the returned
|
128
|
+
# object.
|
129
|
+
#
|
126
130
|
# At the time of writing, supported paramaters are:
|
127
131
|
# lastEntityId (string)
|
128
132
|
# desc (bool)
|
@@ -152,16 +156,18 @@ module Wavefront
|
|
152
156
|
end
|
153
157
|
end
|
154
158
|
|
155
|
-
call_get(build_uri(nil, query: hash_to_qs(params)))
|
159
|
+
JSON.parse(call_get(build_uri(nil, query: hash_to_qs(params))))
|
156
160
|
end
|
157
161
|
|
158
162
|
def show_source(source)
|
159
163
|
#
|
160
|
-
# return information about a single source. Maps to
|
161
|
-
# GET /api/manage/source/{source}
|
164
|
+
# return information about a single source as a Ruby object. Maps to
|
165
|
+
# GET /api/manage/source/{source}.
|
166
|
+
#
|
167
|
+
# See the Wavefront API docs for the structure of the object.
|
162
168
|
#
|
163
169
|
fail Wavefront::Exception::InvalidSource unless valid_source?(source)
|
164
|
-
call_get(build_uri(source))
|
170
|
+
JSON.parse(call_get(build_uri(source)))
|
165
171
|
end
|
166
172
|
|
167
173
|
def set_description(source, desc)
|
@@ -90,6 +90,7 @@ describe Wavefront::Metadata do
|
|
90
90
|
expect(RestClient).to receive(:get).with(
|
91
91
|
concat_url(host, path, '?'), wf.headers
|
92
92
|
)
|
93
|
+
expect(JSON).to receive(:parse)
|
93
94
|
wf.show_sources
|
94
95
|
end
|
95
96
|
|
@@ -97,6 +98,7 @@ describe Wavefront::Metadata do
|
|
97
98
|
expect(RestClient).to receive(:get).with(
|
98
99
|
concat_url(host, path, '?limit=100&pattern=test-*'), wf.headers
|
99
100
|
)
|
101
|
+
expect(JSON).to receive(:parse)
|
100
102
|
wf.show_sources({ limit: 100, pattern: 'test-*' })
|
101
103
|
end
|
102
104
|
|
@@ -132,6 +134,7 @@ describe Wavefront::Metadata do
|
|
132
134
|
expect(RestClient).to receive(:get).with(
|
133
135
|
concat_url(host, path, 'mysource'), wf.headers
|
134
136
|
)
|
137
|
+
expect(JSON).to receive(:parse)
|
135
138
|
wf.show_source('mysource')
|
136
139
|
end
|
137
140
|
|
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.
|
4
|
+
version: 3.5.2
|
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-
|
16
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: bundler
|