wavefront-cli 4.2.1 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +1 -0
  3. data/.rubocop.yml +1 -14
  4. data/.travis.yml +4 -4
  5. data/Gemfile +2 -0
  6. data/HISTORY.md +82 -60
  7. data/Rakefile +2 -0
  8. data/bin/wf +1 -0
  9. data/lib/wavefront-cli/alert.rb +13 -5
  10. data/lib/wavefront-cli/apitoken.rb +2 -0
  11. data/lib/wavefront-cli/base.rb +95 -47
  12. data/lib/wavefront-cli/cloudintegration.rb +6 -0
  13. data/lib/wavefront-cli/command_mixins/acl.rb +6 -1
  14. data/lib/wavefront-cli/command_mixins/tag.rb +2 -0
  15. data/lib/wavefront-cli/commands/.rubocop.yml +3 -4
  16. data/lib/wavefront-cli/commands/alert.rb +2 -1
  17. data/lib/wavefront-cli/commands/apitoken.rb +6 -0
  18. data/lib/wavefront-cli/commands/base.rb +30 -21
  19. data/lib/wavefront-cli/commands/cloudintegration.rb +2 -0
  20. data/lib/wavefront-cli/commands/config.rb +2 -0
  21. data/lib/wavefront-cli/commands/dashboard.rb +2 -0
  22. data/lib/wavefront-cli/commands/derivedmetric.rb +2 -0
  23. data/lib/wavefront-cli/commands/event.rb +3 -1
  24. data/lib/wavefront-cli/commands/integration.rb +2 -1
  25. data/lib/wavefront-cli/commands/link.rb +2 -0
  26. data/lib/wavefront-cli/commands/message.rb +2 -0
  27. data/lib/wavefront-cli/commands/metric.rb +2 -0
  28. data/lib/wavefront-cli/commands/notificant.rb +2 -0
  29. data/lib/wavefront-cli/commands/proxy.rb +2 -0
  30. data/lib/wavefront-cli/commands/query.rb +2 -0
  31. data/lib/wavefront-cli/commands/savedsearch.rb +2 -0
  32. data/lib/wavefront-cli/commands/serviceaccount.rb +58 -0
  33. data/lib/wavefront-cli/commands/settings.rb +2 -0
  34. data/lib/wavefront-cli/commands/source.rb +3 -1
  35. data/lib/wavefront-cli/commands/user.rb +4 -1
  36. data/lib/wavefront-cli/commands/usergroup.rb +3 -0
  37. data/lib/wavefront-cli/commands/webhook.rb +2 -0
  38. data/lib/wavefront-cli/commands/window.rb +2 -0
  39. data/lib/wavefront-cli/commands/write.rb +2 -0
  40. data/lib/wavefront-cli/config.rb +23 -12
  41. data/lib/wavefront-cli/constants.rb +10 -4
  42. data/lib/wavefront-cli/controller.rb +53 -22
  43. data/lib/wavefront-cli/dashboard.rb +3 -0
  44. data/lib/wavefront-cli/derivedmetric.rb +12 -11
  45. data/lib/wavefront-cli/display/alert.rb +7 -4
  46. data/lib/wavefront-cli/display/apitoken.rb +2 -0
  47. data/lib/wavefront-cli/display/base.rb +34 -8
  48. data/lib/wavefront-cli/display/cloudintegration.rb +4 -2
  49. data/lib/wavefront-cli/display/dashboard.rb +2 -0
  50. data/lib/wavefront-cli/display/derivedmetric.rb +2 -0
  51. data/lib/wavefront-cli/display/distribution.rb +2 -0
  52. data/lib/wavefront-cli/display/event.rb +2 -0
  53. data/lib/wavefront-cli/display/externallink.rb +2 -0
  54. data/lib/wavefront-cli/display/integration.rb +2 -0
  55. data/lib/wavefront-cli/display/maintenancewindow.rb +2 -0
  56. data/lib/wavefront-cli/display/message.rb +7 -3
  57. data/lib/wavefront-cli/display/metric.rb +3 -1
  58. data/lib/wavefront-cli/display/notificant.rb +3 -1
  59. data/lib/wavefront-cli/display/printer/long.rb +36 -11
  60. data/lib/wavefront-cli/display/printer/sparkline.rb +3 -0
  61. data/lib/wavefront-cli/display/printer/terse.rb +6 -1
  62. data/lib/wavefront-cli/display/proxy.rb +2 -0
  63. data/lib/wavefront-cli/display/query.rb +35 -24
  64. data/lib/wavefront-cli/display/savedsearch.rb +2 -0
  65. data/lib/wavefront-cli/display/serviceaccount.rb +60 -0
  66. data/lib/wavefront-cli/display/settings.rb +2 -0
  67. data/lib/wavefront-cli/display/source.rb +18 -4
  68. data/lib/wavefront-cli/display/user.rb +56 -10
  69. data/lib/wavefront-cli/display/usergroup.rb +25 -19
  70. data/lib/wavefront-cli/display/webhook.rb +2 -0
  71. data/lib/wavefront-cli/display/write.rb +6 -2
  72. data/lib/wavefront-cli/event.rb +83 -62
  73. data/lib/wavefront-cli/exception.rb +3 -0
  74. data/lib/wavefront-cli/externallink.rb +6 -4
  75. data/lib/wavefront-cli/integration.rb +2 -0
  76. data/lib/wavefront-cli/maintenancewindow.rb +28 -17
  77. data/lib/wavefront-cli/message.rb +4 -0
  78. data/lib/wavefront-cli/metric.rb +4 -1
  79. data/lib/wavefront-cli/notificant.rb +2 -0
  80. data/lib/wavefront-cli/opt_handler.rb +2 -0
  81. data/lib/wavefront-cli/output/base.rb +8 -3
  82. data/lib/wavefront-cli/output/csv.rb +2 -0
  83. data/lib/wavefront-cli/output/csv/base.rb +2 -0
  84. data/lib/wavefront-cli/output/csv/query.rb +14 -7
  85. data/lib/wavefront-cli/output/hcl.rb +2 -0
  86. data/lib/wavefront-cli/output/hcl/alert.rb +2 -0
  87. data/lib/wavefront-cli/output/hcl/base.rb +10 -4
  88. data/lib/wavefront-cli/output/hcl/dashboard.rb +17 -8
  89. data/lib/wavefront-cli/output/hcl/notificant.rb +2 -0
  90. data/lib/wavefront-cli/output/hcl/stdlib/array.rb +2 -0
  91. data/lib/wavefront-cli/output/hcl/stdlib/string.rb +2 -0
  92. data/lib/wavefront-cli/output/json.rb +2 -0
  93. data/lib/wavefront-cli/output/ruby.rb +2 -0
  94. data/lib/wavefront-cli/output/wavefront.rb +2 -0
  95. data/lib/wavefront-cli/output/wavefront/query.rb +7 -4
  96. data/lib/wavefront-cli/output/yaml.rb +2 -0
  97. data/lib/wavefront-cli/proxy.rb +15 -3
  98. data/lib/wavefront-cli/query.rb +14 -12
  99. data/lib/wavefront-cli/savedsearch.rb +2 -0
  100. data/lib/wavefront-cli/serviceaccount.rb +179 -0
  101. data/lib/wavefront-cli/settings.rb +2 -0
  102. data/lib/wavefront-cli/source.rb +2 -0
  103. data/lib/wavefront-cli/stdlib/array.rb +3 -0
  104. data/lib/wavefront-cli/stdlib/string.rb +17 -11
  105. data/lib/wavefront-cli/user.rb +10 -4
  106. data/lib/wavefront-cli/usergroup.rb +4 -2
  107. data/lib/wavefront-cli/version.rb +3 -1
  108. data/lib/wavefront-cli/webhook.rb +2 -0
  109. data/lib/wavefront-cli/write.rb +80 -46
  110. data/spec/.rubocop.yml +3 -16
  111. data/spec/constants.rb +21 -0
  112. data/spec/spec_helper.rb +8 -422
  113. data/spec/support/command_base.rb +82 -0
  114. data/spec/support/minitest_assertions.rb +262 -0
  115. data/spec/support/output_tester.rb +32 -0
  116. data/spec/support/supported_commands.rb +19 -0
  117. data/spec/test_mixins/acl.rb +169 -0
  118. data/spec/test_mixins/delete.rb +25 -0
  119. data/spec/test_mixins/deleteundelete.rb +106 -0
  120. data/spec/test_mixins/describe.rb +24 -0
  121. data/spec/test_mixins/dump.rb +43 -0
  122. data/spec/test_mixins/general.rb +11 -0
  123. data/spec/test_mixins/history.rb +35 -0
  124. data/spec/test_mixins/import.rb +65 -0
  125. data/spec/test_mixins/list.rb +29 -0
  126. data/spec/test_mixins/search.rb +98 -0
  127. data/spec/test_mixins/set.rb +47 -0
  128. data/spec/test_mixins/tag.rb +99 -0
  129. data/spec/wavefront-cli/alert_spec.rb +288 -111
  130. data/spec/wavefront-cli/apitoken_spec.rb +53 -24
  131. data/spec/wavefront-cli/base_spec.rb +9 -27
  132. data/spec/wavefront-cli/cloudintegration_spec.rb +65 -29
  133. data/spec/wavefront-cli/commands/alert_spec.rb +1 -0
  134. data/spec/wavefront-cli/commands/base_spec.rb +15 -13
  135. data/spec/wavefront-cli/commands/cloudintegration_spec.rb +1 -0
  136. data/spec/wavefront-cli/commands/config_spec.rb +3 -0
  137. data/spec/wavefront-cli/commands/dashboard_spec.rb +1 -0
  138. data/spec/wavefront-cli/commands/derivedmetric_spec.rb +1 -0
  139. data/spec/wavefront-cli/commands/event_spec.rb +1 -0
  140. data/spec/wavefront-cli/commands/link_spec.rb +1 -0
  141. data/spec/wavefront-cli/commands/message_spec.rb +1 -0
  142. data/spec/wavefront-cli/commands/metric_spec.rb +1 -0
  143. data/spec/wavefront-cli/commands/proxy_spec.rb +1 -0
  144. data/spec/wavefront-cli/commands/query_spec.rb +1 -0
  145. data/spec/wavefront-cli/commands/webhook_spec.rb +1 -0
  146. data/spec/wavefront-cli/commands/window_spec.rb +1 -0
  147. data/spec/wavefront-cli/commands/write_spec.rb +1 -0
  148. data/spec/wavefront-cli/config_spec.rb +25 -14
  149. data/spec/wavefront-cli/controller_spec.rb +13 -3
  150. data/spec/wavefront-cli/dashboard_spec.rb +125 -76
  151. data/spec/wavefront-cli/derivedmetric_spec.rb +83 -67
  152. data/spec/wavefront-cli/display/base_spec.rb +5 -7
  153. data/spec/wavefront-cli/display/printer/long_spec.rb +20 -16
  154. data/spec/wavefront-cli/display/printer/terse_spec.rb +5 -4
  155. data/spec/wavefront-cli/event_spec.rb +360 -18
  156. data/spec/wavefront-cli/externallink_spec.rb +92 -58
  157. data/spec/wavefront-cli/integration_spec.rb +129 -31
  158. data/spec/wavefront-cli/maintenancewindow_spec.rb +270 -32
  159. data/spec/wavefront-cli/message_spec.rb +73 -30
  160. data/spec/wavefront-cli/metric_spec.rb +60 -22
  161. data/spec/wavefront-cli/notificant_spec.rb +45 -32
  162. data/spec/wavefront-cli/opt_handler_spec.rb +4 -1
  163. data/spec/wavefront-cli/output/csv/query_spec.rb +21 -19
  164. data/spec/wavefront-cli/output/csv_spec.rb +5 -2
  165. data/spec/wavefront-cli/output/hcl_spec.rb +5 -2
  166. data/spec/wavefront-cli/output/helpers.rb +18 -0
  167. data/spec/wavefront-cli/output/json_spec.rb +3 -1
  168. data/spec/wavefront-cli/output/ruby_spec.rb +3 -1
  169. data/spec/wavefront-cli/output/wavefront/query_spec.rb +3 -1
  170. data/spec/wavefront-cli/output/wavefront_spec.rb +6 -4
  171. data/spec/wavefront-cli/output/yaml_spec.rb +3 -1
  172. data/spec/wavefront-cli/proxy_spec.rb +49 -27
  173. data/spec/wavefront-cli/query_spec.rb +174 -92
  174. data/spec/wavefront-cli/resources/responses/query.json +1 -0
  175. data/spec/wavefront-cli/resources/updates/alert.json +15 -0
  176. data/spec/wavefront-cli/resources/updates/dashboard.json +1 -0
  177. data/spec/wavefront-cli/savedsearch_spec.rb +35 -18
  178. data/spec/wavefront-cli/serviceaccount_spec.rb +399 -0
  179. data/spec/wavefront-cli/settings_spec.rb +42 -11
  180. data/spec/wavefront-cli/source_spec.rb +120 -23
  181. data/spec/wavefront-cli/stdlib/array_spec.rb +2 -1
  182. data/spec/wavefront-cli/stdlib/string_spec.rb +9 -6
  183. data/spec/wavefront-cli/user_spec.rb +278 -108
  184. data/spec/wavefront-cli/usergroup_spec.rb +152 -102
  185. data/spec/wavefront-cli/webhook_spec.rb +30 -15
  186. data/spec/wavefront-cli/write_spec.rb +25 -1
  187. data/wavefront-cli.gemspec +5 -3
  188. metadata +65 -21
  189. data/spec/wavefront-cli/commands/spec_helper.rb +0 -3
  190. data/spec/wavefront-cli/display/spec_helper.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36ce95b63a82df8446956332caa6b6765a3eca92d921974a954f640698bcd63d
4
- data.tar.gz: 2c1a531e527d4be0e0dae2747aba4f75dce6c3da48012e15516ab9b63f6dc249
3
+ metadata.gz: 79bb78ee1f6515f3a168acdedfa89680be010f429a33520e23a6caae252fc42f
4
+ data.tar.gz: 1e86e9eeb5ea1242443b0cf17eb1fea5c5f3a207c6895ab4102a1f705bf1a5a4
5
5
  SHA512:
6
- metadata.gz: af0e40f1c76fdbe8ade39b6db403a4b58b70ed154bf5ae5a3c810d18ec4ebacc5b84a604a42c56cb8750df3891f335188de6a4f7a65eb2a7be6e85efe4a7794b
7
- data.tar.gz: c859fd699041b147fd7fa1b7d30e62d71922420d6460614c137e47be9dfb63cb0350184594ed5c03e6010e1348ed8020d765ca6e0b8cf6bd769d57c1b44bfeef
6
+ metadata.gz: 01a3a13dbca2192dfb50c375d833ec73115a6c76e31e5fbb0ee42cab3a3f95ea89264e35ebabcb2f34caee642e8e91b74c664d1669d546504cd30f16d364725c
7
+ data.tar.gz: 1d076d96e1972ceb5d9de355ef1e88e6ea3e68961a911a5a2b691570a337fd8ac3d1cf7fe1d6b4b3c7bacf92ab8741becfb6cbfe4ccb223d363a037d5f219c28
data/.codeclimate.yml CHANGED
@@ -12,6 +12,7 @@ engines:
12
12
  enabled: true
