wavefront-cli 2.15.0 → 2.15.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acd004964f7c14a26b9857cdb8f2fc1781b52cfa1a1deee654db16a501203b69
4
- data.tar.gz: 141f7be085e49e02624348da8edb1c37c5adac283ffd15d8574015c5230c6ad4
3
+ metadata.gz: a7bcdc77460e6ee7549d1eb6dae32e5319f7ea74a47a820f27ab99312f50b963
4
+ data.tar.gz: bfcac8895c3005bf7f516403391b4eab7aef4905fe3e86e186832e031cf6a88f
5
5
  SHA512:
6
- metadata.gz: c88f783fe7710432538c7a583df5789034a583736cbcb2bc3356e4a1e3d6b4f415aa282aa710c0f72f5c6e9210f0fd173a0a54579b90d1578fefeff3b9adf212
7
- data.tar.gz: 7dce2b8ac086b16353f1a73280398874e858e906893cd81a0d948e144727f8ebdcaf94c9001532bf8e1ca86f6b21fa4b959f6801c54405271d92800af85d9522
6
+ metadata.gz: a670d0670679e424cedf12545d4fcc4f5aae9e79d4e89ea644b7f7633de0efda9a7426472c9eb2c0054f090849774af5cdfe4f3acb1cce5ec1459137fa2aa53e
7
+ data.tar.gz: ec6445ab10a7510ceb30386e9542aedc0d795dadc3cdbc22be93a759d6309bff728c52b9c914d60a98e33594559bfdfe74aca81145a2583453e145987ee766a3
@@ -51,7 +51,7 @@ module WavefrontCli
51
51
  end
52
52
 
53
53
  def do_snoozed
54
- in_state(:firing)
54
+ in_state(:snoozed)
55
55
  end
56
56
 
57
57
  def do_queries
@@ -1 +1 @@
1
- WF_CLI_VERSION = '2.15.0'.freeze
1
+ WF_CLI_VERSION = '2.15.1'.freeze
data/spec/spec_helper.rb CHANGED
@@ -58,6 +58,10 @@ class DummyResponse
58
58
  def response
59
59
  Map.new(items: [])
60
60
  end
61
+
62
+ def empty?
63
+ false
64
+ end
61
65
  end
62
66
 
63
67
  CANNED_RESPONSE = DummyResponse.new
@@ -4,11 +4,25 @@ id = '1481553823153'
4
4
  bad_id = '__bad_id__'
5
5
  word = 'alert'
6
6
 
7
+ def search_body(val)
8
+ { limit: 999,
9
+ offset: 0,
10
+ query: [
11
+ { key: 'status',
12
+ value: val,
13
+ matchingMethod: 'EXACT' }
14
+ ],
15
+ sort: { field: 'status', ascending: true } }
16
+ end
17
+
7
18
  require_relative '../spec_helper'
8
19
  require_relative "../../lib/wavefront-cli/#{word}"
9
20
 
10
21
  describe "#{word} command" do
11
22
  missing_creds(word, ['list', "describe #{id}", "snooze #{id}",
23
+ 'queries', 'snoozed', "install #{id}",
24
+ "uninstall #{id}", 'firing',
25
+ 'currently firing', 'summary',
12
26
  "delete #{id}", "undelete #{id}", "history #{id}"])
13
27
  list_tests(word)
14
28
  cmd_to_call(word, "describe #{id}", path: "/api/v2/#{word}/#{id}")
@@ -35,16 +49,16 @@ describe "#{word} command" do
35
49
  method: :post, path: "/api/v2/#{word}/#{id}/snooze")
36
50
  cmd_to_call(word, "search id=#{id}",
37
51
  method: :post, path: "/api/v2/search/#{word}",
38
- body: { limit: 10,
39
- offset: 0,
40
- query: [{ key: 'id',
41
- value: id,
42
- matchingMethod: 'EXACT' }],
43
- sort: { field: 'id', ascending: true } },
52
+ body: { limit: 10,
53
+ offset: 0,
54
+ query: [{ key: 'id',
55
+ value: id,
56
+ matchingMethod: 'EXACT' }],
57
+ sort: { field: 'id', ascending: true } },
44
58
  headers: JSON_POST_HEADERS)
45
59
  cmd_to_call(word, "snooze -T 800 #{id}",
46
60
  method: :post,
47
- path: "/api/v2/#{word}/#{id}/snooze?seconds=800")
61
+ path: "/api/v2/#{word}/#{id}/snooze?seconds=800")
48
62
  cmd_to_call(word, "unsnooze #{id}",
49
63
  method: :post, path: "/api/v2/#{word}/#{id}/unsnooze")
50
64
  cmd_to_call(word, "install #{id}",
@@ -56,5 +70,22 @@ describe "#{word} command" do
56
70
  "undelete #{bad_id}", "snooze #{bad_id}",
57
71
  "install #{bad_id}", "uninstall #{bad_id}",
58
72
  "snooze -T 500 #{bad_id}"])
73
+ cmd_to_call(word, 'snoozed',
74
+ method: :post,
75
+ path: "/api/v2/search/#{word}",
76
+ body: search_body('snoozed'))
77
+ cmd_to_call(word, 'firing',
78
+ method: :post,
79
+ path: "/api/v2/search/#{word}",
80
+ body: search_body('firing'))
81
+ cmd_to_call(word, 'currently firing',
82
+ method: :post,
83
+ path: "/api/v2/search/#{word}",
84
+ body: search_body('firing'))
85
+ cmd_to_call(word, 'currently in_maintenance',
86
+ method: :post,
87
+ path: "/api/v2/search/#{word}",
88
+ body: search_body('in_maintenance'))
89
+ cmd_to_call(word, 'queries', path: "/api/v2/#{word}?limit=999&offset=0")
59
90
  tag_tests(word, id, bad_id)
60
91
  end
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: 2.15.0
4
+ version: 2.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Fisher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-18 00:00:00.000000000 Z
11
+ date: 2018-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -330,8 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
330
  - !ruby/object:Gem::Version
331
331
  version: '0'
332
332
  requirements: []
333
- rubyforge_project:
334
- rubygems_version: 2.7.8
333
+ rubygems_version: 3.0.0
335
334
  signing_key:
336
335
  specification_version: 4
337
336
  summary: CLI for Wavefront API v2