wavefront-sdk 3.7.1 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +43 -2
  3. data/.travis.yml +0 -1
  4. data/HISTORY.md +33 -0
  5. data/README.md +4 -3
  6. data/lib/wavefront-sdk/account.rb +104 -3
  7. data/lib/wavefront-sdk/api_mixins/user.rb +10 -0
  8. data/lib/wavefront-sdk/cloudintegration.rb +27 -0
  9. data/lib/wavefront-sdk/core/api_caller.rb +50 -7
  10. data/lib/wavefront-sdk/core/exception.rb +6 -0
  11. data/lib/wavefront-sdk/credentials.rb +28 -9
  12. data/lib/wavefront-sdk/defs/version.rb +1 -3
  13. data/lib/wavefront-sdk/paginator/base.rb +21 -15
  14. data/lib/wavefront-sdk/query.rb +0 -1
  15. data/lib/wavefront-sdk/role.rb +128 -0
  16. data/lib/wavefront-sdk/spy.rb +126 -0
  17. data/lib/wavefront-sdk/stdlib/array.rb +1 -1
  18. data/lib/wavefront-sdk/stdlib/time.rb +13 -0
  19. data/lib/wavefront-sdk/unstable/README.md +4 -0
  20. data/lib/wavefront-sdk/unstable/chart.rb +90 -0
  21. data/lib/wavefront-sdk/unstable/unstable.rb +9 -0
  22. data/lib/wavefront-sdk/user.rb +31 -0
  23. data/lib/wavefront-sdk/usergroup.rb +17 -16
  24. data/lib/wavefront-sdk/validators.rb +52 -7
  25. data/lib/wavefront-sdk/write.rb +9 -9
  26. data/spec/.rubocop.yml +41 -0
  27. data/spec/spec_helper.rb +4 -0
  28. data/spec/support/minitest_assertions.rb +4 -4
  29. data/spec/wavefront-sdk/account_spec.rb +107 -1
  30. data/spec/wavefront-sdk/cloudintegration_spec.rb +38 -0
  31. data/spec/wavefront-sdk/core/api_caller_spec.rb +43 -0
  32. data/spec/wavefront-sdk/credentials_spec.rb +3 -4
  33. data/spec/wavefront-sdk/metric_helper_spec.rb +1 -1
  34. data/spec/wavefront-sdk/role_spec.rb +96 -0
  35. data/spec/wavefront-sdk/spy_spec.rb +113 -0
  36. data/spec/wavefront-sdk/unstable/chart_spec.rb +39 -0
  37. data/spec/wavefront-sdk/user_spec.rb +8 -0
  38. data/spec/wavefront-sdk/usergroup_spec.rb +21 -11
  39. data/spec/wavefront-sdk/validators_spec.rb +31 -0
  40. data/wavefront-sdk.gemspec +8 -8
  41. metadata +32 -21
@@ -386,4 +386,35 @@ class WavefrontValidatorsTest < MiniTest::Test
386
386
  bad = ['', [], {}, 'a' * 1000]
387
387
  good_and_bad('wf_account_id?', 'InvalidAccountId', good, bad)
388
388
  end
389
+
390
+ def test_wf_managedcluster_id
391
+ good = %w[test-cluster other-cluster cluster]
392
+ bad = ['', [], {}, 'a' * 1000, '£"^WR"!']
393
+ good_and_bad('wf_monitoredcluster_id?',
394
+ 'InvalidMonitoredClusterId',
395
+ good,
396
+ bad)
397
+ end
398
+
399
+ def test_wf_sampling_value
400
+ good = [0, 0.01, 0.003, 0.05]
401
+ bad = ['a', 0.1, 0.99, 1, -1, 1.1]
402
+ good_and_bad('wf_sampling_value?', 'InvalidSamplingValue', good, bad)
403
+ end
404
+
405
+ def test_wf_role_id
406
+ good = %w[2bfdcac7-1c9c-4c4b-9b56-c41c22c586dc
407
+ 17db4cc1-65f6-40a8-a1fa-6fcae460c4bd
408
+ fca312fb-5ff4-420d-862d-5d6d99ed6bcf
409
+ 3a1957e0-459e-49e5-9209-3888a4e8ac5b]
410
+
411
+ bad = %w[fa312fb-5ff4-420d-862d-5d6d99ed6bcf thing 123]
412
+ good_and_bad('wf_role_id?', 'InvalidRoleId', good, bad)
413
+ end
414
+
415
+ def test_wf_aws_external_id
416
+ good = %w[ah5Z9dkr46jbvLtJ HqOM4mru5svd3uFp c1lBxILCBNxLKdx9]
417
+ bad = %w[h5Z9dkr46jbvLtJ HqOM4mru5svd3uFp3 c!lBx!LC*NxLKdx*]
418
+ good_and_bad('wf_aws_external_id?', 'InvalidAwsExternalId', good, bad)
419
+ end
389
420
  end