13
13
  rubocop:
14
14
  enabled: true
15
+ channel: channel/rubocop-0-74
15
16
  ratings:
16
17
  paths:
17
18
  - "**.rb"
data/.rubocop.yml CHANGED
@@ -1,20 +1,7 @@
1
1
  ---
2
2
 
3
3
  AllCops:
4
- DisplayStyleGuide: true
5
4
  TargetRubyVersion: 2.3
6
5
 
7
- Style/FrozenStringLiteralComment:
8
- Enabled: false
9
-
10
- Style/FormatStringToken:
11
- Enabled: false
12
-
13
6
  Metrics/ClassLength:
14
- Enabled: false
15
-
16
- Metrics/MethodLength:
17
- Max: 13
18
-
19
- Style/NumericLiterals:
20
- Enabled: false
7
+ Max: 400
data/.travis.yml CHANGED
@@ -2,9 +2,9 @@ language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
4
  - 2.3.8
5
- - 2.4.5
6
- - 2.5.5
7
- - 2.6.2
5
+ - 2.4.7
6
+ - 2.5.6
7
+ - 2.6.4
8
8
  before_install: gem install bundler --no-document
9
9
  deploy:
10
10
  provider: rubygems
@@ -14,7 +14,7 @@ deploy:
14
14
  on:
