wavefront-cli 2.18.0 → 3.0.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 +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +7 -0
- data/.travis.yml +4 -5
- data/HISTORY.md +20 -1
- data/README.md +79 -29
- data/lib/wavefront-cli/base.rb +26 -2
- data/lib/wavefront-cli/commands/alert.rb +10 -10
- data/lib/wavefront-cli/commands/base.rb +15 -2
- data/lib/wavefront-cli/commands/cloudintegration.rb +3 -3
- data/lib/wavefront-cli/commands/config.rb +2 -1
- data/lib/wavefront-cli/commands/dashboard.rb +8 -6
- data/lib/wavefront-cli/commands/derivedmetric.rb +5 -5
- data/lib/wavefront-cli/commands/event.rb +3 -3
- data/lib/wavefront-cli/commands/integration.rb +5 -5
- data/lib/wavefront-cli/commands/link.rb +3 -3
- data/lib/wavefront-cli/commands/message.rb +2 -2
- data/lib/wavefront-cli/commands/metric.rb +1 -1
- data/lib/wavefront-cli/commands/notificant.rb +3 -3
- data/lib/wavefront-cli/commands/proxy.rb +3 -3
- data/lib/wavefront-cli/commands/query.rb +3 -3
- data/lib/wavefront-cli/commands/savedsearch.rb +3 -3
- data/lib/wavefront-cli/commands/settings.rb +22 -0
- data/lib/wavefront-cli/commands/source.rb +3 -3
- data/lib/wavefront-cli/commands/user.rb +4 -4
- data/lib/wavefront-cli/commands/usergroup.rb +5 -8
- data/lib/wavefront-cli/commands/webhook.rb +3 -3
- data/lib/wavefront-cli/commands/window.rb +3 -3
- data/lib/wavefront-cli/commands/write.rb +6 -4
- data/lib/wavefront-cli/config.rb +14 -0
- data/lib/wavefront-cli/controller.rb +2 -0
- data/lib/wavefront-cli/dashboard.rb +133 -14
- data/lib/wavefront-cli/display/base.rb +28 -7
- data/lib/wavefront-cli/display/dashboard.rb +32 -8
- data/lib/wavefront-cli/display/distribution.rb +4 -1
- data/lib/wavefront-cli/display/printer/long.rb +149 -140
- data/lib/wavefront-cli/display/printer/terse.rb +19 -42
- data/lib/wavefront-cli/display/query.rb +6 -0
- data/lib/wavefront-cli/display/settings.rb +21 -0
- data/lib/wavefront-cli/display/write.rb +12 -5
- data/lib/wavefront-cli/event.rb +1 -1
- data/lib/wavefront-cli/exception.rb +1 -0
- data/lib/wavefront-cli/settings.rb +37 -0
- data/lib/wavefront-cli/stdlib/array.rb +20 -0
- data/lib/wavefront-cli/stdlib/string.rb +8 -0
- data/lib/wavefront-cli/user.rb +1 -1
- data/lib/wavefront-cli/version.rb +1 -1
- data/lib/wavefront-cli/write.rb +310 -10
- data/spec/.rubocop.yml +3 -0
- data/spec/spec_helper.rb +81 -1
- data/spec/wavefront-cli/alert_spec.rb +1 -0
- data/spec/wavefront-cli/cloudintegration_spec.rb +1 -0
- data/spec/wavefront-cli/dashboard_spec.rb +47 -4
- data/spec/wavefront-cli/derivedmetric_spec.rb +1 -0
- data/spec/wavefront-cli/display/base_spec.rb +16 -9
- data/spec/wavefront-cli/display/printer/long_spec.rb +75 -106
- data/spec/wavefront-cli/display/printer/terse_spec.rb +33 -21
- data/spec/wavefront-cli/event_spec.rb +1 -0
- data/spec/wavefront-cli/externallink_spec.rb +1 -0
- data/spec/wavefront-cli/integration_spec.rb +1 -0
- data/spec/wavefront-cli/maintenancewindow_spec.rb +1 -0
- data/spec/wavefront-cli/proxy_spec.rb +2 -0
- data/spec/wavefront-cli/query_spec.rb +9 -0
- data/spec/wavefront-cli/resources/display/alert-human-long +24 -0
- data/spec/wavefront-cli/resources/display/alert-input.json +37 -0
- data/spec/wavefront-cli/resources/display/alerts-human-terse +9 -0
- data/spec/wavefront-cli/resources/display/alerts-input.json +1 -0
- data/spec/wavefront-cli/resources/display/user-human-long +19 -0
- data/spec/wavefront-cli/resources/display/user-human-long-no_sep +18 -0
- data/spec/wavefront-cli/resources/display/user-input.json +1 -0
- data/spec/wavefront-cli/resources/responses/README.md +2 -0
- data/spec/wavefront-cli/resources/responses/alert-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/backups.json +1 -0
- data/spec/wavefront-cli/resources/responses/cloudintegration-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/dashboard-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/derivedmetric-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/event-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/integration-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/link-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/notificant-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/proxy-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/query-cpu.json +1 -0
- data/spec/wavefront-cli/resources/responses/savedsearch-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/user-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/usergroup-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/webhook-list.json +1 -0
- data/spec/wavefront-cli/resources/responses/window-list.json +1 -0
- data/spec/wavefront-cli/savedsearch_spec.rb +1 -0
- data/spec/wavefront-cli/settings_spec.rb +19 -0
- data/spec/wavefront-cli/stdlib/array_spec.rb +20 -0
- data/spec/wavefront-cli/stdlib/string_spec.rb +13 -1
- data/spec/wavefront-cli/user_spec.rb +1 -0
- data/spec/wavefront-cli/usergroup_spec.rb +1 -0
- data/spec/wavefront-cli/webhook_spec.rb +1 -0
- data/spec/wavefront-cli/write_spec.rb +167 -0
- data/wavefront-cli.gemspec +3 -4
- metadata +65 -31
- data/.gitlab-ci.yml +0 -16
- data/lib/wavefront-cli/base_write.rb +0 -298
- data/lib/wavefront-cli/commands/report.rb +0 -37
- data/lib/wavefront-cli/display/printer/base.rb +0 -24
- data/lib/wavefront-cli/display/report.rb +0 -17
- data/lib/wavefront-cli/report.rb +0 -18
- data/spec/wavefront-cli/display/printer/base_spec.rb +0 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de9815c9b9f4313ee08d41e7890edfd991f2c59e8d8a59edf21e616f4c40dbf1
|
|
4
|
+
data.tar.gz: 391a6628ebdb0fd14621050e72e806d8da2fffb3f6f6cacdf098a614c8b7c198
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba5158a38ab4708f07db85b861e093c4f9e0e03761845eeced6fcc320b67b2b9829846dec1f03941b10d809fd8d1680c04d77afdbfa8aa5c5d85e7348f21f21a
|
|
7
|
+
data.tar.gz: 775b238037143d7b2b56c3a2a6e643737f80de93b3079027e243a8bff9e2900bfed2b3d662c40d1c231dfa1b16a2241fcd973afd83b56545f5fa781bc353b98c
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
language: ruby
|
|
2
2
|
cache: bundler
|
|
3
3
|
rvm:
|
|
4
|
-
- 2.2.10
|
|
5
4
|
- 2.3.8
|
|
6
5
|
- 2.4.5
|
|
7
|
-
- 2.5.
|
|
8
|
-
- 2.6.
|
|
9
|
-
before_install: gem install bundler
|
|
6
|
+
- 2.5.5
|
|
7
|
+
- 2.6.2
|
|
8
|
+
before_install: gem install bundler --no-document
|
|
10
9
|
deploy:
|
|
11
10
|
provider: rubygems
|
|
12
11
|
api_key:
|
|
@@ -15,7 +14,7 @@ deploy:
|
|
|
15
14
|
on:
|
|
16
15
|
tags: true
|
|
17
16
|
repo: snltd/wavefront-cli
|
|
18
|
-
ruby: 2.
|
|
17
|
+
ruby: 2.6.2
|
|
19
18
|
notifications:
|
|
20
19
|
email: false
|
|
21
20
|
slack:
|
data/HISTORY.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.0.0 (23/03/2019)
|
|
4
|
+
* Drop support for Ruby 2.2. (Potentially breaking change.)
|
|
5
|
+
* Remove the (deprecated) `report` command. Send points directly to
|
|
6
|
+
Wavefront with `write --use api`. (Potentially breaking change.)
|
|
7
|
+
* Added `settings` command to view and manage system preferences.
|
|
8
|
+
* `dashboard` command supports new ACL mechanism.
|
|
9
|
+
* All commands now accept the `-f` (`--format`) option.
|
|
10
|
+
* New, improved `human` output. Finally fixes a very old bug where
|
|
11
|
+
heavily indented columns could run into one another.
|
|
12
|
+
* In long listings, items with empty values now display as `<none`>
|
|
13
|
+
instead of being omitted.
|
|
14
|
+
* Move `id` and `name` to the top of objects in long listings, for
|
|
15
|
+
easier reading.
|
|
16
|
+
* Improved output testing
|
|
17
|
+
* `wf write` understands `--`, which makes it easier to send
|
|
18
|
+
negative values.
|
|
19
|
+
* Fix ugly output when a raw query did not specify a host.
|
|
20
|
+
* New `config about` subcommand gives diagnostic info.
|
|
21
|
+
* Require 3.0.0 of [the SDK](https://github.com/snltd/wavefront-sdk).
|
|
22
|
+
|
|
3
23
|
## 2.18.0 (22/02/2019)
|
|
4
24
|
* Add `usergroup` command, and extend `user` command to cover new
|
|
5
25
|
RBAC features.
|
|
@@ -14,7 +34,6 @@
|
|
|
14
34
|
headers`, not `-F header`.
|
|
15
35
|
|
|
16
36
|
## 2.16.1 (29/12/2018)
|
|
17
|
-
|
|
18
37
|
* Fix regression which broke query time ranges.
|
|
19
38
|
* Fix regression which made `--noop` silent unless `--verbose` was
|
|
20
39
|
also specified.
|
data/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Wavefront CLI
|
|
2
2
|
[](https://travis-ci.org/snltd/wavefront-cli) [](https://codeclimate.com/github/snltd/wavefront-cli/maintainability) [](https://badge.fury.io/rb/wavefront-cli) 
|
|
3
3
|
|
|
4
|
-
This
|
|
4
|
+
This is a complete command-line interface to
|
|
5
5
|
[Wavefront](https://www.wavefront.com/)'s API. It also provides easy
|
|
6
|
-
ways to
|
|
6
|
+
ways to get data into Wavefront.
|
|
7
7
|
|
|
8
8
|
The gem is hosted [on
|
|
9
9
|
Rubygems](https://rubygems.org/gems/wavefront-cli) and can be
|
|
@@ -15,7 +15,7 @@ $ gem install wavefront-cli
|
|
|
15
15
|
|
|
16
16
|
It is built on [our Wavefront Ruby
|
|
17
17
|
SDK](https://github.com/snltd/wavefront-sdk) and requires Ruby >=
|
|
18
|
-
2.
|
|
18
|
+
2.3. It has no "native extension" dependencies.
|
|
19
19
|
|
|
20
20
|
For a far more comprehensive overview/tutorial, please read [this
|
|
21
21
|
article](http://sysdef.xyz/post/2017-07-26-wavefront-cli).
|
|
@@ -43,7 +43,6 @@ Commands:
|
|
|
43
43
|
notificant view and manage Wavefront alert targets
|
|
44
44
|
proxy view and manage Wavefront proxies
|
|
45
45
|
query query the Wavefront API
|
|
46
|
-
report send data directly to Wavefront
|
|
47
46
|
savedsearch view and manage saved searches
|
|
48
47
|
source view and manage source tags and descriptions
|
|
49
48
|
user view and manage Wavefront users
|
|
@@ -130,13 +129,16 @@ something.
|
|
|
130
129
|
|
|
131
130
|
### Formats, Importing, and Exporting
|
|
132
131
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
All commands support the `-f` option. This takes one of `json`,
|
|
133
|
+
`yaml`, `human` and `raw`, and tells the CLI to present the
|
|
134
|
+
information it fetches from the Wavefront API in that format. (`raw`
|
|
135
|
+
is the raw Ruby representation, which, for instance, you could paste
|
|
136
|
+
into `irb`.) Some object types can be exported in other formats.
|
|
137
|
+
Alerts, notificants and dashboards can be exported as HCL, for easy
|
|
138
|
+
integration with [Space Ape's Wavefront Terraform
|
|
139
|
+
provider](https://tech.spaceapegames.com/2017/09/28/building-a-custom-terraform-provider-for-wavefront/).
|
|
140
|
+
Query results can be presented as CSV files, or in the native
|
|
141
|
+
Wavefront data format.
|
|
140
142
|
|
|
141
143
|
Human output can be selective. As well as the time formatting
|
|
142
144
|
mentioned above, human-readable listings and desctiptions may omit
|
|
@@ -192,21 +194,55 @@ that in the morning, the time would be invalid, and you would get a
|
|
|
192
194
|
|
|
193
195
|
There is no need to include a timezone in your time: the `wf`
|
|
194
196
|
CLI will automatically use your local timezone when it parses the
|
|
195
|
-
string.
|
|
197
|
+
string. You can also specify relative times: for instance '-10m' for
|
|
198
|
+
the last ten minutes.
|
|
196
199
|
|
|
197
|
-
|
|
200
|
+
## Querying Data
|
|
201
|
+
|
|
202
|
+
Use the `query` subcommand with any timeseries expression.
|
|
198
203
|
|
|
199
204
|
```
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
+
./wf query "ts(cpu.*.pc.user, source=cube)" | more
|
|
206
|
+
name ts(cpu.*.pc.user, source=cube)
|
|
207
|
+
query ts(cpu.*.pc.user, source=cube)
|
|
208
|
+
timeseries
|
|
209
|
+
label cpu.0.pc.user
|
|
210
|
+
sparkline > ▇▅ █<
|
|
211
|
+
host cube
|
|
212
|
+
tags
|
|
213
|
+
env lab
|
|
214
|
+
data 13:39:00 26.081756828668336
|
|
215
|
+
13:40:00 20.37380923087
|
|
216
|
+
13:41:00 4.086552186471667
|
|
217
|
+
13:42:00 2.5642049289966664
|
|
218
|
+
13:43:00 2.542284133615
|
|
219
|
+
13:44:00 2.6524157880366666
|
|
220
|
+
13:45:00 2.1158611431600005
|
|
221
|
+
13:46:00 27.911804005566665
|
|
222
|
+
2019-03-07 13:38:00 3.8412758439216668
|
|
223
|
+
------------------------------------------------------------------
|
|
224
|
+
label cpu.1.pc.user
|
|
225
|
+
sparkline > █▅ ▇<
|
|
226
|
+
host cube
|
|
227
|
+
tags
|
|
228
|
+
env lab
|
|
229
|
+
data 13:39:00 27.45281202666833
|
|
230
|
+
13:40:00 19.441659754188333
|
|
231
|
+
13:41:00 3.96397654233
|
|
232
|
+
13:42:00 2.49657063456
|
|
233
|
+
13:43:00 2.4946187951783334
|
|
234
|
+
13:44:00 2.8966526517783335
|
|
235
|
+
13:45:00 2.636301021795
|
|
236
|
+
13:46:00 25.407542657531668
|
|
237
|
+
2019-03-07 13:38:00 4.655340261835
|
|
238
|
+
...
|
|
239
|
+
events <none>
|
|
240
|
+
warnings <none>
|
|
241
|
+
|
|
205
242
|
```
|
|
206
243
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
fail. This output can be very verbose.
|
|
244
|
+
By default you get the last ten minutes of data, but the time
|
|
245
|
+
windowing rules can be used to specify any range.
|
|
210
246
|
|
|
211
247
|
## Writing Points
|
|
212
248
|
|
|
@@ -219,8 +255,7 @@ $ wf write point cli.example 10
|
|
|
219
255
|
and you can add point tags, if you like.
|
|
220
256
|
|
|
221
257
|
```
|
|
222
|
-
$ wf write point cli.example 9.4 -E wavefront -T proxy=wavefront
|
|
223
|
-
-T from=README
|
|
258
|
+
$ wf write point cli.example 9.4 -E wavefront -T proxy=wavefront -T from=README
|
|
224
259
|
```
|
|
225
260
|
|
|
226
261
|
or force a timestamp:
|
|
@@ -251,15 +286,30 @@ $ while true; do echo $RANDOM; sleep 1; done | wf write file -m cli.demo -Fv -
|
|
|
251
286
|
```
|
|
252
287
|
|
|
253
288
|
If you wish to write points directly via the API, and you have the
|
|
254
|
-
"direct ingestion" privilege, just
|
|
255
|
-
|
|
256
|
-
|
|
289
|
+
"direct ingestion" privilege, just add `-u api` to your `write`
|
|
290
|
+
command. To send points to a proxy over HTTP, use `-u http`, and to
|
|
291
|
+
write to a Unix socket use `-u unix`.
|
|
257
292
|
|
|
258
|
-
|
|
259
|
-
writing negative values is a bit of a mess.
|
|
293
|
+
You can write delta metrics with `-i` (for increment).
|
|
260
294
|
|
|
261
295
|
```
|
|
296
|
+
$ wf write point -i counter.example 4
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
To sent negative values, you must use `--` to tell `wf` that you
|
|
300
|
+
have finished declaring options, or get creative with your quoting.
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
$ wf write point cli.example -- -10
|
|
262
304
|
$ wf write point cli.example "\-10"
|
|
263
305
|
```
|
|
264
306
|
|
|
265
|
-
You can write
|
|
307
|
+
You can even write distibutions. Either list every number
|
|
308
|
+
individually, or use `x` to specify multiples of any value. You can
|
|
309
|
+
mix and match within the same line.
|
|
310
|
+
|
|
311
|
+
```
|
|
312
|
+
$ wf write distribution dist.example 3 1 4 1 1 2 3 6 4 1 3 2
|
|
313
|
+
$ wf write distribution dist.example 3x3 4x1 2x4 2x2 1x6
|
|
314
|
+
$ wf write distribution dist.example 3x3 4x1 4 4 2x2 6
|
|
315
|
+
```
|
data/lib/wavefront-cli/base.rb
CHANGED
|
@@ -152,7 +152,8 @@ module WavefrontCli
|
|
|
152
152
|
#
|
|
153
153
|
def format_var
|
|
154
154
|
options[:format].to_sym
|
|
155
|
-
|
|
155
|
+
rescue NoMethodError
|
|
156
|
+
:human
|
|
156
157
|
end
|
|
157
158
|
|
|
158
159
|
# Works out the user's command by matching any options docopt has
|
|
@@ -202,7 +203,7 @@ module WavefrontCli
|
|
|
202
203
|
# instance variable.
|
|
203
204
|
#
|
|
204
205
|
# @param data [WavefrontResponse] an object returned by a
|
|
205
|
-
# Wavefront SDK method. This will contain
|
|
206
|
+
# Wavefront SDK method. This will contain 'response'
|
|
206
207
|
# and 'status' structures.
|
|
207
208
|
# @param method [String] the name of the method which produced
|
|
208
209
|
# this output. Used to find a suitable humanize method.
|
|
@@ -489,5 +490,28 @@ module WavefrontCli
|
|
|
489
490
|
def cannot_noop!
|
|
490
491
|
raise WavefrontCli::Exception::UnsupportedNoop if options[:noop]
|
|
491
492
|
end
|
|
493
|
+
|
|
494
|
+
# A recursive function which fetches list of values from a
|
|
495
|
+
# nested hash. Used by WavefrontCli::Dashboard#do_queries
|
|
496
|
+
# @param obj [Object] the thing to search
|
|
497
|
+
# @param key [String, Symbol] the key to search for
|
|
498
|
+
# @param aggr [Array] values of matched keys
|
|
499
|
+
# @return [Array]
|
|
500
|
+
#
|
|
501
|
+
def extract_values(obj, key, aggr = [])
|
|
502
|
+
if obj.is_a?(Hash)
|
|
503
|
+
obj.each_pair do |k, v|
|
|
504
|
+
if k == key && !v.to_s.empty?
|
|
505
|
+
aggr.<< v
|
|
506
|
+
else
|
|
507
|
+
extract_values(v, key, aggr)
|
|
508
|
+
end
|
|
509
|
+
end
|
|
510
|
+
elsif obj.is_a?(Array)
|
|
511
|
+
obj.each { |e| extract_values(e, key, aggr) }
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
aggr
|
|
515
|
+
end
|
|
492
516
|
end
|
|
493
517
|
end
|
|
@@ -8,28 +8,28 @@ class WavefrontCommandAlert < WavefrontCommandBase
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def _commands
|
|
11
|
-
["list #{CMN} [-al] [-O fields] [-
|
|
12
|
-
"firing #{CMN} [-
|
|
13
|
-
"snoozed #{CMN} [-
|
|
14
|
-
"describe #{CMN} [-
|
|
11
|
+
["list #{CMN} [-al] [-O fields] [-o offset] [-L limit]",
|
|
12
|
+
"firing #{CMN} [-o offset] [-L limit]",
|
|
13
|
+
"snoozed #{CMN} [-o offset] [-L limit]",
|
|
14
|
+
"describe #{CMN} [-v version] <id>",
|
|
15
15
|
"delete #{CMN} <id>",
|
|
16
16
|
"undelete #{CMN} <id>",
|
|
17
|
-
"history #{CMN} [-
|
|
17
|
+
"history #{CMN} [-o offset] [-L limit] <id>",
|
|
18
18
|
"import #{CMN} <file>",
|
|
19
19
|
"snooze #{CMN} [-T time] <id>",
|
|
20
20
|
"update #{CMN} <key=value> <id>",
|
|
21
21
|
"unsnooze #{CMN} <id>",
|
|
22
|
-
"search #{CMN} [-al] [-
|
|
23
|
-
"tags #{CMN}
|
|
22
|
+
"search #{CMN} [-al] [-o offset] [-L limit] <condition>...",
|
|
23
|
+
"tags #{CMN} <id>",
|
|
24
24
|
"tag set #{CMN} <id> <tag>...",
|
|
25
25
|
"tag clear #{CMN} <id>",
|
|
26
26
|
"tag add #{CMN} <id> <tag>",
|
|
27
27
|
"tag delete #{CMN} <id> <tag>",
|
|
28
|
-
"currently #{CMN}
|
|
29
|
-
"queries #{CMN} [-
|
|
28
|
+
"currently #{CMN} <state>",
|
|
29
|
+
"queries #{CMN} [-b] [<id>]",
|
|
30
30
|
"install #{CMN} <id>",
|
|
31
31
|
"uninstall #{CMN} <id>",
|
|
32
|
-
"summary #{CMN} [-
|
|
32
|
+
"summary #{CMN} [-a]"]
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def _options
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require_relative '../stdlib/string'
|
|
2
2
|
|
|
3
|
-
CMN = '[-DnV] [-c file] [-P profile] [-E endpoint] [-t token]'
|
|
3
|
+
CMN = '[-DnV] [-c file] [-P profile] [-E endpoint] [-t token] ' \
|
|
4
|
+
'[-f format]'.freeze
|
|
4
5
|
|
|
5
6
|
# A base class which all command classes extend.
|
|
6
7
|
#
|
|
@@ -36,13 +37,25 @@ class WavefrontCommandBase
|
|
|
36
37
|
# @return [Array]
|
|
37
38
|
#
|
|
38
39
|
def tag_commands
|
|
39
|
-
["tags #{CMN}
|
|
40
|
+
["tags #{CMN} <id>",
|
|
40
41
|
"tag set #{CMN} <id> <tag>...",
|
|
41
42
|
"tag clear #{CMN} <id>",
|
|
42
43
|
"tag add #{CMN} <id> <tag>",
|
|
43
44
|
"tag delete #{CMN} <id> <tag>"]
|
|
44
45
|
end
|
|
45
46
|
|
|
47
|
+
# Anything which takes ACLs provides the same interface
|
|
48
|
+
# @return [Array]
|
|
49
|
+
#
|
|
50
|
+
def acl_commands
|
|
51
|
+
["acls #{CMN} <id>",
|
|
52
|
+
"acl #{CMN} clear <id>",
|
|
53
|
+
"acl #{CMN} grant (view | modify) on <id> to " \
|
|
54
|
+
'(user | group) <name>...',
|
|
55
|
+
"acl #{CMN} revoke (view | modify) on <id> from " \
|
|
56
|
+
'(user | group) <name>...']
|
|
57
|
+
end
|
|
58
|
+
|
|
46
59
|
# Inheriting classes must override this method
|
|
47
60
|
# @return [Array]
|
|
48
61
|
#
|
|
@@ -16,14 +16,14 @@ class WavefrontCommandCloudintegration < WavefrontCommandBase
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def _commands
|
|
19
|
-
["list #{CMN} [-al] [-O fields] [-
|
|
20
|
-
"describe #{CMN}
|
|
19
|
+
["list #{CMN} [-al] [-O fields] [-o offset] [-L limit]",
|
|
20
|
+
"describe #{CMN} <id>",
|
|
21
21
|
"delete #{CMN} <id>",
|
|
22
22
|
"undelete #{CMN} <id>",
|
|
23
23
|
"enable #{CMN} <id>",
|
|
24
24
|
"disable #{CMN} <id>",
|
|
25
25
|
"import #{CMN} <file>",
|
|
26
|
-
"search #{CMN} [-al] [-
|
|
26
|
+
"search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def _options
|
|
@@ -8,17 +8,19 @@ class WavefrontCommandDashboard < WavefrontCommandBase
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def _commands
|
|
11
|
-
["list #{CMN} [-alN] [-O fields] [-
|
|
12
|
-
"describe #{CMN} [-
|
|
13
|
-
"import #{CMN}
|
|
11
|
+
["list #{CMN} [-alN] [-O fields] [-o offset] [-L limit]",
|
|
12
|
+
"describe #{CMN} [-v version] <id>",
|
|
13
|
+
"import #{CMN} <file>",
|
|
14
14
|
"update #{CMN} <key=value> <id>",
|
|
15
15
|
"delete #{CMN} <id>",
|
|
16
16
|
"undelete #{CMN} <id>",
|
|
17
|
-
"history #{CMN} [-
|
|
18
|
-
"search #{CMN} [-al] [-
|
|
19
|
-
"queries #{CMN} [-
|
|
17
|
+
"history #{CMN} [-o offset] [-L limit] <id>",
|
|
18
|
+
"search #{CMN} [-al] [-o offset] [-L limit] <condition>...",
|
|
19
|
+
"queries #{CMN} [-b] [<id>]",
|
|
20
|
+
"favs #{CMN}",
|
|
20
21
|
"fav #{CMN} <id>",
|
|
21
22
|
"unfav #{CMN} <id>",
|
|
23
|
+
acl_commands,
|
|
22
24
|
tag_commands]
|
|
23
25
|
end
|
|
24
26
|
|
|
@@ -16,16 +16,16 @@ class WavefrontCommandDerivedmetric < WavefrontCommandBase
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def _commands
|
|
19
|
-
["list #{CMN} [-al] [-O fields] [-
|
|
20
|
-
"describe #{CMN} [-
|
|
19
|
+
["list #{CMN} [-al] [-O fields] [-o offset] [-L limit]",
|
|
20
|
+
"describe #{CMN} [-v version] <id>",
|
|
21
21
|
"create #{CMN} [-d description] [-T tag...] [-b] [-i interval] " \
|
|
22
22
|
'[-r range] <name> <query>',
|
|
23
|
-
"import #{CMN}
|
|
23
|
+
"import #{CMN} <file>",
|
|
24
24
|
"update #{CMN} <key=value> <id>",
|
|
25
25
|
"delete #{CMN} <id>",
|
|
26
26
|
"undelete #{CMN} <id>",
|
|
27
|
-
"history #{CMN} [-
|
|
28
|
-
"search #{CMN} [-al] [-
|
|
27
|
+
"history #{CMN} [-o offset] [-L limit] <id>",
|
|
28
|
+
"search #{CMN} [-al] [-o offset] [-L limit] <condition>...",
|
|
29
29
|
tag_commands]
|
|
30
30
|
end
|
|
31
31
|
|