sensu 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.org +1 -0
  2. data/lib/sensu.rb +1 -1
  3. data/lib/sensu/api.rb +25 -0
  4. metadata +4 -4
data/README.org CHANGED
@@ -33,3 +33,4 @@
33
33
  - [[http://twitter.com/portertech][Sean Porter]]
34
34
  - [[http://twitter.com/amdprophet][Justin Kolberg]]
35
35
  - [[http://twitter.com/kartar][James Turnbull]]
36
+ - [[http://twitter.com/joshpasqualetto][Josh Pasqualetto]]
data/lib/sensu.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sensu
2
- VERSION = "0.8.6"
2
+ VERSION = "0.8.7"
3
3
  end
data/lib/sensu/api.rb CHANGED
@@ -129,6 +129,31 @@ module Sensu
129
129
  end
130
130
  end
131
131
 
132
+ apost '/event/resolve' do
133
+ $logger.debug('[event] -- ' + request.ip + ' -- POST -- request to resolve event')
134
+ begin
135
+ event = JSON.parse(request.body.read)
136
+ rescue JSON::ParserError
137
+ status 400
138
+ body nil
139
+ end
140
+ if event.has_key?('client') && event.has_key?('check')
141
+ $redis.hgetall('events:' + event['client']).callback do |events|
142
+ if Hash[*events][event['check']]
143
+ check = {:name => event['check'], :issued => Time.now.to_i, :status => 0, :output => 'Resolving on request of the API'}
144
+ $amq.queue('results').publish({:client => event['client'], :check => check}.to_json)
145
+ status 201
146
+ else
147
+ status 404
148
+ end
149
+ body nil
150
+ end
151
+ else
152
+ status 400
153
+ body nil
154
+ end
155
+ end
156
+
132
157
  apost '/stash/*' do |path|
133
158
  $logger.debug('[stash] -- ' + request.ip + ' -- POST -- request for stash -- ' + path)
134
159
  begin
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 49
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 6
10
- version: 0.8.6
9
+ - 7
10
+ version: 0.8.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Porter
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-11-10 00:00:00 -08:00
19
+ date: 2011-11-14 00:00:00 -08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency