wavefront-cli 4.3.1 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29567752b0846cf0bc23909151f65a0f023c02437203d97c0957f67c7802693f
4
- data.tar.gz: be30496907d30aeb184d0d7cc3204452c79b219254caeb9c6a59785a240cca18
3
+ metadata.gz: a025cf2419ed21cda9a87b574e5d6f4b181fd94a4cd98e360e0f7151166a62cc
4
+ data.tar.gz: a254ff1f5c1de6ca86b0370c2f1e7d20ecbb97756f149e05660a397b45c77415
5
5
  SHA512:
6
- metadata.gz: 1e1f43c9ad3a996c71b1c75478344b03d9c751fa0ba1db590f6d79f5ba32db18f7f25a52db23f48173418b69730cba46cc20dcde6a2cc843bec017b3be680a87
7
- data.tar.gz: 928a9f2eb6523d26497ae6ac630f0bd070bd73ffea31876c7bee70bfe061216f08c8eb7d30c4d083c2adeaaf41b773a2a59249565ac230a17b56c05ffdcd727a
6
+ metadata.gz: 2acd83e6320f1b5a669728b3dfe016e3c7c454a05fa2149319d392f52788a3927ba8a8aedad2bdd6ffbcc42c7caba219ad0fb446ddd25110fcaf7e5cedc7a925
7
+ data.tar.gz: 147c971de3f1b63721a1e58863bee3bdedef7a2b8281d04d9402608d1ec13a642667bbea54f55d095551af59617c87e915726df4ba79fc69c9153c67982a137f
data/HISTORY.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.4.0 (2019-10-31)
4
+ * Add `-O fields` option to `search` subcommands.
5
+
3
6
  ## 4.3.1 (2019-09-30)
4
7
  * Bugfix `serviceaccount` command.
5
8
 
@@ -20,7 +20,7 @@ class WavefrontCommandAlert < WavefrontCommandBase
20
20
  "snooze #{CMN} [-T time] <id>",
21
21
  "set #{CMN} <key=value> <id>",
22
22
  "unsnooze #{CMN} <id>",
23
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>...",
23
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>...",
24
24
  tag_commands,
25
25
  "currently #{CMN} <state>",
26
26
  "queries #{CMN} [-b] [<id>]",
@@ -26,7 +26,7 @@ class WavefrontCommandCloudintegration < WavefrontCommandBase
26
26
  "disable #{CMN} <id>",
27
27
  "dump #{CMN}",
28
28
  "import #{CMN} [-u] <file>",
29
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
29
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
30
30
  end
31
31
 
32
32
  def _options
@@ -14,7 +14,7 @@ class WavefrontCommandDashboard < WavefrontCommandBase
14
14
  "delete #{CMN} <id>",
15
15
  "undelete #{CMN} <id>",
16
16
  "history #{CMN} [-o offset] [-L limit] <id>",
17
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>...",
17
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>...",
18
18
  "queries #{CMN} [-b] [<id>]",
19
19
  "favs #{CMN}",
20
20
  "fav #{CMN} <id>",
@@ -28,7 +28,7 @@ class WavefrontCommandDerivedmetric < WavefrontCommandBase
28
28
  "delete #{CMN} <id>",
29
29
  "undelete #{CMN} <id>",
30
30
  "history #{CMN} [-o offset] [-L limit] <id>",
31
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>...",
31
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>...",
32
32
  tag_commands]
33
33
  end
34
34
 
@@ -18,7 +18,7 @@ class WavefrontCommandEvent < WavefrontCommandBase
18
18
  "close #{CMN} [<id>]",
19
19
  "delete #{CMN} <id>",
20
20
  "set #{CMN} <key=value> <id>",
21
- "search #{CMN} [-o offset] [-L limit] [-l] <condition>...",
21
+ "search #{CMN} [-o offset] [-L limit] [-l] [-O fields] <condition>...",
22
22
  "wrap #{CMN} [-C command] [-d description] [-S severity] [-T type] " \
23
23
  '[-H host...] [-g tag...] <event>',
24
24
  tag_commands,
@@ -20,7 +20,7 @@ class WavefrontCommandIntegration < WavefrontCommandBase
20
20
  "alert install #{CMN} <id>",
21
21
  "alert uninstall #{CMN} <id>",
22
22
  "installed #{CMN}",
23
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
23
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
24
24
  end
25
25
 
26
26
  def _options
@@ -26,7 +26,7 @@ class WavefrontCommandLink < WavefrontCommandBase
26
26
  "dump #{CMN}",
27
27
  "import #{CMN} [-u] <file>",
28
28
  "set #{CMN} <key=value> <id>",
29
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
29
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
30
30
  end
31
31
 
32
32
  def _options
@@ -21,7 +21,7 @@ class WavefrontCommandNotificant < WavefrontCommandBase
21
21
  "delete #{CMN} <id>",
22
22
  "test #{CMN} <id>",
23
23
  "set #{CMN} <key=value> <id>",
24
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
24
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
25
25
  end
26
26
 
27
27
  def _options
