Class: Fog::Orchestration::OpenStack::Events

Inherits:
Fog::OpenStack::Collection show all
Defined in:
lib/fog/orchestration/openstack/models/events.rb

Instance Attribute Summary

Attributes inherited from Fog::OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from Fog::OpenStack::Collection

#destroy, #find_by_id, #load_response, #summary

Instance Method Details

#all(options = {}, options_deprecated = {}) ⇒ Object


10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fog/orchestration/openstack/models/events.rb', line 10

def all(options = {}, options_deprecated = {})
  data = if options.kind_of?(Stack)
           service.list_stack_events(options, options_deprecated)
         elsif options.kind_of?(Hash)
           service.list_events(options)
         else
           service.list_resource_events(options.stack, options, options_deprecated)
         end

  load_response(data, 'events')
end

#get(stack, resource, event_id) ⇒ Object


22
23
24
25
26
27
# File 'lib/fog/orchestration/openstack/models/events.rb', line 22

def get(stack, resource, event_id)
  data = service.show_event_details(stack, resource, event_id).body['event']
  new(data)
rescue Fog::Compute::OpenStack::NotFound
  nil
end