wavefront-cli 5.1.0 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +37 -1
  3. data/HISTORY.md +29 -0
  4. data/README.md +2 -4
  5. data/lib/wavefront-cli/account.rb +119 -0
  6. data/lib/wavefront-cli/alert.rb +29 -0
  7. data/lib/wavefront-cli/base.rb +13 -121
  8. data/lib/wavefront-cli/commands/.rubocop.yml +34 -0
  9. data/lib/wavefront-cli/commands/account.rb +61 -0
  10. data/lib/wavefront-cli/commands/alert.rb +1 -0
  11. data/lib/wavefront-cli/commands/base.rb +1 -1
  12. data/lib/wavefront-cli/commands/proxy.rb +2 -1
  13. data/lib/wavefront-cli/commands/query.rb +4 -1
  14. data/lib/wavefront-cli/commands/role.rb +44 -0
  15. data/lib/wavefront-cli/commands/spy.rb +0 -5
  16. data/lib/wavefront-cli/commands/usergroup.rb +7 -11
  17. data/lib/wavefront-cli/commands/write.rb +7 -2
  18. data/lib/wavefront-cli/controller.rb +5 -63
  19. data/lib/wavefront-cli/display/account.rb +122 -0
  20. data/lib/wavefront-cli/display/alert.rb +8 -0
  21. data/lib/wavefront-cli/display/base.rb +1 -1
  22. data/lib/wavefront-cli/display/cloudintegration.rb +3 -2
  23. data/lib/wavefront-cli/display/printer/long.rb +2 -1
  24. data/lib/wavefront-cli/display/proxy.rb +16 -0
  25. data/lib/wavefront-cli/display/role.rb +66 -0
  26. data/lib/wavefront-cli/display/settings.rb +1 -0
  27. data/lib/wavefront-cli/display/usergroup.rb +18 -14
  28. data/lib/wavefront-cli/exception_handler.rb +87 -0
  29. data/lib/wavefront-cli/helpers/load_file.rb +80 -0
  30. data/lib/wavefront-cli/output/hcl/base.rb +1 -1
  31. data/lib/wavefront-cli/output/hcl/dashboard.rb +1 -1
  32. data/lib/wavefront-cli/proxy.rb +5 -0
  33. data/lib/wavefront-cli/query.rb +13 -7
  34. data/lib/wavefront-cli/role.rb +54 -0
  35. data/lib/wavefront-cli/serviceaccount.rb +0 -6
  36. data/lib/wavefront-cli/spy.rb +0 -8
  37. data/lib/wavefront-cli/subcommands/import.rb +78 -0
  38. data/lib/wavefront-cli/usergroup.rb +8 -8
  39. data/lib/wavefront-cli/version.rb +1 -1
  40. data/lib/wavefront-cli/write.rb +29 -5
  41. data/spec/.rubocop.yml +34 -0
  42. data/spec/test_mixins/delete.rb +1 -2
  43. data/spec/test_mixins/import.rb +9 -3
  44. data/spec/wavefront-cli/account_spec.rb +303 -0
  45. data/spec/wavefront-cli/alert_spec.rb +28 -0
  46. data/spec/wavefront-cli/commands/write_spec.rb +1 -1
  47. data/spec/wavefront-cli/event_spec.rb +1 -1
  48. data/spec/wavefront-cli/output/csv/query_spec.rb +1 -1
  49. data/spec/wavefront-cli/output/wavefront/query_spec.rb +2 -2
  50. data/spec/wavefront-cli/query_spec.rb +20 -3
  51. data/spec/wavefront-cli/role_spec.rb +187 -0
  52. data/spec/wavefront-cli/serviceaccount_spec.rb +3 -3
  53. data/spec/wavefront-cli/usergroup_spec.rb +48 -43
  54. data/spec/wavefront-cli/write_spec.rb +44 -0
  55. data/wavefront-cli.gemspec +3 -3
  56. metadata +32 -32
  57. data/lib/wavefront-cli/commands/cluster.rb +0 -44
  58. data/lib/wavefront-cli/commands/user.rb +0 -54
  59. data/lib/wavefront-cli/display/monitoredcluster.rb +0 -14
  60. data/lib/wavefront-cli/display/user.rb +0 -103
  61. data/lib/wavefront-cli/monitoredcluster.rb +0 -50
  62. data/lib/wavefront-cli/user.rb +0 -92
  63. data/spec/wavefront-cli/monitoredcluster_spec.rb +0 -85
  64. data/spec/wavefront-cli/resources/responses/user-list.json +0 -1
  65. data/spec/wavefront-cli/user_spec.rb +0 -311
@@ -209,4 +209,48 @@ class WavefrontCliWriteTest < MiniTest::Test
209
209
  refute WavefrontCli::Write.new(infileformat: 'fma').distribution?
210
210
  refute WavefrontCli::Write.new({}).distribution?
211
211
  end
212
+
213
+ def test_sane_value
214
+ assert_equal(0, wf.sane_value(0))
215
+ assert_equal(0, wf.sane_value(''))
216
+ assert_equal(-10, wf.sane_value('-10.0'))
217
+ assert_equal(10, wf.sane_value(' 10'))
218
+ assert_equal(10, wf.sane_value('\\10'))
219
+ assert_equal(10, wf.sane_value('\10'))
220
+ assert_raises(WavefrontCli::Exception::InvalidValue) { wf.sane_value(nil) }
221
+ assert_raises(WavefrontCli::Exception::InvalidValue) { wf.sane_value({}) }
222
+ assert_raises(WavefrontCli::Exception::InvalidValue) { wf.sane_value([]) }
223
+ end
224
+
225
+ def test_random_value_asymmetric_range
226
+ lower_bound = -5
227
+ upper_bound = 20
228
+
229
+ max = (1..1000).map { wf.random_value(lower_bound, upper_bound) }.max
230
+ min = (1..1000).map { wf.random_value(lower_bound, upper_bound) }.min
231
+
232
+ assert(max <= upper_bound)
233
+ assert(min >= lower_bound)
234
+ refute_equal(max, min)
235
+ end
236
+
237
+ def test_random_value_symmetric_range
238
+ lower_bound = -15
239
+ upper_bound = 15
240
+
241
+ max = (1..1000).map { wf.random_value(lower_bound, upper_bound) }.max
242
+ min = (1..1000).map { wf.random_value(lower_bound, upper_bound) }.min
243
+
244
+ assert(max <= upper_bound)
245
+ assert(min >= lower_bound)
246
+ refute_equal(max, min)
247
+ end
248
+
249
+ def test_random_value_single_value
250
+ lower_bound = 5
251
+ upper_bound = 5
252
+
253
+ assert_equal([5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
254
+ (1..10).map { wf.random_value(lower_bound, upper_bound) })
255
+ end
212
256
  end
@@ -26,11 +26,11 @@ Gem::Specification.new do |gem|
26
26
 
27
27
  gem.add_runtime_dependency 'docopt', '~> 0.6.0'
28
28
  gem.add_runtime_dependency 'inifile', '~> 3.0'
29
- gem.add_runtime_dependency 'wavefront-sdk', '~> 4.0', '>= 4.0.0'
29
+ gem.add_runtime_dependency 'wavefront-sdk', '~> 5.0', '>= 5.0.1'
30
30
 
31
31
  gem.add_development_dependency 'minitest', '~> 5.11', '>= 5.11.0'
32
- gem.add_development_dependency 'rake', '~> 12.0'
33
- gem.add_development_dependency 'rubocop', '~> 0.79'
32
+ gem.add_development_dependency 'rake', '~> 13.0'
33
+ gem.add_development_dependency 'rubocop', '0.87.1'
34
34
  gem.add_development_dependency 'spy', '~> 1.0.0'
35
35
  gem.add_development_dependency 'webmock', '~> 3.7'
36
36
  gem.add_development_dependency 'yard', '~> 0.9.5'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wavefront-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 7.1.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-20 00:00:00.000000000 Z
11
+ date: 2020-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -44,68 +44,68 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '4.0'
47
+ version: '5.0'
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 4.0.0
50
+ version: 5.0.1
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: '4.0'
57
+ version: '5.0'
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 4.0.0
60
+ version: 5.0.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: minitest
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '5.11'
68
65
  - - ">="
69
66
  - !ruby/object:Gem::Version
70
67
  version: 5.11.0
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '5.11'
71
71
  type: :development
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '5.11'
78
75
  - - ">="
79
76
  - !ruby/object:Gem::Version
80
77
  version: 5.11.0
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '5.11'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rake
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '12.0'
87
+ version: '13.0'
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '12.0'
94
+ version: '13.0'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: rubocop
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - "~>"
99
+ - - '='
100
100
  - !ruby/object:Gem::Version
101
- version: '0.79'
101
+ version: 0.87.1
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - "~>"
106
+ - - '='
107
107
  - !ruby/object:Gem::Version
108
- version: '0.79'
108
+ version: 0.87.1
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: spy
111
111
  requirement: !ruby/object:Gem::Requirement
@@ -165,6 +165,7 @@ files:
165
165
  - README.md
166
166
  - Rakefile
167
167
  - bin/wf
168
+ - lib/wavefront-cli/account.rb
168
169
  - lib/wavefront-cli/alert.rb
169
170
  - lib/wavefront-cli/apitoken.rb
170
171
  - lib/wavefront-cli/base.rb
@@ -172,11 +173,11 @@ files:
172
173
  - lib/wavefront-cli/command_mixins/acl.rb
173
174
  - lib/wavefront-cli/command_mixins/tag.rb
174
175
  - lib/wavefront-cli/commands/.rubocop.yml
176
+ - lib/wavefront-cli/commands/account.rb
175
177
  - lib/wavefront-cli/commands/alert.rb
176
178
  - lib/wavefront-cli/commands/apitoken.rb
177
179
  - lib/wavefront-cli/commands/base.rb
178
180
  - lib/wavefront-cli/commands/cloudintegration.rb
179
- - lib/wavefront-cli/commands/cluster.rb
180
181
  - lib/wavefront-cli/commands/config.rb
181
182
  - lib/wavefront-cli/commands/dashboard.rb
182
183
  - lib/wavefront-cli/commands/derivedmetric.rb
@@ -189,13 +190,13 @@ files:
189
190
  - lib/wavefront-cli/commands/notificant.rb
190
191
  - lib/wavefront-cli/commands/proxy.rb
191
192
  - lib/wavefront-cli/commands/query.rb
193
+ - lib/wavefront-cli/commands/role.rb
192
194
  - lib/wavefront-cli/commands/savedsearch.rb
193
195
  - lib/wavefront-cli/commands/serviceaccount.rb
194
196
  - lib/wavefront-cli/commands/settings.rb
195
197
  - lib/wavefront-cli/commands/source.rb
196
198
  - lib/wavefront-cli/commands/spy.rb
197
199
  - lib/wavefront-cli/commands/usage.rb
198
- - lib/wavefront-cli/commands/user.rb
199
200
  - lib/wavefront-cli/commands/usergroup.rb
200
201
  - lib/wavefront-cli/commands/webhook.rb
201
202
  - lib/wavefront-cli/commands/window.rb
@@ -205,6 +206,7 @@ files:
205
206
  - lib/wavefront-cli/controller.rb
206
207
  - lib/wavefront-cli/dashboard.rb
207
208
  - lib/wavefront-cli/derivedmetric.rb
209
+ - lib/wavefront-cli/display/account.rb
208
210
  - lib/wavefront-cli/display/alert.rb
209
211
  - lib/wavefront-cli/display/apitoken.rb
210
212
  - lib/wavefront-cli/display/base.rb
@@ -219,32 +221,32 @@ files:
219
221
  - lib/wavefront-cli/display/maintenancewindow.rb
220
222
  - lib/wavefront-cli/display/message.rb
221
223
  - lib/wavefront-cli/display/metric.rb
222
- - lib/wavefront-cli/display/monitoredcluster.rb
223
224
  - lib/wavefront-cli/display/notificant.rb
224
225
  - lib/wavefront-cli/display/printer/long.rb
225
226
  - lib/wavefront-cli/display/printer/sparkline.rb
226
227
  - lib/wavefront-cli/display/printer/terse.rb
227
228
  - lib/wavefront-cli/display/proxy.rb
228
229
  - lib/wavefront-cli/display/query.rb
230
+ - lib/wavefront-cli/display/role.rb
229
231
  - lib/wavefront-cli/display/savedsearch.rb
230
232
  - lib/wavefront-cli/display/serviceaccount.rb
231
233
  - lib/wavefront-cli/display/settings.rb
232
234
  - lib/wavefront-cli/display/source.rb
233
235
  - lib/wavefront-cli/display/spy.rb
234
236
  - lib/wavefront-cli/display/usage.rb
235
- - lib/wavefront-cli/display/user.rb
236
237
  - lib/wavefront-cli/display/usergroup.rb
237
238
  - lib/wavefront-cli/display/webhook.rb
238
239
  - lib/wavefront-cli/display/write.rb
239
240
  - lib/wavefront-cli/event.rb
240
241
  - lib/wavefront-cli/exception.rb
242
+ - lib/wavefront-cli/exception_handler.rb
241
243
  - lib/wavefront-cli/externallink.rb
244
+ - lib/wavefront-cli/helpers/load_file.rb
242
245
  - lib/wavefront-cli/ingestionpolicy.rb
243
246
  - lib/wavefront-cli/integration.rb
244
247
  - lib/wavefront-cli/maintenancewindow.rb
245
248
  - lib/wavefront-cli/message.rb
246
249
  - lib/wavefront-cli/metric.rb
247
- - lib/wavefront-cli/monitoredcluster.rb
248
250
  - lib/wavefront-cli/notificant.rb
249
251
  - lib/wavefront-cli/opt_handler.rb
250
252
  - lib/wavefront-cli/output/base.rb
@@ -265,6 +267,7 @@ files:
265
267
  - lib/wavefront-cli/output/yaml.rb
266
268
  - lib/wavefront-cli/proxy.rb
267
269
  - lib/wavefront-cli/query.rb
270
+ - lib/wavefront-cli/role.rb
268
271
  - lib/wavefront-cli/savedsearch.rb
269
272
  - lib/wavefront-cli/serviceaccount.rb
270
273
  - lib/wavefront-cli/settings.rb
@@ -272,8 +275,8 @@ files:
272
275
  - lib/wavefront-cli/spy.rb
273
276
  - lib/wavefront-cli/stdlib/array.rb
274
277
  - lib/wavefront-cli/stdlib/string.rb
278
+ - lib/wavefront-cli/subcommands/import.rb
275
279
  - lib/wavefront-cli/usage.rb
276
- - lib/wavefront-cli/user.rb
277
280
  - lib/wavefront-cli/usergroup.rb
278
281
  - lib/wavefront-cli/version.rb
279
282
  - lib/wavefront-cli/webhook.rb
@@ -297,6 +300,7 @@ files:
297
300
  - spec/test_mixins/search.rb
298
301
  - spec/test_mixins/set.rb
299
302
  - spec/test_mixins/tag.rb
303
+ - spec/wavefront-cli/account_spec.rb
300
304
  - spec/wavefront-cli/alert_spec.rb
301
305
  - spec/wavefront-cli/apitoken_spec.rb
302
306
  - spec/wavefront-cli/base_spec.rb
@@ -329,7 +333,6 @@ files:
329
333
  - spec/wavefront-cli/maintenancewindow_spec.rb
330
334
  - spec/wavefront-cli/message_spec.rb
331
335
  - spec/wavefront-cli/metric_spec.rb
332
- - spec/wavefront-cli/monitoredcluster_spec.rb
333
336
  - spec/wavefront-cli/notificant_spec.rb
334
337
  - spec/wavefront-cli/opt_handler_spec.rb
335
338
  - spec/wavefront-cli/output/csv/query_spec.rb
@@ -371,7 +374,6 @@ files:
371
374
  - spec/wavefront-cli/resources/responses/query.json
372
375
  - spec/wavefront-cli/resources/responses/savedsearch-list.json
373
376
  - spec/wavefront-cli/resources/responses/usage-export-csv.json
374
- - spec/wavefront-cli/resources/responses/user-list.json
375
377
  - spec/wavefront-cli/resources/responses/user-validate.json
376
378
  - spec/wavefront-cli/resources/responses/usergroup-list.json
377
379
  - spec/wavefront-cli/resources/responses/webhook-list.json
@@ -381,6 +383,7 @@ files:
381
383
  - spec/wavefront-cli/resources/updates/alert.json
382
384
  - spec/wavefront-cli/resources/updates/dashboard.json
383
385
  - spec/wavefront-cli/resources/wavefront.conf
386
+ - spec/wavefront-cli/role_spec.rb
384
387
  - spec/wavefront-cli/savedsearch_spec.rb
385
388
  - spec/wavefront-cli/serviceaccount_spec.rb
386
389
  - spec/wavefront-cli/settings_spec.rb
@@ -389,7 +392,6 @@ files:
389
392
  - spec/wavefront-cli/stdlib/array_spec.rb
390
393
  - spec/wavefront-cli/stdlib/string_spec.rb
391
394
  - spec/wavefront-cli/usage_spec.rb
392
- - spec/wavefront-cli/user_spec.rb
393
395
  - spec/wavefront-cli/usergroup_spec.rb
394
396
  - spec/wavefront-cli/webhook_spec.rb
395
397
  - spec/wavefront-cli/write_spec.rb
@@ -413,8 +415,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
415
  - !ruby/object:Gem::Version
414
416
  version: '0'
415
417
  requirements: []
416
- rubyforge_project:
417
- rubygems_version: 2.7.7
418
+ rubygems_version: 3.0.8
418
419
  signing_key:
419
420
  specification_version: 4
420
421
  summary: CLI for Wavefront API v2
@@ -438,6 +439,7 @@ test_files:
438
439
  - spec/test_mixins/search.rb
439
440
  - spec/test_mixins/set.rb
440
441
  - spec/test_mixins/tag.rb
442
+ - spec/wavefront-cli/account_spec.rb
441
443
  - spec/wavefront-cli/alert_spec.rb
442
444
  - spec/wavefront-cli/apitoken_spec.rb
443
445
  - spec/wavefront-cli/base_spec.rb
@@ -470,7 +472,6 @@ test_files:
470
472
  - spec/wavefront-cli/maintenancewindow_spec.rb
471
473
  - spec/wavefront-cli/message_spec.rb
472
474
  - spec/wavefront-cli/metric_spec.rb
473
- - spec/wavefront-cli/monitoredcluster_spec.rb
474
475
  - spec/wavefront-cli/notificant_spec.rb
475
476
  - spec/wavefront-cli/opt_handler_spec.rb
476
477
  - spec/wavefront-cli/output/csv/query_spec.rb
@@ -512,7 +513,6 @@ test_files:
512
513
  - spec/wavefront-cli/resources/responses/query.json
513
514
  - spec/wavefront-cli/resources/responses/savedsearch-list.json
514
515
  - spec/wavefront-cli/resources/responses/usage-export-csv.json
515
- - spec/wavefront-cli/resources/responses/user-list.json
516
516
  - spec/wavefront-cli/resources/responses/user-validate.json
517
517
  - spec/wavefront-cli/resources/responses/usergroup-list.json
518
518
  - spec/wavefront-cli/resources/responses/webhook-list.json
@@ -522,6 +522,7 @@ test_files:
522
522
  - spec/wavefront-cli/resources/updates/alert.json
523
523
  - spec/wavefront-cli/resources/updates/dashboard.json
524
524
  - spec/wavefront-cli/resources/wavefront.conf
525
+ - spec/wavefront-cli/role_spec.rb
525
526
  - spec/wavefront-cli/savedsearch_spec.rb
526
527
  - spec/wavefront-cli/serviceaccount_spec.rb
527
528
  - spec/wavefront-cli/settings_spec.rb
@@ -530,7 +531,6 @@ test_files:
530
531
  - spec/wavefront-cli/stdlib/array_spec.rb
531
532
  - spec/wavefront-cli/stdlib/string_spec.rb
532
533
  - spec/wavefront-cli/usage_spec.rb
533
- - spec/wavefront-cli/user_spec.rb
534
534
  - spec/wavefront-cli/usergroup_spec.rb
535
535
  - spec/wavefront-cli/webhook_spec.rb
536
536
  - spec/wavefront-cli/write_spec.rb
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base'
4
-
5
- # Define the monitored cluster command.
6
- #
7
- class WavefrontCommandCluster < WavefrontCommandBase
8
- def thing
9
- 'monitored cluster'
10
- end
11
-
12
- def sdk_file
13
- 'monitoredcluster'
14
- end
15
-
16
- def sdk_class
17
- 'MonitoredCluster'
18
- end
19
-
20
- def _commands
21
- ["list #{CMN} [-al] [-O fields] [-o offset] [-L limit]",
22
- "describe #{CMN} <id>",
23
- "delete #{CMN} <id>",
24
- "create #{CMN} [-v version] <platform> <name> <id>",
25
- "dump #{CMN}",
26
- "import #{CMN} [-uU] <file>",
27
- "set #{CMN} <key=value> <id>",
28
- tag_commands,
29
- "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>...",
30
- "merge #{CMN} <id_to> <id_from>"]
31
- end
32
-
33
- def _options
34
- [common_options,
35
- "-l, --long list #{things} in detail",
36
- "-a, --all list all #{things}",
37
- "-o, --offset=n start from nth #{thing}",
38
- '-O, --fields=F1,F2,... only show given fields',
39
- "-L, --limit=COUNT number of #{things} to list",
40
- "-u, --update update an existing #{thing}",
41
- "-U, --upsert import new or update existing #{thing}",
42
- "-v, --version=VERSION version of #{thing}"]
43
- end
44
- end
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base'
4
-
5
- # Define the user command.
6
- #
7
- class WavefrontCommandUser < WavefrontCommandBase
8
- def description
9
- "view and manage Wavefront #{things}"
10
- end
11
-
12
- # delete uses a different string because it accepts multiples.
13
- # Adding ellipsis to <id> causes everything else to expect an
14
- # array.
15
- #
16
- def _commands
17
- ["list #{CMN} [-l] [-O fields]",
18
- "describe #{CMN} <id>",
19
- "create #{CMN} [-e] [-m permission...] [-g group...] <id>",
20
- "invite #{CMN} [-m permission...] [-g group...] <id>",
21
- "delete #{CMN} <user>...",
22
- "dump #{CMN}",
23
- "import #{CMN} [-uU] <file>",
24
- "groups #{CMN} <id>",
25
- "privileges #{CMN} <id>",
26
- "join #{CMN} <id> <group>...",
27
- "leave #{CMN} <id> <group>...",
28
- "grant #{CMN} <privilege> to <id>",
29
- "revoke #{CMN} <privilege> from <id>",
30
- "business functions #{CMN} <id>",
31
- "validate #{CMN} [-l] <user>...",
32
- "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
33
- end
34
-
35
- def _options
36
- [common_options,
37
- "-l, --long list #{things} in detail",
38
- "-a, --all list all #{things}",
39
- "-o, --offset=n start from nth #{thing}",
40
- "-L, --limit=COUNT number of #{things} to list",
41
- '-O, --fields=F1,F2,... only show given fields',
42
- "-u, --update update an existing #{thing}",
43
- "-U, --upsert import new or update existing #{thing}",
44
- "-e, --email send e-mail to #{thing} on account creation",
45
- "-m, --permission=STRING give #{thing} this permission",
46
- "-g, --group=STRING add #{thing} to this user group"]
47
- end
48
-
49
- def postscript
50
- 'If your account does not have RBAC enabled, you must grant user ' \
51
- "permissions with '-m'. For a list of permissions, see " \
52
- "'wf usergroup --help'.".fold(TW, 0)
53
- end
54
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base'
4
-
5
- module WavefrontDisplay
6
- #
7
- # Format human-readable output for monitored clusters.
8
- #
9
- class MonitoredCluster < Base
10
- def do_list_brief
11
- multicolumn(:id, :platform, :name)
12
- end
13
- end
14
- end