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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06f0f8adb694b841f695f51159bf86b6e3893d751d6fb4194264fbc04caee9da
4
- data.tar.gz: 96343db53321b9097d311941ced492ea97e3608e92670b83b286542bae3a4ba7
3
+ metadata.gz: 5a349786f62cf725f7507812e5fc4a46d58a3c068102c7276cb7d680cac72a6d
4
+ data.tar.gz: bf493e285ec43adb60d7d21dfb1708c9eeab6018c177c8eb311b65779c7aaf46
5
5
  SHA512:
6
- metadata.gz: 1215a9c9679e4af6d81223385f4965f298933bd29bb68386abc6a29aefc4be51d22b9ed0986a96df2f59a08cc62904ab1c66b598e2543163275e969fd9a78af6
7
- data.tar.gz: 80ee2f5d089373df09ba8db98a19f4308eb5976e0b5e8134cec5b7fbc1ee85f12a40f0990d842f185a526c12f094d78ffbbff25c7b061f4be02e7c49d8f487dc
6
+ metadata.gz: bf55a3a220fb68ce4a0312dc750012c585baf286ed3fec04445f859d7a95b9c8003c5fc78ed5a5916f3104fa4bea0ffef1c6610688186675e9e8874640d03eab
7
+ data.tar.gz: b567bc3ede851020424080891dfdc744d1c3b31efe2abc6eb8ee7d3184ffcb7ec0dd8796ee4b5b818d3e70a53094da3352c25e2619f5d244a48af2df9657544f
data/HISTORY.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.1 (20/12/2018)
4
+ * Fix typo in `Wavefront::Alert#affected_by_maintenance` method
5
+ name.
6
+ * Full `Wavfront::Alert` test coverage.
7
+
3
8
  ## 2.2.0 (15/12/2018)
4
9
 
5
10
  * New methods to cover new API paths.
@@ -231,7 +231,7 @@ module Wavefront
231
231
  # @return [Wavefront::Response] all alerts currently in a
232
232
  # maintenance window.
233
233
  #
234
- def affected_by__maintenance
234
+ def affected_by_maintenance
235
235
  in_maintenance
236
236
  end
237
237
 
@@ -1 +1 @@
1
- WF_SDK_VERSION = '2.2.0'.freeze
1
+ WF_SDK_VERSION = '2.2.1'.freeze
data/spec/spec_helper.rb CHANGED
@@ -58,6 +58,8 @@ class WavefrontTestBase < MiniTest::Test
58
58
  end
59
59
 
60
60
  def target_uri(path)
61
+ return "https://#{CREDS[:endpoint]}#{path}" if path.start_with?('/')
62
+
61
63
  [uri_base, path].join(path.start_with?('?') ? '' : '/')
62
64
  end
63
65
 
@@ -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.0
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-17 00:00:00.000000000 Z
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
- rubyforge_project:
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