module Sensu::API::Routes::Resolve

Constants

RESOLVE_URI

Public Instance Methods

post_resolve() click to toggle source

POST /resolve

# File lib/sensu/api/routes/resolve.rb, line 12
def post_resolve
  rules = {
    :client => {:type => String, :nil_ok => false},
    :check => {:type => String, :nil_ok => false}
  }
  read_data(rules) do |data|
    @redis.hgetall("events:#{data[:client]}") do |events|
      if events.include?(data[:check])
        resolve_event(events[data[:check]])
        @response_content = {:issued => Time.now.to_i}
        accepted!
      else
        not_found!
      end
    end
  end
end