Module: Zenoss::Model::EventView

Included in:
Device
Defined in:
lib/model/event_view.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) get_event_history

------------------ REST Calls ------------------ #



26
27
28
29
# File 'lib/model/event_view.rb', line 26

def get_event_history
  #rest('getEventHistory')
  get_event_manager('history')
end

- (Object) get_event_manager(table = 'status'))



31
32
33
34
# File 'lib/model/event_view.rb', line 31

def get_event_manager(table='status')
  manager = rest("getEventManager?table=#{table}")
  Model::Events::MySqlEventManager.new(manager.sub(/.* at (.*)>$/,'\1'))
end

- (Object) get_status(statusclass = nil)

Fetches that status number for this device or component



37
38
39
40
41
42
43
# File 'lib/model/event_view.rb', line 37

def get_status(statusclass=nil)
  method = 'getStatus'
  method << "?statusclass=#{statusclass}" unless statusclass.nil?

  # nil.to_i is 0 so we should be OK for nil returns
  rest(method).to_i
end

- (Object) get_status_css_class(status_number)

Fetches the css class for this status number. This is usually the output from the #get_status method. If this is not working you may need to apply this patch to Zenoss: gist.github.com/328414



57
58
59
# File 'lib/model/event_view.rb', line 57

def get_status_css_class(status_number)
  custom_rest("getStatusCssClass?status=#{status_number}")
end

- (Object) get_status_img_src(status_number)

Fetches the img src path for this status number. This is usually the output from the #get_status method. If this is not working you may need to apply this patch to Zenoss: gist.github.com/328414



49
50
51
# File 'lib/model/event_view.rb', line 49

def get_status_img_src(status_number)
  custom_rest("getStatusImgSrc?status=#{status_number}")
end