Class: ITRP::Cmd_delete_alerts
Instance Attribute Summary
Attributes inherited from Cmd
#attach_cmd, #children, #enabled_in_state, #trigger
Instance Method Summary collapse
- #completions(patt) ⇒ Object
- #enter(cmdline) ⇒ Object
-
#initialize(e) ⇒ Cmd_delete_alerts
constructor
A new instance of Cmd_delete_alerts.
Methods inherited from Cmd
#appstate, #find_node, #is_root?, #place_node, #print_state, #set_time_window, #treeprint
Constructor Details
#initialize(e) ⇒ Cmd_delete_alerts
Returns a new instance of Cmd_delete_alerts.
4 5 6 7 8 9 |
# File 'lib/handlers/delete_alerts.rb', line 4 def initialize (e) super(e) @enabled_in_state = :alerts @attach_cmd = '' @trigger = 'delete' end |
Instance Method Details
#completions(patt) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/handlers/delete_alerts.rb', line 11 def completions(patt) TRP::DeleteAlertsRequest .fields .values .collect { |a| a.name } .grep( /^#{Regexp.escape(patt)}/i) end |
#enter(cmdline) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/handlers/delete_alerts.rb', line 20 def enter(cmdline) terms = cmdline.scan( /(\w+)\s*=\s*([\w\-=\%_\.\:,]+)+/ ) qparams = terms.inject({}) { |acc,t| acc.store( t[0].to_sym, t[1]);acc} p qparams # meter names req =mk_request(TRP::Message::Command::DELETE_ALERTS_REQUEST, { :alert_group => appstate(:cgguid), :time_interval => appstate(:time_interval) }.merge(qparams)) resp = get_response_zmq(@appenv.zmq_endpt,req) puts(resp.) end |