Sha256: ae98fcd79a97bd329c8b20f9d835888411adbdeb6fa16688c4b55c9e1e460501

Contents?: true

Size: 559 Bytes

Versions: 34

Compression:

Stored size: 559 Bytes

Contents

require 'fog/openstack/models/collection'
require 'fog/metric/openstack/models/resource'

module Fog
  module Metric
    class OpenStack
      class Resources < Fog::OpenStack::Collection

        model Fog::Metric::OpenStack::Resource

        def all(options = {})
          load_response(service.list_resources(options))
        end

        def find_by_id(resource_id)
          resource = service.get_resource(resource_id).body
          new(resource)
        rescue Fog::Metric::OpenStack::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

34 entries across 32 versions & 3 rubygems

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