Sha256: 394f4cf8b6e1e6ca6c2e12f1b7b466afcef1aa8ffd0c1e45570929a1e94467ec

Contents?: true

Size: 967 Bytes

Versions: 4

Compression:

Stored size: 967 Bytes

Contents

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

module Fog
  module Orchestration
    class HuaweiCloud
      class Events < Fog::HuaweiCloud::Collection
        model Fog::Orchestration::HuaweiCloud::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::HuaweiCloud::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/orchestration/huaweicloud/models/events.rb
fog-huaweicloud-0.0.2 lib/fog/orchestration/huaweicloud/models/events.rb
fog-huaweicloud-0.1.3 lib/fog/orchestration/huaweicloud/models/events.rb
fog-huaweicloud-0.1.2 lib/fog/orchestration/huaweicloud/models/events.rb