@@ -15,7 +15,7 @@ class WavefrontCommandProxy < WavefrontCommandBase
15
15
  "delete #{CMN} <id>",
16
16
  "undelete #{CMN} <id>",
17
17
  "rename #{CMN} <id> <name>",
18
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>...",
18
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>...",
19
19
  "versions #{CMN}"]
20
20
  end
21
21
 
@@ -27,7 +27,7 @@ class WavefrontCommandSavedsearch < WavefrontCommandBase
27
27
  "delete #{CMN} <id>",
28
28
  "dump #{CMN}",
29
29
  "import #{CMN} [-u] <file>",
30
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
30
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
31
31
  end
32
32
 
33
33
  def _options
@@ -37,7 +37,7 @@ class WavefrontCommandServiceaccount < WavefrontCommandBase
37
37
  "apitoken create #{CMN} [-N name] <id>",
38
38
  "apitoken delete #{CMN} <id> <token_id>",
39
39
  "apitoken rename #{CMN} <id> <token_id> <name>",
40
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
40
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
41
41
  end
42
42
 
43
43
  def _options
@@ -15,7 +15,7 @@ class WavefrontCommandSource < WavefrontCommandBase
15
15
  "description set #{CMN} <id> <description>",
16
16
  "description clear #{CMN} <id>",
17
17
  "clear #{CMN} <id>",
18
- "search #{CMN} [-al] [-o cursor] [-L limit] <condition>...",
18
+ "search #{CMN} [-al] [-o cursor] [-L limit] [-O fields] <condition>...",
19
19
  tag_commands]
20
20
  end
21
21
 
@@ -27,7 +27,7 @@ class WavefrontCommandUser < WavefrontCommandBase
27
27
  "leave #{CMN} <id> <group>...",
28
28
  "grant #{CMN} <privilege> to <id>",
29
29
  "revoke #{CMN} <privilege> from <id>",
30
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
30
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
31
31
  end
32
32
 
33
33
  def _options
@@ -35,7 +35,7 @@ class WavefrontCommandUsergroup < WavefrontCommandBase
35
35
  "remove user #{CMN} <id> <user>...",
36
36
  "grant #{CMN} <permission> to <id>",
37
37
  "revoke #{CMN} <permission> from <id>",
38
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
38
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
39
39
  end
40
40
 
41
41
  def _options
@@ -12,7 +12,7 @@ class WavefrontCommandWebhook < WavefrontCommandBase
12
12
  "dump #{CMN}",
13
13
  "import #{CMN} [-u] <file>",
14
14
  "set #{CMN} <key=value> <id>",
15
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
15
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
16
16
  end
17
17
 
18
18
  def _options
@@ -28,7 +28,7 @@ class WavefrontCommandWindow < WavefrontCommandBase
28
28
  "dump #{CMN}",
29
29
  "import #{CMN} [-u] <file>",
30
30
  "set #{CMN} <key=value> <id>",
31
- "search #{CMN} [-al] [-o offset] [-L limit] <condition>...",
31
+ "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>...",
32
32
  "ongoing #{CMN}",
33
33
  "pending #{CMN} [<hours>]"]
34
34
  end
@@ -84,7 +84,15 @@ module WavefrontDisplay
84
84
  # listing with the --long options.
85
85
  #
86
86
  def run_search
87
- options[:long] ? do_search : do_search_brief
87
+ if data.empty?
88
+ puts 'No matches.'
89
+ elsif options[:long]
90
+ do_search
91
+ elsif options[:fields]
92
+ do_search_fields
93
+ else
94
+ do_search_brief
95
+ end
88
96
  end
89
97
 
90
98
  # Display classes can provide a do_method_code() method, which
@@ -234,9 +242,7 @@ module WavefrontDisplay
234
242
  def do_search_brief
235
243
  search_keys = search_display_keys
236
244
 
237
- if data.empty?
238
- puts 'No matches.'
239
- elsif search_keys.include?(:freetext)
245
+ if search_keys.include?(:freetext)
240
246
  display_brief_freetext_results
241
247
  else
242
248
  multicolumn(*search_keys)
@@ -245,6 +251,10 @@ module WavefrontDisplay
245
251
  raise WavefrontCli::Exception::ImpossibleSearch
246
252
  end
247
253
 
254
+ def do_search_fields
255
+ do_list_fields
256
+ end
257
+
248
258
  # For freetext searches, we just display the matching fields in "brief"
249
259
  # mode.
250
260
  #
@@ -280,11 +290,7 @@ module WavefrontDisplay
280
290
  end
281
291
 
282
292
  def do_search
283
- if data.empty?
284
- puts 'No matches.'
285
- else
286
- long_output
287
- end
293
+ long_output
288
294
  end
289
295
 
290
296
  def do_tag_add
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- WF_CLI_VERSION = '4.3.1'
3
+ WF_CLI_VERSION = '4.4.0'
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: 4.3.1
4
+ version: 4.4.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: 2019-09-30 00:00:00.000000000 Z
11
+ date: 2019-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt