Module: BlackStack::QABot::Flag
Overview
this module contains methods that are commons to any kind flags
Class Method Summary collapse
-
.push(h) ⇒ Object
submit a flag descriptor to the server, via REST-API.
Instance Method Summary collapse
-
#alert ⇒ Object
send an email notification to all the receivers of this flag.
-
#should_alert? ⇒ Boolean
return true of the latest trace is ‘stat_red==true`, and the previous trace is `stat_red==false`.
Class Method Details
.push(h) ⇒ Object
submit a flag descriptor to the server, via REST-API.
254 255 256 257 258 259 260 261 262 263 |
# File 'lib/qabot.rb', line 254 def self.push(h) # get defined URL for the REST-API api_url = BlackStack::QABot::qabot_api_url # if the URL for the REST-API is not defined, grab it from the Pampa process where this is running api_url = "#{CS_HOME_PAGE_PROTOCOL}://#{PROCESS.division.home.app_url}:#{PROCESS.division.home.app_port}" if api_url.nil? # do the API call url = "#{api_url}/api.1.1.0/qabot/push.json" api_key = BlackStack::Pampa::api_key BlackStack::Netting::api_call( url, {:api_key => api_key}.merge(h) ) end |
Instance Method Details
#alert ⇒ Object
send an email notification to all the receivers of this flag.
249 250 251 |
# File 'lib/qabot.rb', line 249 def alert() # TODO: Code Me! end |
#should_alert? ⇒ Boolean
return true of the latest trace is ‘stat_red==true`, and the previous trace is `stat_red==false`.
243 244 245 246 |
# File 'lib/qabot.rb', line 243 def should_alert? # TODO: Code Me! false end |