Sha256: 16d87c2e8ec9229d202e1845a1c508a16f9fb76786694be39c5d678744178e5e

Contents?: true

Size: 955 Bytes

Versions: 39

Compression:

Stored size: 955 Bytes

Contents

require 'fog/openstack/models/collection'
require 'fog/orchestration/openstack/models/event'

module Fog
  module Orchestration
    class OpenStack
      class Events < Fog::OpenStack::Collection
        model Fog::Orchestration::OpenStack::Event

        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

        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
      end
    end
  end
end

Version data entries

39 entries across 37 versions & 3 rubygems

Version Path
fog-openstack-0.1.31 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.10 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.1.30 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.1.29 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.9 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.1.28 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.8 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.7 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.6 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.5 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.4 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.3 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.2 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.3.0 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.2.4 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.2.3 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.2.2 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.2.1 lib/fog/orchestration/openstack/models/events.rb
fog-openstack-0.2.0 lib/fog/orchestration/openstack/models/events.rb
fog-zj-0.1.28 lib/fog/orchestration/openstack/models/events.rb