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

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

Instance Attribute Summary

Attributes inherited from Fog::OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from Fog::OpenStack::Collection

#destroy, #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/openstack/models/orchestration/events.rb', line 10

def all(options = {}, options_deprecated = {})
  data = if options.is_a?(Stack)
           service.list_stack_events(options, options_deprecated)
         elsif options.is_a?(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/openstack/models/orchestration/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