wavefront-sdk 5.3.0 → 5.3.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/.github/workflows/ruby.yml +32 -0
- data/HISTORY.md +4 -0
- data/lib/wavefront-sdk/cloudintegration.rb +4 -0
- data/lib/wavefront-sdk/core/api.rb +2 -2
- data/lib/wavefront-sdk/defs/version.rb +1 -1
- data/lib/wavefront-sdk/derivedmetric.rb +2 -4
- data/lib/wavefront-sdk/ingestionpolicy.rb +4 -0
- data/lib/wavefront-sdk/notificant.rb +0 -2
- data/lib/wavefront-sdk/savedsearch.rb +4 -0
- data/lib/wavefront-sdk/user.rb +4 -4
- data/spec/test_mixins/general.rb +6 -0
- data/spec/wavefront-sdk/alert_spec.rb +0 -2
- data/spec/wavefront-sdk/core/api_spec.rb +9 -1
- data/spec/wavefront-sdk/dashboard_spec.rb +0 -2
- data/spec/wavefront-sdk/notificant_spec.rb +27 -0
- metadata +3 -4
- data/spec/test_mixins/update_keys.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fc4311b2322403ef715d9a62c5f84712accb5ed1ee9e5350e0bbcb6237fe631
|
4
|
+
data.tar.gz: f2fb99d1f35d601a619f0e7135f8b22ea0b22d0697752af5a265132d867216bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2e79e3ce013f9fcdc3e28d7e111c586746e65ae341b0187b44b3908d29d81ae9aa8f0723d8eeea239c27f9976b232aa2acf2ecda92b797b0c45f25dc9e9c612
|
7
|
+
data.tar.gz: 20f3124667013b4f1212df12c6e04c235e7dfda24e3f0ac9a87ba4c4a4884d96d11f1a855d460f8026d65d8a35754d7a2f5d0bf705f13456dea066d0faee7822
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
strategy:
|
20
|
+
matrix:
|
21
|
+
ruby-version: [2.4.10, 2.5.8, 2.6.6, 2.7.2]
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v2
|
24
|
+
- name: Set up Ruby
|
25
|
+
uses: ruby/setup-ruby@v1
|
26
|
+
with:
|
27
|
+
ruby-version: ${{ matrix.ruby-version }}
|
28
|
+
bundler-cache: true
|
29
|
+
- name: Install dependencies
|
30
|
+
run: bundle install
|
31
|
+
- name: Run tests
|
32
|
+
run: bundle exec rake
|
data/HISTORY.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 5.3.1 (2020-12-11)
|
4
|
+
* Fix error when renaming ingestion policies, and improve testing which should
|
5
|
+
have caught the problem in the first place.
|
6
|
+
|
3
7
|
## 5.3.0 (2020-10-10)
|
4
8
|
* Add `Wavefront::Proxy#shutdown` which can shut down a proxy via the API.
|
5
9
|
|
@@ -81,9 +81,9 @@ module Wavefront
|
|
81
81
|
(time.to_f * 1000).round
|
82
82
|
end
|
83
83
|
|
84
|
-
#
|
84
|
+
# Doing a PUT to update an object requires only a certain subset of
|
85
85
|
# the keys returned by #describe(). This method takes the
|
86
|
-
# existing description of an object and turns it into a new
|
86
|
+
# existing description of an object and turns it into a new hash
|
87
87
|
# which can be PUT.
|
88
88
|
#
|
89
89
|
# @param old [Hash] a hash of the existing object
|
@@ -112,11 +112,9 @@ module Wavefront
|
|
112
112
|
wf_derivedmetric_id?(id)
|
113
113
|
end
|
114
114
|
|
115
|
-
private
|
116
|
-
|
117
115
|
def update_keys
|
118
|
-
%i[
|
119
|
-
|
116
|
+
%i[name query tags additionalInformation includeObsoleteMetrics
|
117
|
+
processRateMinutes minutes]
|
120
118
|
end
|
121
119
|
end
|
122
120
|
end
|
data/lib/wavefront-sdk/user.rb
CHANGED
@@ -297,6 +297,10 @@ module Wavefront
|
|
297
297
|
raise NoMethodError
|
298
298
|
end
|
299
299
|
|
300
|
+
def update_keys
|
301
|
+
%i[identifier groups userGroups]
|
302
|
+
end
|
303
|
+
|
300
304
|
private
|
301
305
|
|
302
306
|
def response_looks_right?(body_obj)
|
@@ -311,9 +315,5 @@ module Wavefront
|
|
311
315
|
|
312
316
|
items.fetch(:message, 'no message from API')
|
313
317
|
end
|
314
|
-
|
315
|
-
def update_keys
|
316
|
-
%i[identifier groups userGroups]
|
317
|
-
end
|
318
318
|
end
|
319
319
|
end
|
data/spec/test_mixins/general.rb
CHANGED
@@ -65,6 +65,7 @@ module WavefrontTest
|
|
65
65
|
module Update
|
66
66
|
def test_update
|
67
67
|
[payload].flatten.each do |p|
|
68
|
+
# passes payload through as-is
|
68
69
|
assert_puts("/api/v2/#{api_class}/#{id}", p) do
|
69
70
|
wf.update(id, p, false)
|
70
71
|
end
|
@@ -73,6 +74,11 @@ module WavefrontTest
|
|
73
74
|
assert_raises(ArgumentError) { wf.update }
|
74
75
|
end
|
75
76
|
end
|
77
|
+
|
78
|
+
def test_update_keys
|
79
|
+
assert_instance_of Array, wf.update_keys
|
80
|
+
assert(wf.update_keys.all? { |k| k.is_a?(Symbol) })
|
81
|
+
end
|
76
82
|
end
|
77
83
|
|
78
84
|
module Clone
|
@@ -4,7 +4,6 @@
|
|
4
4
|
require_relative '../spec_helper'
|
5
5
|
require_relative '../test_mixins/acl'
|
6
6
|
require_relative '../test_mixins/tag'
|
7
|
-
require_relative '../test_mixins/update_keys'
|
8
7
|
require_relative '../test_mixins/general'
|
9
8
|
|
10
9
|
# Unit tests for Alert class
|
@@ -20,7 +19,6 @@ class WavefrontAlertTest < WavefrontTestBase
|
|
20
19
|
include WavefrontTest::List
|
21
20
|
include WavefrontTest::Tag
|
22
21
|
include WavefrontTest::Update
|
23
|
-
include WavefrontTest::UpdateKeys
|
24
22
|
|
25
23
|
def test_snooze
|
26
24
|
assert_posts("/api/v2/alert/#{id}/snooze") { wf.snooze(id) }
|
@@ -23,7 +23,15 @@ class WavefrontCoreApiTest < MiniTest::Test
|
|
23
23
|
|
24
24
|
def test_hash_for_update
|
25
25
|
wf.instance_variable_set('@update_keys', %i[k1 k2])
|
26
|
-
body = { k1: 'ov1',
|
26
|
+
body = { k1: 'ov1',
|
27
|
+
k2: 'ov2',
|
28
|
+
k3: 'ov3',
|
29
|
+
customerId: 'test',
|
30
|
+
creatorId: 'someone@example.com',
|
31
|
+
createUserId: 'someone@example.com',
|
32
|
+
updateUserId: 'someone@example.com',
|
33
|
+
createdEpochMillis: 1_607_691_387_023,
|
34
|
+
updatedEpochMillis: 1_607_691_387_023 }
|
27
35
|
upd = { k2: 'nv1' }
|
28
36
|
assert_equal({ k1: 'ov1', k2: 'nv1' }, wf.hash_for_update(body, upd))
|
29
37
|
end
|
@@ -4,7 +4,6 @@
|
|
4
4
|
require_relative '../spec_helper'
|
5
5
|
require_relative '../test_mixins/acl'
|
6
6
|
require_relative '../test_mixins/tag'
|
7
|
-
require_relative '../test_mixins/update_keys'
|
8
7
|
require_relative '../test_mixins/general'
|
9
8
|
|
10
9
|
# Unit tests for dashboard class
|
@@ -18,7 +17,6 @@ class WavefrontDashboardTest < WavefrontTestBase
|
|
18
17
|
include WavefrontTest::List
|
19
18
|
include WavefrontTest::Tag
|
20
19
|
include WavefrontTest::Update
|
21
|
-
include WavefrontTest::UpdateKeys
|
22
20
|
|
23
21
|
def test_favorite
|
24
22
|
assert_posts("/api/v2/dashboard/#{id}/favorite") { wf.favorite(id) }
|
@@ -10,6 +10,7 @@ class WavefrontNotificantTest < WavefrontTestBase
|
|
10
10
|
include WavefrontTest::List
|
11
11
|
include WavefrontTest::Delete
|
12
12
|
include WavefrontTest::Describe
|
13
|
+
include WavefrontTest::Update
|
13
14
|
|
14
15
|
def test_test
|
15
16
|
assert_posts("/api/v2/notificant/test/#{id}") { wf.test(id) }
|
@@ -29,4 +30,30 @@ class WavefrontNotificantTest < WavefrontTestBase
|
|
29
30
|
def invalid_id
|
30
31
|
'---rubbish---'
|
31
32
|
end
|
33
|
+
|
34
|
+
def payload
|
35
|
+
JSON.parse(%(
|
36
|
+
{
|
37
|
+
"method": "PAGERDUTY",
|
38
|
+
"id": "PE0BEkf4r123yooO",
|
39
|
+
"contentType": "",
|
40
|
+
"description": "Test target",
|
41
|
+
"customerId": "sysdef",
|
42
|
+
"title": "Terraform Test Target",
|
43
|
+
"recipient": "12345678910111213141516171819202",
|
44
|
+
"creatorId": "someone@example.com",
|
45
|
+
"updaterId": "someone@example.com",
|
46
|
+
"createdEpochMillis": 1604513812010,
|
47
|
+
"updatedEpochMillis": 1604513812010,
|
48
|
+
"template": "{}",
|
49
|
+
"triggers": [
|
50
|
+
"ALERT_OPENED",
|
51
|
+
"ALERT_RESOLVED"
|
52
|
+
],
|
53
|
+
"customHttpHeaders": {},
|
54
|
+
"emailSubject": "",
|
55
|
+
"isHtmlContent": false
|
56
|
+
}
|
57
|
+
), symbolize_names: true)
|
58
|
+
end
|
32
59
|
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: 5.3.
|
4
|
+
version: 5.3.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: 2020-
|
11
|
+
date: 2020-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -171,6 +171,7 @@ extensions: []
|
|
171
171
|
extra_rdoc_files: []
|
172
172
|
files:
|
173
173
|
- ".codeclimate.yml"
|
174
|
+
- ".github/workflows/ruby.yml"
|
174
175
|
- ".gitignore"
|
175
176
|
- ".rubocop.yml"
|
176
177
|
- ".travis.yml"
|
@@ -254,7 +255,6 @@ files:
|
|
254
255
|
- spec/test_mixins/acl.rb
|
255
256
|
- spec/test_mixins/general.rb
|
256
257
|
- spec/test_mixins/tag.rb
|
257
|
-
- spec/test_mixins/update_keys.rb
|
258
258
|
- spec/wavefront-sdk/account_spec.rb
|
259
259
|
- spec/wavefront-sdk/alert_spec.rb
|
260
260
|
- spec/wavefront-sdk/api_mixins/user_mixins_spec.rb
|
@@ -352,7 +352,6 @@ test_files:
|
|
352
352
|
- spec/test_mixins/acl.rb
|
353
353
|
- spec/test_mixins/general.rb
|
354
354
|
- spec/test_mixins/tag.rb
|
355
|
-
- spec/test_mixins/update_keys.rb
|
356
355
|
- spec/wavefront-sdk/account_spec.rb
|
357
356
|
- spec/wavefront-sdk/alert_spec.rb
|
358
357
|
- spec/wavefront-sdk/api_mixins/user_mixins_spec.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module WavefrontTest
|
4
|
-
#
|
5
|
-
# include this into any class which has update keys
|
6
|
-
#
|
7
|
-
module UpdateKeys
|
8
|
-
def test_update_keys
|
9
|
-
assert_instance_of Array, wf.update_keys
|
10
|
-
assert(wf.update_keys.all? { |k| k.is_a?(Symbol) })
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|