wavefront-sdk 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY.md +8 -1
- data/lib/wavefront-sdk/core/response.rb +8 -3
- data/lib/wavefront-sdk/defs/version.rb +1 -1
- data/lib/wavefront-sdk/paginator/base.rb +3 -3
- data/lib/wavefront-sdk/user.rb +7 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16241d55b6fb10f87108746dc4af0a6d431a4af460c0d22298560cee4bd87bae
|
4
|
+
data.tar.gz: fd0744dee1842f0b216cfb2ebbf4050de3ccbc850a21960bc31ee609a440def6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41986bead8043774efc06103d7d3ac577a311a94edf46d841bbed6d6959222babd6332aa9673a83abd3bb31ee6254b8781f693ee4d1bcc6190a90cbfccd4fc05
|
7
|
+
data.tar.gz: bbcdaf7a2b65c86c207a3b602f9eda625458520bf783490aa7a05c2c81ee6d1202fed397ee24927b2f9a51840f09bff46fa22b5c8b3db050b8e8a40b18bbe6f3
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## 2.0.
|
3
|
+
## 2.0.1 (22/10/2018)
|
4
|
+
* Bugfix on response types.
|
5
|
+
|
6
|
+
## 2.0.0 (20/10/2018)
|
4
7
|
* Remove `#everything` method from all classes. (Breaking change.)
|
5
8
|
* Calling any method which takes the `limit` argument with `limit`
|
6
9
|
set to `:all` will automatically handle pagination, fetching all
|
@@ -38,6 +41,10 @@
|
|
38
41
|
a hash of proxy *and* API credentials. This is useful for passing
|
39
42
|
to `Wavefront::Write` as it means all writers will work without
|
40
43
|
modifying your code.
|
44
|
+
* Make `Wavefront::Response#next_item` work with sources. (Or any
|
45
|
+
future class which uses a cursor rather than an offset.)
|
46
|
+
* Make `Wavefront::User` return a response object containing an
|
47
|
+
`items` element, like every other class.
|
41
48
|
|
42
49
|
## 1.6.2 (22/08/2018)
|
43
50
|
* Drop log priority of write class messages.
|
@@ -66,14 +66,19 @@ module Wavefront
|
|
66
66
|
def more_items?
|
67
67
|
return false unless response.key?(:moreItems)
|
68
68
|
!!response.moreItems
|
69
|
+
rescue StandardError
|
70
|
+
false
|
69
71
|
end
|
70
72
|
|
71
|
-
# On paginated output, the offset of the next item, or nil.
|
72
|
-
#
|
73
|
+
# On paginated output, the offset of the next item, or nil. For
|
74
|
+
# classes which use a cursor rather than an offset (Source),
|
75
|
+
# that.
|
76
|
+
# @return [Integer,String,Nil]
|
73
77
|
#
|
74
78
|
def next_item
|
75
79
|
return nil unless more_items?
|
76
|
-
|
80
|
+
return response.cursor if response.respond_to?(:cursor)
|
81
|
+
response.offset + response.limit
|
77
82
|
rescue StandardError
|
78
83
|
nil
|
79
84
|
end
|
@@ -1 +1 @@
|
|
1
|
-
WF_SDK_VERSION = '2.0.
|
1
|
+
WF_SDK_VERSION = '2.0.1'.freeze
|
@@ -58,9 +58,9 @@ module Wavefront
|
|
58
58
|
def limit_and_offset(args)
|
59
59
|
ret = { offset: nil, limit: nil }
|
60
60
|
|
61
|
-
args.select { |a| a.is_a?(Hash) }.each_with_object(ret) do |arg|
|
62
|
-
|
63
|
-
|
61
|
+
args.select { |a| a.is_a?(Hash) }.each_with_object(ret) do |arg, a|
|
62
|
+
a[:limit] = arg[:limit] if arg.key?(:limit)
|
63
|
+
a[:offset] = arg[:offset] if arg.key?(:offset)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
data/lib/wavefront-sdk/user.rb
CHANGED
@@ -88,7 +88,13 @@ module Wavefront
|
|
88
88
|
# consistent with others in the future.
|
89
89
|
#
|
90
90
|
def response_shim(body, status)
|
91
|
-
|
91
|
+
items = JSON.parse(body)
|
92
|
+
|
93
|
+
{ response: { items: items,
|
94
|
+
offset: 0,
|
95
|
+
limit: items.size,
|
96
|
+
totalItems: items.size,
|
97
|
+
modeItems: false },
|
92
98
|
status: { result: status == 200 ? 'OK' : 'ERROR',
|
93
99
|
message: '',
|
94
100
|
code: status } }.to_json
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wavefront-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Fisher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -240,7 +240,6 @@ files:
|
|
240
240
|
- lib/wavefront-sdk/writers/socket.rb
|
241
241
|
- lib/wavefront-sdk/writers/summary.rb
|
242
242
|
- lib/wavefront_sdk.rb
|
243
|
-
- pkg/wavefront-client-3.5.0.gem
|
244
243
|
- spec/.rubocop.yml
|
245
244
|
- spec/spec_helper.rb
|
246
245
|
- spec/wavefront-sdk/alert_spec.rb
|