15
15
  tags: true
16
16
  repo: snltd/wavefront-cli
17
- ruby: 2.6.2
17
+ ruby: 2.6.4
18
18
  notifications:
19
19
  email: false
20
20
  slack:
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
  gemspec
data/HISTORY.md CHANGED
@@ -1,17 +1,40 @@
1
1
  # Changelog
2
2
 
3
- ## 4.2.1 (26/07/2019)
4
- * Remove tagging subcommands from `apitoken` command's usage info,
5
- because you can't tag API tokens.
6
-
7
- ## 4.2.0 (01/07/2019)
3
+ ## 4.3.0 (2019-09-30)
4
+ * Add `serviceaccount` command.
5
+ * Add `user privileges` command.
6
+ * Refactor of all tests, which exposed the following:
7
+ * Fix noops on `proxy versions`, `window ongoing` and `window
8
+ pending`.
9
+ * Fix partially broken `source list` command.
10
+ * Make `source search --cursor <source>` work properly.
11
+ * Remove duplicate `manifests` subcommand from `integrations`
12
+ command.
13
+ * Fix broken noop on `acl clear`.
14
+ * Fix `derivedmetric` and `notificant` `set` commands.
15
+ * Fix various `alert` commands when using `--noop`.
16
+ * Better handling of bad `search` input.
17
+ * Fix bug when trying to read non-existent messages.
18
+ * Fix missing quote in `usergroup delete` output.
19
+ * Fix broken `--all` in usergroup listings and searches.
20
+ * Fix `user dump`.
21
+ * Removed `user set` command, because it didn't do anything.
22
+ * Improve output of `user` and `usergroup` commands.
23
+ * Refactor of `event` command handling.
24
+ * Require 3.5.x of [the SDK](https://github.com/snltd/wavefront-sdk).
25
+
26
+ ## 4.2.1 (2019-07-26)
27
+ * Remove tagging subcommands from `apitoken` command's usage info, because you
28
+ can't tag API tokens.
29
+
30
+ ## 4.2.0 (2019-07-01)
8
31
  * Add `-M` (`--items-only`) option to all commands. For
9
32
  machine-parseable formats, this filters the API response, giving only
10
33
  the `items` array, which should usually be suitable for batch
11
34
  importing. This is a more sophisticated and flexible implementation of
12
35
  4.1.0's `dump` subcommand.
13
36
 
14
- ## 4.1.0 (27/06/2019)
37
+ ## 4.1.0 (2019-06-27)
15
38
  * Add `dump` subcommand for all importable object types. Produces
16
39
  JSON or YAML output.
17
40
  * Allow batch importing of objects. Works with files produced by
@@ -19,21 +42,20 @@
19
42
  objects. Batch imports are automatically detected by the `import`
20
43
  subcommand.
21
44
 
22
- ## 4.0.2 (20/06/2019)
45
+ ## 4.0.2 (2019-06-20)
23
46
  * Allow importing of dashboards which have a URL but not an ID.
24
47
 
25
- ## 4.0.1 (18/06/2019)
48
+ ## 4.0.1 (2019-06-18)
26
49
  * `update` subcommand has been changed to `set`. (Breaking change.)
27
50
  * `import` subcommand now accepts `--update` (`-u`) option, which
28
51
  lets you overwrite an existing object with a JSON or YAML
29
52
  description.
30
53
  * Fix `tag searchpath` bug.
31
54
 
32
- ## 4.0.0 (18/06/2019)
33
-
55
+ ## 4.0.0 (2019-06-18)
34
56
  * Failed push to Gemfury. Does not exist.
35
57
 
36
- ## 3.3.0 (10/06/2019)
58
+ ## 3.3.0 (2019-06-10)
37
59
  * Support negation searches. Search for alerts with targets *not*
38
60
  containing `str` with `wf alert search target!~str`.
39
61
  * Add `tag pathsearch` command. Searches for tags whose hierarchical
@@ -45,48 +67,48 @@
45
67
  match the search along with the matching keys. (Not values!)
46
68
  Adding `-l` presents all matching objects in full.
47
69
 
48
- ## 3.2.3 (24/05/2019)
70
+ ## 3.2.3 (2019-05-24)
49
71
  * Don't print erroneous pagination message when using `list --all`.
50
72
  * Require 3.3.2 of [the SDK](https://github.com/snltd/wavefront-sdk).
51
73
 
52
- ## 3.2.2 (16/05/2019)
74
+ ## 3.2.2 (2019-05-16)
53
75
  * Smarter error messages.
54
76
  * Require 3.3.1 of [the SDK](https://github.com/snltd/wavefront-sdk).
55
77
 
56
- ## 3.2.1 (09/05/2019)
78
+ ## 3.2.1 (2019-05-09)
57
79
  * Fix for new API ACL format.
58
80
  * Require 3.3.0 of [the SDK](https://github.com/snltd/wavefront-sdk).
59
81
 
60
- ## 3.2.0 (30/04/2019)
82
+ ## 3.2.0 (2019-04-30)
61
83
  * New `apitoken` command lets you manage your own API tokens.
62
84
  * Support for alert ACLs.
63
85
  * Require 3.2.0 of [the SDK](https://github.com/snltd/wavefront-sdk).
64
86
 
65
- ## 3.1.4 (02/05/2019)
87
+ ## 3.1.4 (2019-05-02)
66
88
  * Fix `alert import` missing tags bug.
67
89
  * Allow importing of notificants.
68
90
 
69
- ## 3.1.3 (24/04/2019)
91
+ ## 3.1.3 (2019-04-24)
70
92
  * Fix `write distribution` bug. Points would be sent, but results
71
93
  could not be displayed, causing a crash unless you used `-q`.
72
94
 
73
- ## 3.1.2 (06/04/2019)
95
+ ## 3.1.2 (2019-04-06)
74
96
  * Bugfix on handling of invalid config files.
75
97
  * Explicitly specifying a missing config file now causes an error
76
98
  whether or not credentials available from other mechanisms.
77
99
  * Require 3.0.2 of [the SDK](https://github.com/snltd/wavefront-sdk).
78
100
 
79
- ## 3.1.1 (05/04/2019)
101
+ ## 3.1.1 (2019-04-05)
80
102
  * Usernames do not have to be e-mail addresses.
81
103
  * Require 3.0.1 of [the SDK](https://github.com/snltd/wavefront-sdk).
82
104
 
83
- ## 3.1.0 (02/04/2019)
105
+ ## 3.1.0 (2019-04-02)
84
106
  * Add `message read` command.
85
107
 
86
- ## 3.0.1 (23/03/2019)
108
+ ## 3.0.1 (2019-03-23)
87
109
  * Fix `config about` bug.
88
110
 
89
- ## 3.0.0 (23/03/2019)
111
+ ## 3.0.0 (2019-03-23)
90
112
  * Drop support for Ruby 2.2. (Potentially breaking change.)
91
113
  * Remove the (deprecated) `report` command. Send points directly to
92
114
  Wavefront with `write --use api`. (Potentially breaking change.)
@@ -106,20 +128,20 @@
106
128
  * New `config about` subcommand gives diagnostic info.
107
129
  * Require 3.0.0 of [the SDK](https://github.com/snltd/wavefront-sdk).
108
130
 
109
- ## 2.18.0 (22/02/2019)
131
+ ## 2.18.0 (2019-02-22)
110
132
  * Add `usergroup` command, and extend `user` command to cover new
111
133
  RBAC features.
112
134
  * Require 2.5.0 of [the SDK](https://github.com/snltd/wavefront-sdk).
113
135
 
114
- ## 2.17.0 (19/02/2019)
136
+ ## 2.17.0 (2019-02-19)
115
137
  * Add `-O field,field` to all `list` commands. This lets you select
116
138
  the fields displayed in the output.
117
139
 
118
- ## 2.16.2 (29/12/2018)
140
+ ## 2.16.2 (2018-12-29)
119
141
  * Fix typo in `query` help. CSV headers are produced with `-F
120
142
  headers`, not `-F header`.
121
143
 
122
- ## 2.16.1 (29/12/2018)
144
+ ## 2.16.1 (2018-12-29)
123
145
  * Fix regression which broke query time ranges.
124
146
  * Fix regression which made `--noop` silent unless `--verbose` was
125
147
  also specified.
@@ -129,18 +151,18 @@
129
151
  * Add much more comprehensive `--noop` tests.
130
152
  * Better handling of `--noop` on commands which cannot support it.
131
153
 
132
- ## 2.16.0 (23/12/2018)
154
+ ## 2.16.0 (2018-12-23)
133
155
  * Add `config` command to quickly set up and manage profiles.
134
156
 
135
- ## 2.15.2 (21/12/2018)
157
+ ## 2.15.2 (2018-12-21)
136
158
  * Fix bug which caused an unhandled exception if CSV or Wavefront
137
159
  query outputs tried to process an empty data set.
138
160
 
139
- ## 2.15.1 (20/12/2018)
161
+ ## 2.15.1 (2018-12-20)
140
162
  * Fix bug where `alert snoozed` and `alert firing` did the same
141
163
  thing.
142
164
 
143
- ## 2.15.0 (18/12/2018)
165
+ ## 2.15.0 (2018-12-18)
144
166
  * Gracefully handle ctrl-c.
145
167
  * Add `install` and `uninstall` subcommands to `wf alert`.
146
168
  * Add `enable` and `disable` subcommands to `wf cloudintegration`.
@@ -149,12 +171,12 @@
149
171
  `manifest` commands to `wf integration`.
150
172
  * Require 2.2.0 of [wavefront-sdk](https://github.com/snltd/wavefront-sdk).
151
173
 
152
- ## 2.14.0 (15/12/2018)
174
+ ## 2.14.0 (2018-12-15)
153
175
  * Add `-n` to `dashboard`'s `list` and `queries` commands to omit
154
176
  system-owned dashboards.
155
177
  * Let `queries` subcommand accept an optional ID.
156
178
 
157
- ## 2.13.0 (11/12/2018)
179
+ ## 2.13.0 (2018-12-11)
158
180
  * Add CSV output for `query` command.
159
181
  * Add multiple format outputs for all applicable `alert`
160
182
  subcommands.
@@ -162,19 +184,19 @@
162
184
  to quickly see which queries (and therefore timeseries) are being
163
185
  used.
164
186
 
165
- ## 2.12.0 (26/11/2018)
187
+ ## 2.12.0 (2018-11-26)
166
188
  * Support SDK's new `unix` writer, which lets you write points to a
167
189
  local Unix datagram socket. This requires `-u unix` and `-S
168
190
  filename`.
169
191
 
170
- ## 2.11.0 (24/10/2018)
192
+ ## 2.11.0 (2018-10-24)
171
193
  * Add `proxy versions` subcommand. Lists proxies and their versions,
172
194
  newest to oldest.
173
195
 
174
- ## 2.10.1 (22/10/2018)
196
+ ## 2.10.1 (2018-10-22)
175
197
  * Fix bug seen when listing events with `-s` AND `-L`.
176
198
 
177
- ## 2.10.0 (22/10/2018)
199
+ ## 2.10.0 (2018-10-22)
178
200
  * Most `list` subcommands accept `-a / --all`, and will show all
179
201
  objects of the given type, with no pagination. (Exceptions are
180
202
  `user`, which never paginated because the API doesn't, and
@@ -205,18 +227,18 @@
205
227
  * Use a single connection when streaming data to a proxy from STDIN.
206
228
  * Don't list hidden sources unless specifically asked.
207
229
 
208
- ## 2.9.3 (03/09/2018)
230
+ ## 2.9.3 (2018-09-03)
209
231
  * Fix a bug where indefinitely snoozed alerts broke `wf alert
210
232
  snoozed`.
211
233
 
212
- ## 2.9.2 (22/08/2018)
234
+ ## 2.9.2 (2018-08-22)
213
235
  * Fix regression which broke the `wf` command when it ran without a
214
236
  tty.
215
237
 
216
- ## 2.9.1 (22/08/2018)
238
+ ## 2.9.1 (2018-08-22)
217
239
  * Use 1.6.2 of [wavefront-sdk](https://github.com/snltd/wavefront-sdk).
218
240
 
219
- ## 2.9.0 (22/08/2018)
241
+ ## 2.9.0 (2018-08-22)
220
242
  * Create external links with new `link create` sub-command.
221
243
  * Fix bug which stopped you writing points without a `.wavefront`
222
244
  configuration file.
@@ -225,7 +247,7 @@
225
247
  * Modify external link filters.
226
248
  * Use 1.6.1 of [wavefront-sdk](https://github.com/snltd/wavefront-sdk).
227
249
 
228
- ## 2.8.0 (08/08/2018)
250
+ ## 2.8.0 (2018-08-08)
229
251
  * Add `wavefront` format to the `query` command. This outputs the
230
252
  result of a raw or timeseries query in a format which can be fed
231
253
  back into Wavefront via a proxy.
@@ -233,15 +255,15 @@
233
255
  * Restructure the way different output formats are handled in a
234
256
  better, more flexible way.
235
257
 
236
- ## 2.7.0 (04/07/2018)
258
+ ## 2.7.0 (2018-07-04)
237
259
  * Add a `-i` option to the `report` command, to send delta metrics.
238
260
  * Fix delta metrics on the `write` command.
239
261
 
240
- ## 2.6.0 (27/06/2018)
262
+ ## 2.6.0 (2018-06-27)
241
263
  * Anything which can be imported can be imported from STDIN. The CLI
242
264
  will do its best to work out if the format is YAML or JSON.
243
265
 
244
- ## 2.5.0 (25/06/2018)
266
+ ## 2.5.0 (2018-06-25)
245
267
  * Support [derived
246
268
  metrics](https://docs.wavefront.com/derived_metrics.html).
247
269
  * Remove options which were not actually supported.
@@ -251,7 +273,7 @@
251
273
  * Better formatting of `query` output.
252
274
  * Remove obsolete code and test files.
253
275
 
254
- ## 2.4.0 (10/04/2017)
276
+ ## 2.4.0 (2017-04-10)
255
277
  * Support direct data ingestion via `report` command.
256
278
  * Support writing delta metrics.
257
279
  * Add `-q` to silenty write data points.
@@ -260,56 +282,56 @@
260
282
  Terraform
261
283
  provider](https://github.com/spaceapegames/terraform-provider-wavefront).
262
284
 
263
- ## 2.3.1 (24/03/2017)
285
+ ## 2.3.1 (2017-03-24)
264
286
  * Fix broken handling of negative values in `write` command.
265
287
 
266
- ## 2.3.0 (23/02/2017)
288
+ ## 2.3.0 (2017-02-23)
267
289
  * Add query aliases.
268
290
 
269
- ## 2.2.0 (18/02/2017)
291
+ ## 2.2.0 (2017-02-18)
270
292
  * Add `alert firing` and `alert snoozed` subcommands.
271
293
 
272
- ## 2.1.6 (11/01/2017)
294
+ ## 2.1.6 (2017-01-11)
273
295
  * Correctly handle `=` characters in `update` subcommands.
274
296
 
275
- ## 2.1.5 (05/12/2017)
297
+ ## 2.1.5 (2017-12-05)
276
298
  * Allow the user to tag events when they are created.
277
299
 
278
- ## 2.1.4 (15/11/2017)
300
+ ## 2.1.4 (2017-11-15)
279
301
  * `event create` bugfix.
280
302
 
281
- ## 2.1.3 (31/10/2017)
303
+ ## 2.1.3 (2017-10-31)
282
304
  * Use credential mechanism from SDK instead of rolling our own.
283
305
  * Fix bug which ignored supposedly supported environment variables,
284
306
  and add support for more.
285
307
  * Cut dead wood out of codebase.
286
308
  * Eradicate build warnings.
287
309
 
288
- ## 2.1.2 (31/10/2017)
310
+ ## 2.1.2 (2017-10-31)
289
311
  * Fix no-op bug.
290
312
  * Add BSD license.
291
313
 
292
- ## 2.1.1 (12/10/2017)
314
+ ## 2.1.1 (2017-10-12)
293
315
  * Fix bug in relative time specifications.
294
316
 
295
- ## 2.1.0 (12/10/2017)
317
+ ## 2.1.0 (2017-10-12)
296
318
  * Allow users to specify relative times, like `-10m`.
297
319
 
298
- ## 2.0.0 (09/10/2017)
320
+ ## 2.0.0 (2017-10-09)
299
321
  * Support viewing and managing of integrations.
300
322
  * Support notificants. (AKA alert targets).
301
323
  * Support new source descriptions.
302
324
  * Breaking change in `source` command.
303
325
 
304
- ## 1.0.3 (25/08/2017)
326
+ ## 1.0.3 (2017-08-25)
305
327
  * Fix nil tag bug in terse source listing.
306
328
 
307
- ## 1.0.2 (04/08/2017)
329
+ ## 1.0.2 (2017-08-04)
308
330
  * Greatly improve support for maintenance windows. They can now be
309
331
  extended, shrunk, and closed and created on the fly.
310
332
 
311
- ## 1.0.1 (31/07/2017)
333
+ ## 1.0.1 (2017-07-31)
312
334
  * Report `no data` if a query returns no data.
313
335
 
314
- ## 1.0.0 (28/07/2017)
336
+ ## 1.0.0 (2017-07-28)
315
337
  * First official release.
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yard'
2
4
  require 'bundler/gem_tasks'
3
5
  require 'rake/testtask'
data/bin/wf CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'pathname'
4
5
  require 'io/console'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'base'
2
4
  require_relative 'command_mixins/tag'
3
5
  require_relative 'command_mixins/acl'
@@ -53,7 +55,7 @@ module WavefrontCli
53
55
  if wf.respond_to?(state)
54
56
  in_state(state)
55
57
  else
56
- abort format("'%s' is not a valid alert state.", state)
58
+ abort format("'%<state>s' is not a valid alert state.", state: state)
57
59
  end
58
60
  end
59
61
 
@@ -89,8 +91,12 @@ module WavefrontCli
89
91
  def in_state(status)
90
92
  options[:all] = true
91
93
  ret = find_in_state(status)
92
- ok_exit(format('No alerts are currently %s.', status)) if ret.empty?
93
- ret
94
+
95
+ exit if options[:noop]
96
+
97
+ return ret unless ret.is_a?(Wavefront::Response) && ret.empty?
98
+
99
+ ok_exit(format('No alerts are currently %<status>s.', status: status))
94
100
  end
95
101
 
96
102
  # Does the work for #in_state
@@ -99,7 +105,9 @@ module WavefrontCli
99
105
  # @return Wavefront::Response
100
106
  #
101
107
  def find_in_state(status)
102
- search = do_search([format('status=%s', status)])
108
+ search = do_search([format('status=%<status>s', status: status)])
109
+
110
+ return if options[:noop]
103
111
 
104
112
  items = search.response.items.map do |i|
105
113
  { name: i.name, id: i.id, time: state_time(i) }
@@ -116,6 +124,7 @@ module WavefrontCli
116
124
  def state_time(item)
117
125
  return item[:event][:startTime] if item.key?(:event)
118
126
  return item[:snoozed] if item.key?(:snoozed)
127
+
119
128
  nil
120
129
  end
121
130
 
@@ -127,7 +136,6 @@ module WavefrontCli
127
136
  def import_to_create(raw)
128
137
  import_fields.each_with_object({}) { |k, a| a[k.to_sym] = raw[k] }
129
138
  .tap do |ret|
130
-
131
139
  if raw.key?(:resolveAfterMinutes)
132
140
  ret[:resolveMinutes] = raw[:resolveAfterMinutes]
133
141
  end