wavefront-sdk 2.1.0 → 2.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c4118704af3ffb7d99b5de030b6b824fd65347e370aae63790cfeabccfe8f46
4
- data.tar.gz: 7c6850c987b13e107cabcf07f6a7fdd100703e258247ea95ec7affddeb083233
3
+ metadata.gz: 06f0f8adb694b841f695f51159bf86b6e3893d751d6fb4194264fbc04caee9da
4
+ data.tar.gz: 96343db53321b9097d311941ced492ea97e3608e92670b83b286542bae3a4ba7
5
5
  SHA512:
6
- metadata.gz: eac7aa649f1aee9ea33ade08f61c5153a3261ce7a85541ecef984c536e2cb8394e63eb7eb1975ac8d136ff92120b2994be66e5e91f8caf71970219604bc089ed
7
- data.tar.gz: 6674ea58e42ef802724245ffdd28e8e70ab62f6ba9131b15c295437c8f290f0fecd3daf425d7b257adbc5fde48f829bd3bbd849acd62907792806319bbfc85ee
6
+ metadata.gz: 1215a9c9679e4af6d81223385f4965f298933bd29bb68386abc6a29aefc4be51d22b9ed0986a96df2f59a08cc62904ab1c66b598e2543163275e969fd9a78af6
7
+ data.tar.gz: 80ee2f5d089373df09ba8db98a19f4308eb5976e0b5e8134cec5b7fbc1ee85f12a40f0990d842f185a526c12f094d78ffbbff25c7b061f4be02e7c49d8f487dc
data/HISTORY.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.0 (15/12/2018)
4
+
5
+ * New methods to cover new API paths.
6
+ * `Wavefront::Alert#install`,
7
+ * `Wavefront::Alert#uninstall`,
8
+ * `Wavefront::CloudIntegration#disable`
9
+ * `Wavefront::CloudIntegration#enable`
10
+ * `Wavefront::Dashboard#favorite`
11
+ * `Wavefront::Dashboard#unfavorite`
12
+ * `Wavefront::Integration#install_all_alerts`
13
+ * `Wavefront::Integration#uninstall_all_alerts`
14
+ * `Wavefront::Integration#installed`
15
+
3
16
  ## 2.1.0 (25/11/2018)
4
17
  * New `unix` writer lets you write points to a local Unix datagram
5
18
  socket.
@@ -104,6 +104,14 @@ module Wavefront
104
104
  api.get([id, 'history'].uri_concat, qs)
105
105
  end
106
106
 
107
+ # POST /api/v2/alert/{id}/install
108
+ # Unhide a specific integration alert
109
+ #
110
+ def install(id)
111
+ wf_alert_id?(id)
112
+ api.post([id, 'install'].uri_concat, nil)
113
+ end
114
+
107
115
  # POST /api/v2/alert/id/snooze
108
116
  # Snooze a specific alert for some number of seconds.
109
117
  #
@@ -180,6 +188,14 @@ module Wavefront
180
188
  api.post([id, 'undelete'].uri_concat)
181
189
  end
182
190
 
191
+ # POST /api/v2/alert/{id}/uninstall
192
+ # Hide a specific integration alert
193
+ #
194
+ def uninstall(id)
195
+ wf_alert_id?(id)
196
+ api.post([id, 'uninstall'].uri_concat, nil)
197
+ end
198
+
183
199
  # POST /api/v2/alert/id/unsnooze
184
200
  # Unsnooze a specific alert.
185
201
  #
@@ -67,6 +67,26 @@ module Wavefront
67
67
  api.put(id, body)
68
68
  end
69
69
 
70
+ # POST /api/v2/cloudintegration/{id}/disable
71
+ # Disable a specific cloud integration
72
+ # @param id [String] ID of the integration
73
+ # @return [Wavefront::Response]
74
+ #
75
+ def disable(id)
76
+ wf_cloudintegration_id?(id)
77
+ api.post([id, 'disable'].uri_concat)
78
+ end
79
+
80
+ # POST /api/v2/cloudintegration/{id}/enable
81
+ # Enable a specific cloud integration
82
+ # @param id [String] ID of the integration
83
+ # @return [Wavefront::Response]
84
+ #
85
+ def enable(id)
86
+ wf_cloudintegration_id?(id)
87
+ api.post([id, 'enable'].uri_concat)
88
+ end
89
+
70
90
  # POST /api/v2/cloudintegration/id/undelete
71
91
  # Undelete a specific cloud integration
72
92
  #
@@ -83,6 +83,17 @@ module Wavefront
83
83
  'application/json')
84
84
  end
85
85
 
86
+ # POST /api/v2/dashboard/{id}/favorite
87
+ # Mark a dashboard as favorite
88
+ #
89
+ # @param id [String] ID of the dashboard
90
+ # @return [Wavefront::Response]
91
+ #
92
+ def favorite(id)
93
+ wf_dashboard_id?(id)
94
+ api.post([id, 'favorite'].uri_concat)
95
+ end
96
+
86
97
  # GET /api/v2/dashboard/id/history
87
98
  # Get the version history of a dashboard.
88
99
  #
@@ -155,5 +166,16 @@ module Wavefront
155
166
  wf_dashboard_id?(id)
156
167
  api.post([id, 'undelete'].uri_concat)
157
168
  end
169
+
170
+ # POST /api/v2/dashboard/{id}/unfavorite
171
+ # Unmark a dashboard as favorite
172
+ #
173
+ # @param id [String] ID of the dashboard
174
+ # @return [Wavefront::Response]
175
+ #
176
+ def unfavorite(id)
177
+ wf_dashboard_id?(id)
178
+ api.post([id, 'unfavorite'].uri_concat)
179
+ end
158
180
  end
159
181
  end
@@ -1 +1 @@
1
- WF_SDK_VERSION = '2.1.0'.freeze
1
+ WF_SDK_VERSION = '2.2.0'.freeze
@@ -11,6 +11,7 @@ module Wavefront
11
11
  #
12
12
  # @param offset [Int] proxy at which the list begins
13
13
  # @param limit [Int] the number of proxies to return
14
+ # @return [Wavefront::Response]
14
15
  #
15
16
  def list(offset = 0, limit = 100)
16
17
  api.get('', offset: offset, limit: limit)
@@ -39,15 +40,15 @@ module Wavefront
39
40
  api.post([id, 'install'].uri_concat, nil)
40
41
  end
41
42
 
42
- # POST /api/v2/integration/id/uninstall
43
- # Uninstalls a Wavefront integration
43
+ # POST /api/v2/integration/{id}/install-all-alerts
44
+ # Enable all alerts associated with this integration
44
45
  #
45
46
  # @param id [String] ID of the integration
46
47
  # @return [Wavefront::Response]
47
48
  #
48
- def uninstall(id)
49
+ def install_all_alerts(id)
49
50
  wf_integration_id?(id)
50
- api.post([id, 'uninstall'].uri_concat, nil)
51
+ api.post([id, 'install-all-alerts'].uri_concat, nil)
51
52
  end
52
53
 
53
54
  # GET /api/v2/integration/id/status
@@ -61,13 +62,38 @@ module Wavefront
61
62
  api.get([id, 'status'].uri_concat)
62
63
  end
63
64
 
64
- # GET /api/v2/integration/status
65
- # Gets the status of all Wavefront integrations
65
+ # POST /api/v2/integration/id/uninstall
66
+ # Uninstalls a Wavefront integration
66
67
  #
68
+ # @param id [String] ID of the integration
67
69
  # @return [Wavefront::Response]
68
70
  #
69
- def statuses
70
- api.get('status')
71
+ def uninstall(id)
72
+ wf_integration_id?(id)
73
+ api.post([id, 'uninstall'].uri_concat, nil)
74
+ end
75
+
76
+ # POST /api/v2/integration/{id}/uninstall-all-alerts
77
+ # Disable all alerts associated with this integration
78
+ #
79
+ # @param id [String] ID of the integration
80
+ # @return [Wavefront::Response]
81
+ #
82
+ def uninstall_all_alerts(id)
83
+ wf_integration_id?(id)
84
+ api.post([id, 'uninstall-all-alerts'].uri_concat, nil)
85
+ end
86
+
87
+ # GET /api/v2/integration/installed
88
+ # Gets a flat list of all Integrations that are installed, along
89
+ # with their status
90
+ #
91
+ # @param offset [Int] proxy at which the list begins
92
+ # @param limit [Int] the number of proxies to return
93
+ # @return [Wavefront::Response]
94
+ #
95
+ def installed
96
+ api.get('installed')
71
97
  end
72
98
 
73
99
  # GET /api/v2/integration/manifests
@@ -77,5 +103,14 @@ module Wavefront
77
103
  def manifests
78
104
  api.get('manifests')
79
105
  end
106
+
107
+ # GET /api/v2/integration/status
108
+ # Gets the status of all Wavefront integrations
109
+ #
110
+ # @return [Wavefront::Response]
111
+ #
112
+ def statuses
113
+ api.get('status')
114
+ end
80
115
  end
81
116
  end
@@ -58,6 +58,11 @@ class WavefrontAlertTest < WavefrontTestBase
58
58
  should_be_invalid(:history)
59
59
  end
60
60
 
61
+ def test_install
62
+ should_work(:install, ALERT, "#{ALERT}/install", :post)
63
+ should_be_invalid(:install)
64
+ end
65
+
61
66
  def test_snooze
62
67
  should_work(:snooze, ALERT, "#{ALERT}/snooze", :post, POST_HEADERS)
