lib/dogapi/v1/event.rb
# Records an Event with no duration
Records an Event with no duration
Records an Event with no duration
def post(event, scope=nil)
        begin
          scope = scope || Dogapi::Scope.new()
          params = {
            :api_key => @api_key
          }
          body = event.to_hash.merge({
            :title => event.msg_title,
            :text => event.msg_text,
            :date_happened => event.date_happened.to_i,
            :host => scope.host,
            :device => scope.device,
            :aggregation_key => event.aggregation_key.to_s
          })
          request(Net::HTTP::Post, '/api/v1/events', params, body, true)
        rescue Exception => e
          if @silent
            warn e
            return -1, {}
          else
            raise e
          end
        end
      end
def post ( event , scope = nil ) begin scope = scope || Dogapi :: Scope . new ( ) params = { :api_key => @api_key } body = event . to_hash . merge ( { :title => event . msg_title , :text => event . msg_text , :date_happened => event . date_happened . to_i , :host => scope . host , :device => scope . device , :aggregation_key => event . aggregation_key . to_s } ) request ( Net :: HTTP :: Post , '/api/v1/events' , params , body , true ) rescue Exception => e if @silent warn e return - 1 , { } else raise e end end end
Records an Event with no duration
Records an Event with no duration
event
<not_specific>
scope
<not_specific>