@@ -23,17 +23,17 @@ Gem::Specification.new do |gem|
23
23
  gem.bindir = 'bin'
24
24
 
25
25
  gem.add_dependency 'addressable', '~> 2.7'
26
- gem.add_dependency 'faraday', '~> 0.17.0'
26
+ gem.add_dependency 'faraday', '~> 1.0'
27
27
  gem.add_dependency 'inifile', '~> 3.0'
28
28
  gem.add_dependency 'map', '~> 6.6'
29
29
 
30
- gem.add_development_dependency 'minitest', '~> 5.11'
31
- gem.add_development_dependency 'rake', '~> 12.3'
32
- gem.add_development_dependency 'rubocop', '~> 0.79'
33
- gem.add_development_dependency 'simplecov', '~> 0.16'
34
- gem.add_development_dependency 'spy', '~> 1.0.0'
35
- gem.add_development_dependency 'webmock', '~> 3.7'
30
+ gem.add_development_dependency 'minitest', '~> 5.14'
31
+ gem.add_development_dependency 'rake', '~> 13.0'
32
+ gem.add_development_dependency 'rubocop', '0.87.1'
33
+ gem.add_development_dependency 'simplecov', '~> 0.18'
34
+ gem.add_development_dependency 'spy', '1.0.0'
35
+ gem.add_development_dependency 'webmock', '~> 3.8'
36
36
  gem.add_development_dependency 'yard', '~> 0.9'
37
37
 
38
- gem.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
38
+ gem.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
39
39
  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: 3.7.1
4
+ version: 5.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: 2020-02-10 00:00:00.000000000 Z
11
+ date: 2020-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.17.0
33
+ version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.17.0
40
+ version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: inifile
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,68 +72,68 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '5.11'
75
+ version: '5.14'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '5.11'
82
+ version: '5.14'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '12.3'
89
+ version: '13.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '12.3'
96
+ version: '13.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: '0.79'
103
+ version: 0.87.1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: '0.79'
110
+ version: 0.87.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0.16'
117
+ version: '0.18'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0.16'
124
+ version: '0.18'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: spy
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - '='
130
130
  - !ruby/object:Gem::Version
131
131
  version: 1.0.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - '='
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.0.0
139
139
  - !ruby/object:Gem::Dependency
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '3.7'
145
+ version: '3.8'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '3.7'
152
+ version: '3.8'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: yard
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -214,17 +214,23 @@ files:
214
214
  - lib/wavefront-sdk/proxy.rb
215
215
  - lib/wavefront-sdk/query.rb
216
216
  - lib/wavefront-sdk/report.rb
217
+ - lib/wavefront-sdk/role.rb
217
218
  - lib/wavefront-sdk/savedsearch.rb
218
219
  - lib/wavefront-sdk/search.rb
219
220
  - lib/wavefront-sdk/serviceaccount.rb
220
221
  - lib/wavefront-sdk/settings.rb
221
222
  - lib/wavefront-sdk/source.rb
223
+ - lib/wavefront-sdk/spy.rb
222
224
  - lib/wavefront-sdk/stdlib/array.rb
223
225
  - lib/wavefront-sdk/stdlib/hash.rb
224
226
  - lib/wavefront-sdk/stdlib/string.rb
227
+ - lib/wavefront-sdk/stdlib/time.rb
225
228
  - lib/wavefront-sdk/support/mixins.rb
226
229
  - lib/wavefront-sdk/support/parse_time.rb
227
230
  - lib/wavefront-sdk/types/status.rb
231
+ - lib/wavefront-sdk/unstable/README.md
232
+ - lib/wavefront-sdk/unstable/chart.rb
233
+ - lib/wavefront-sdk/unstable/unstable.rb
228
234
  - lib/wavefront-sdk/usage.rb
229
235
  - lib/wavefront-sdk/user.rb
230
236
  - lib/wavefront-sdk/usergroup.rb
@@ -286,16 +292,19 @@ files:
286
292
  - spec/wavefront-sdk/resources/user_responses/describe.json
287
293
  - spec/wavefront-sdk/resources/user_responses/grant.json
288
294
  - spec/wavefront-sdk/resources/user_responses/list.json
295
+ - spec/wavefront-sdk/role_spec.rb
289
296
  - spec/wavefront-sdk/savedsearch_spec.rb
290
297
  - spec/wavefront-sdk/search_spec.rb
291
298
  - spec/wavefront-sdk/serviceaccount_spec.rb
292
299
  - spec/wavefront-sdk/settings_spec.rb
293
300
  - spec/wavefront-sdk/source_spec.rb
301
+ - spec/wavefront-sdk/spy_spec.rb
294
302
  - spec/wavefront-sdk/stdlib/array_spec.rb
295
303
  - spec/wavefront-sdk/stdlib/hash_spec.rb
296
304
  - spec/wavefront-sdk/stdlib/string_spec.rb
297
305
  - spec/wavefront-sdk/support/mixins_spec.rb
298
306
  - spec/wavefront-sdk/support/parse_time_spec.rb
307
+ - spec/wavefront-sdk/unstable/chart_spec.rb
299
308
  - spec/wavefront-sdk/usage_spec.rb
300
309
  - spec/wavefront-sdk/user_spec.rb
301
310
  - spec/wavefront-sdk/usergroup_spec.rb
@@ -320,15 +329,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
320
329
  requirements:
321
330
  - - ">="
322
331
  - !ruby/object:Gem::Version
323
- version: 2.3.0
332
+ version: 2.4.0
324
333
  required_rubygems_version: !ruby/object:Gem::Requirement
325
334
  requirements:
326
335
  - - ">="
327
336
  - !ruby/object:Gem::Version
328
337
  version: '0'
329
338
  requirements: []
330
- rubyforge_project:
331
- rubygems_version: 2.7.7
339
+ rubygems_version: 3.0.8
332
340
  signing_key:
333
341
  specification_version: 4
334
342
  summary: SDK for Wavefront API v2
@@ -381,16 +389,19 @@ test_files:
381
389
  - spec/wavefront-sdk/resources/user_responses/describe.json
382
390
  - spec/wavefront-sdk/resources/user_responses/grant.json
383
391
  - spec/wavefront-sdk/resources/user_responses/list.json
392
+ - spec/wavefront-sdk/role_spec.rb
384
393
  - spec/wavefront-sdk/savedsearch_spec.rb
385
394
  - spec/wavefront-sdk/search_spec.rb
386
395
  - spec/wavefront-sdk/serviceaccount_spec.rb
387
396
  - spec/wavefront-sdk/settings_spec.rb
388
397
  - spec/wavefront-sdk/source_spec.rb
398
+ - spec/wavefront-sdk/spy_spec.rb
389
399
  - spec/wavefront-sdk/stdlib/array_spec.rb
390
400
  - spec/wavefront-sdk/stdlib/hash_spec.rb
391
401
  - spec/wavefront-sdk/stdlib/string_spec.rb
392
402
  - spec/wavefront-sdk/support/mixins_spec.rb
393
403
  - spec/wavefront-sdk/support/parse_time_spec.rb
404
+ - spec/wavefront-sdk/unstable/chart_spec.rb
394
405
  - spec/wavefront-sdk/usage_spec.rb
395
406
  - spec/wavefront-sdk/user_spec.rb
396
407
  - spec/wavefront-sdk/usergroup_spec.rb