Class: Ring::SQA::Alarm::Collector

Inherits:
Object
  • Object
show all
Defined in:
lib/ring/sqa/alarm/collector.rb

Constant Summary collapse

URL =
'http://sqa-collector.infra.ring.nlnog.net/'
TIMEOUT =
10

Instance Method Summary collapse

Instance Method Details

#send(opts) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ring/sqa/alarm/collector.rb', line 11

def send opts
  json = JSON.pretty_generate( {
    :alarm_buffer => opts[:alarm_buffer].exceeding_nodes,
    :nodes        => opts[:nodes].all,
    :short        => opts[:short],
    :long         => opts[:long],
    :status       => opts[:status],
    :afi          => opts[:afi],
  })
  post json
rescue => error
  Log.error "Collector send raised '#{error.class}' with message '#{error.message}'"
end