63
68
  should_work(:snooze, [ALERT, 3600], "#{ALERT}/snooze?seconds=3600",
@@ -82,6 +87,11 @@ class WavefrontAlertTest < WavefrontTestBase
82
87
  should_be_invalid(:undelete)
83
88
  end
84
89
 
90
+ def test_uninstall
91
+ should_work(:uninstall, ALERT, "#{ALERT}/uninstall", :post)
92
+ should_be_invalid(:uninstall)
93
+ end
94
+
85
95
  def test_unsnooze
86
96
  should_work(:unsnooze, ALERT, ["#{ALERT}/unsnooze", nil], :post,
87
97
  POST_HEADERS)
@@ -51,4 +51,16 @@ class WavefrontCloudIntegrationTest < WavefrontTestBase
51
51
  POST_HEADERS)
52
52
  should_be_invalid(:undelete)
53
53
  end
54
+
55
+ def test_disable
56
+ should_work(:disable, CLOUD, ["#{CLOUD}/disable", nil], :post,
57
+ POST_HEADERS)
58
+ should_be_invalid(:disable)
59
+ end
60
+
61
+ def test_enable
62
+ should_work(:enable, CLOUD, ["#{CLOUD}/enable", nil], :post,
63
+ POST_HEADERS)
64
+ should_be_invalid(:enable)
65
+ end
54
66
  end
@@ -50,11 +50,6 @@ class WavefrontDashboardTest < WavefrontTestBase
50
50
  should_be_invalid(:delete)
51
51
  end
52
52
 
53
- def test_history
54
- should_work(:history, DASHBOARD, "#{DASHBOARD}/history")
55
- should_be_invalid(:history)
56
- end
57
-
58
53
  def test_update
59
54
  should_work(:update, [DASHBOARD, DASHBOARD_BODY, false],
60
55
  DASHBOARD, :put, JSON_POST_HEADERS,
@@ -63,6 +58,17 @@ class WavefrontDashboardTest < WavefrontTestBase
63
58
  assert_raises(ArgumentError) { wf.update }
64
59
  end
65
60
 
61
+ def test_favorite
62
+ should_work(:favorite, DASHBOARD, ["#{DASHBOARD}/favorite",
63
+ nil], :post, POST_HEADERS)
64
+ should_be_invalid(:favorite)
65
+ end
66
+
67
+ def test_history
68
+ should_work(:history, DASHBOARD, "#{DASHBOARD}/history")
69
+ should_be_invalid(:history)
70
+ end
71
+
66
72
  def test_tags
67
73
  tag_tester(DASHBOARD)
68
74
  end
@@ -72,4 +78,10 @@ class WavefrontDashboardTest < WavefrontTestBase
72
78
  nil], :post, POST_HEADERS)
73
79
  should_be_invalid(:undelete)
74
80
  end
81
+
82
+ def test_unfavorite
83
+ should_work(:unfavorite, DASHBOARD, ["#{DASHBOARD}/unfavorite",
84
+ nil], :post, POST_HEADERS)
85
+ should_be_invalid(:unfavorite)
86
+ end
75
87
  end
@@ -18,6 +18,14 @@ class WavefrontIntegrationTest < WavefrontTestBase
18
18
  assert_raises(ArgumentError) { wf.install }
19
19
  end
20
20
 
21
+ def test_install_all_alerts
22
+ should_work(:install_all_alerts, INTEGRATION,
23
+ ["#{INTEGRATION}/install-all-alerts", nil],
24
+ :post, POST_HEADERS)
25
+ should_be_invalid(:install_all_alerts)
26
+ assert_raises(ArgumentError) { wf.install_all_alerts }
27
+ end
28
+
21
29
  def test_uninstall
22
30
  should_work(:uninstall, INTEGRATION, ["#{INTEGRATION}/uninstall", nil],
23
31
  :post, POST_HEADERS)
@@ -25,6 +33,14 @@ class WavefrontIntegrationTest < WavefrontTestBase
25
33
  assert_raises(ArgumentError) { wf.uninstall }
26
34
  end
27
35
 
36
+ def test_uninstall_all_alerts
37
+ should_work(:uninstall_all_alerts, INTEGRATION,
38
+ ["#{INTEGRATION}/uninstall-all-alerts", nil],
39
+ :post, POST_HEADERS)
40
+ should_be_invalid(:uninstall_all_alerts)
41
+ assert_raises(ArgumentError) { wf.uninstall_all_alerts }
42
+ end
43
+
28
44
  def test_describe
29
45
  should_work(:describe, INTEGRATION, INTEGRATION)
30
46
  should_be_invalid(:describe)
@@ -37,6 +53,10 @@ class WavefrontIntegrationTest < WavefrontTestBase
37
53
  assert_raises(ArgumentError) { wf.status }
38
54
  end
39
55
 
56
+ def test_installed
57
+ should_work(:installed, nil, 'installed')
58
+ end
59
+
40
60
  def test_manifests
41
61
  should_work(:manifests, nil, 'manifests')
42
62
  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.1.0
4
+ version: 2.2.0
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-11-26 00:00:00.000000000 Z
11
+ date: 2018-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable