wavefront-sdk 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +5 -0
- data/lib/wavefront-sdk/alert.rb +1 -1
- data/lib/wavefront-sdk/defs/version.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- data/spec/wavefront-sdk/alert_spec.rb +73 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a349786f62cf725f7507812e5fc4a46d58a3c068102c7276cb7d680cac72a6d
|
4
|
+
data.tar.gz: bf493e285ec43adb60d7d21dfb1708c9eeab6018c177c8eb311b65779c7aaf46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf55a3a220fb68ce4a0312dc750012c585baf286ed3fec04445f859d7a95b9c8003c5fc78ed5a5916f3104fa4bea0ffef1c6610688186675e9e8874640d03eab
|
7
|
+
data.tar.gz: b567bc3ede851020424080891dfdc744d1c3b31efe2abc6eb8ee7d3184ffcb7ec0dd8796ee4b5b818d3e70a53094da3352c25e2619f5d244a48af2df9657544f
|
data/HISTORY.md
CHANGED
data/lib/wavefront-sdk/alert.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
WF_SDK_VERSION = '2.2.
|
1
|
+
WF_SDK_VERSION = '2.2.1'.freeze
|
data/spec/spec_helper.rb
CHANGED
@@ -14,6 +14,17 @@ ALERT_BODY = {
|
|
14
14
|
severity: 'INFO'
|
15
15
|
}.freeze
|
16
16
|
|
17
|
+
def search_body(val)
|
18
|
+
{ limit: 999,
|
19
|
+
offset: 0,
|
20
|
+
query: [
|
21
|
+
{ key: 'status',
|
22
|
+
value: val,
|
23
|
+
matchingMethod: 'EXACT' }
|
24
|
+
],
|
25
|
+
sort: { field: 'status', ascending: true } }
|
26
|
+
end
|
27
|
+
|
17
28
|
# Unit tests for Alert class
|
18
29
|
#
|
19
30
|
class WavefrontAlertTest < WavefrontTestBase
|
@@ -101,4 +112,66 @@ class WavefrontAlertTest < WavefrontTestBase
|
|
101
112
|
def test_summary
|
102
113
|
should_work(:summary, nil, 'summary')
|
103
114
|
end
|
115
|
+
|
116
|
+
def test_alerts_in_state
|
117
|
+
should_work(:alerts_in_state, 'some_state', '/api/v2/search/alert',
|
118
|
+
:post, {}, search_body('some_state'))
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_firing
|
122
|
+
should_work(:firing, nil, '/api/v2/search/alert', :post, {},
|
123
|
+
search_body('firing'))
|
124
|
+
end
|
125
|
+
|
126
|
+
def test_active
|
127
|
+
should_work(:firing, nil, '/api/v2/search/alert', :post, {},
|
128
|
+
search_body('firing'))
|
129
|
+
end
|
130
|
+
|
131
|
+
def test_affected_by_maintenance
|
132
|
+
should_work(:affected_by_maintenance, nil, '/api/v2/search/alert',
|
133
|
+
:post, {}, search_body('in_maintenance'))
|
134
|
+
end
|
135
|
+
|
136
|
+
def test_invalid
|
137
|
+
should_work(:invalid, nil, '/api/v2/search/alert', :post, {},
|
138
|
+
search_body('invalid'))
|
139
|
+
end
|
140
|
+
|
141
|
+
def test_in_maintenance
|
142
|
+
should_work(:affected_by_maintenance, nil, '/api/v2/search/alert',
|
143
|
+
:post, {}, search_body('in_maintenance'))
|
144
|
+
end
|
145
|
+
|
146
|
+
def test_none
|
147
|
+
should_work(:none, nil, '/api/v2/search/alert', :post, {},
|
148
|
+
search_body('none'))
|
149
|
+
end
|
150
|
+
|
151
|
+
def test_checking
|
152
|
+
should_work(:checking, nil, '/api/v2/search/alert', :post, {},
|
153
|
+
search_body('checking'))
|
154
|
+
end
|
155
|
+
|
156
|
+
def test_trash
|
157
|
+
should_work(:trash, nil, '/api/v2/search/alert', :post, {},
|
158
|
+
search_body('trash'))
|
159
|
+
end
|
160
|
+
|
161
|
+
def test_no_data
|
162
|
+
should_work(:no_data, nil, '/api/v2/search/alert',
|
163
|
+
:post, {}, search_body('no_data'))
|
164
|
+
end
|
165
|
+
|
166
|
+
def test_snoozed
|
167
|
+
should_work(:snoozed, nil, '/api/v2/search/alert',
|
168
|
+
:post, {}, search_body('snoozed'))
|
169
|
+
end
|
170
|
+
|
171
|
+
# Not a full test, because it's a recursive API call. Just test
|
172
|
+
# the first API call is made correctly.
|
173
|
+
#
|
174
|
+
def test_all
|
175
|
+
should_work(:all, nil, '?offset=0&limit=999')
|
176
|
+
end
|
104
177
|
end
|
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.2.
|
4
|
+
version: 2.2.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-12-
|
11
|
+
date: 2018-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -305,8 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
305
305
|
- !ruby/object:Gem::Version
|
306
306
|
version: '0'
|
307
307
|
requirements: []
|
308
|
-
|
309
|
-
rubygems_version: 2.7.8
|
308
|
+
rubygems_version: 3.0.0
|
310
309
|
signing_key:
|
311
310
|
specification_version: 4
|
312
311
|
summary: SDK for Wavefront API v2
|