sensu-cli 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/sensu-cli/cli.rb CHANGED
@@ -136,10 +136,10 @@ module SensuCli
136
136
  p = Trollop::options do
137
137
  opt :limit, 'The number if clients to return', :short => 'l', :type => :string
138
138
  opt :offset, 'The number of clients to offset before returning', :short => 'o', :type => :string
139
- opt :format, 'Available formats; single, table', :short => 'f', :type => :string
139
+ opt :format, 'Available formats; single, table, json', :short => 'f', :type => :string
140
140
  opt :fields, 'Fields for table ouput: -F name,address,subscriptions', :short => 'F', :type => :string
141
141
  end
142
- Trollop::die :format, 'Available optional formats: single, table'.color(:red) if p[:format] != 'table' && p[:format] != 'single' && p[:format] != 'json' && p[:format]
142
+ Trollop::die :format, 'Available optional formats: single, table, json'.color(:red) if p[:format] != 'table' && p[:format] != 'single' && p[:format] != 'json' && p[:format]
143
143
  Trollop::die :fields, 'Fields must be used in conjunction with --format table'.color(:red) if p[:format] != 'table' && p[:fields]
144
144
  Trollop::die :offset, 'Offset depends on the limit option --limit ( -l )'.color(:red) if p[:offset] && !p[:limit]
145
145
  { :command => 'clients', :method => 'Get', :fields => p }
@@ -201,9 +201,9 @@ module SensuCli
201
201
  case command
202
202
  when 'list'
203
203
  p = Trollop::options do
204
- opt :format, 'Available formats; single, table', :short => 'f', :type => :string
204
+ opt :format, 'Available formats; single, table, json', :short => 'f', :type => :string
205
205
  end
206
- Trollop::die :format, 'Available optional formats: single, table'.color(:red) if p[:format] != 'table' && p[:format] != 'single' && p[:format] != 'json' && p[:format]
206
+ Trollop::die :format, 'Available optional formats: single, table, json'.color(:red) if p[:format] != 'table' && p[:format] != 'single' && p[:format] != 'json' && p[:format]
207
207
  { :command => 'events', :method => 'Get', :fields => p }
208
208
  when 'show'
209
209
  p = Trollop::options do
@@ -231,10 +231,10 @@ module SensuCli
231
231
  p = Trollop::options do
232
232
  opt :limit, 'The number of stashes to return', :short => 'l', :type => :string
233
233
  opt :offset, 'The number of stashes to offset before returning', :short => 'o', :type => :string
234
- opt :format, 'Available formats; single, table', :short => 'f', :type => :string
234
+ opt :format, 'Available formats; single, table, json', :short => 'f', :type => :string
235
235
  end
236
236
  Trollop::die :offset, 'Offset depends on the limit option --limit ( -l )'.color(:red) if p[:offset] && !p[:limit]
237
- Trollop::die :format, 'Available optional formats: single, table'.color(:red) if p[:format] != 'table' && p[:format] != 'single' && p[:format] != 'json' && p[:format]
237
+ Trollop::die :format, 'Available optional formats: single, table, json'.color(:red) if p[:format] != 'table' && p[:format] != 'single' && p[:format] != 'json' && p[:format]
238
238
  { :command => 'stashes', :method => 'Get', :fields => p }
239
239
  when 'show'
240
240
  p = Trollop::options
@@ -283,7 +283,8 @@ module SensuCli
283
283
  def silence
284
284
  opts = parser('SIL')
285
285
  p = Trollop::options do
286
- opt :check, 'The check to silence (requires --client)', :short => 'k', :type => :string
286
+ opt :check, 'The check to silence', :short => 'k', :type => :string
287
+ opt :owner, 'The owner of the stash', :short => 'o', :type => :string
287
288
  opt :reason, 'The reason this check/node is being silenced', :short => 'r', :type => :string
288
289
  opt :expires, 'The number of minutes the silenced event is valid (must use with check-stashes plugin)', :short => 'e', :type => :integer
289
290
  end
@@ -57,6 +57,7 @@ module SensuCli
57
57
 
58
58
  def silence(cli)
59
59
  payload = { :timestamp => Time.now.to_i }
60
+ payload.merge!({ :owner => cli[:fields][:owner] }) if cli[:fields][:owner]
60
61
  payload.merge!({ :reason => cli[:fields][:reason] }) if cli[:fields][:reason]
61
62
  if cli[:fields][:expires]
62
63
  expires = Time.now.to_i + (cli[:fields][:expires] * 60)
@@ -1,3 +1,3 @@
1
1
  module SensuCli
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Bryan Brandau
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-08-09 00:00:00.000000000 Z
12
+ date: 2013-10-24 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rainbow
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - '='
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - '='
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: trollop
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - '='
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - '='
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: mixlib-config
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - '='
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - '='
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: hirb
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - '='
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - '='
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: rspec
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ! '>='
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ! '>='
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: rubocop
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ! '>='
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ! '>='
95
108
  - !ruby/object:Gem::Version
@@ -120,25 +133,26 @@ homepage: http://github.com/agent462/sensu-cli
120
133
  licenses:
121
134
  - MIT
122
135
  - APACHE
123
- metadata: {}
124
136
  post_install_message:
125
137
  rdoc_options: []
126
138
  require_paths:
127
139
  - lib
128
140
  required_ruby_version: !ruby/object:Gem::Requirement
141
+ none: false
129
142
  requirements:
130
143
  - - ! '>='
131
144
  - !ruby/object:Gem::Version
132
145
  version: '0'
133
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
+ none: false
134
148
  requirements:
135
149
  - - ! '>='
136
150
  - !ruby/object:Gem::Version
137
151
  version: '0'
138
152
  requirements: []
139
153
  rubyforge_project:
140
- rubygems_version: 2.0.3
154
+ rubygems_version: 1.8.25
141
155
  signing_key:
142
- specification_version: 4
156
+ specification_version: 3
143
157
  summary: A command line utility for Sensu.
144
158
  test_files: []
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YTBkNzc4ZGU4NzM5YzE5ZmFlYjI1MDc4OWVjN2FlMGUxNmMzZjE5YQ==
5
- data.tar.gz: !binary |-
6
- N2JlZGE0NmNiMjJiODFiOTUyNmQ3ZjI1NTVmZjI1NjE4NGRjMjVlNA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- NDI1NWRiMTk4MjRmZWQwZTJlN2YzNGVjYTFhOGVjNGZlMjY5YjAzMDA0ZGJj
10
- NjhjOTEyMjlmOTZkMzY0MGY0YjE4YTAxOWJjM2NlODk5NWE0ZTIxZjkwY2Zh
11
- NmI5YTVhNDU3NTFlZjMxNTVmZmQwNGNjNGE1OTcxNWNjNTcxZWQ=
12
- data.tar.gz: !binary |-
13
- ZDQzZGM5NGVhNjhmNGRhNmEzNGJmN2IyYzQzZTk3N2E2YWE5ZmI5YzIyN2Qz
14
- ZmY1MGQzZjk0MGE0MDNhMzQ1ZmVmMjJhNGVmNmZkZTI2MGI0MDg3M2FiZTRj
15
- ZjY5NzVhZTI4OWQyZjBhOWNjYzJhZTg4NjdhNTZlZTVkYjJmOWQ=