Sha256: f97fa5771be1de82fe8b68461a7644fd694e45a6422d516582385889448e3066

Contents?: true

Size: 531 Bytes

Versions: 23

Compression:

Stored size: 531 Bytes

Contents

require 'fog/core/collection'
require 'fog/openstack/models/metering/resource'

module Fog
  module Metering
    class OpenStack
      class Resources < Fog::Collection
        model Fog::Metering::OpenStack::Resource

        def all(detailed=true)
          load(service.list_resources.body)
        end

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

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/openstack/models/metering/resources.rb
fog-1.32.0 lib/fog/openstack/models/metering/resources.rb
fog-1.31.0 lib/fog/openstack/models/metering/resources.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/openstack/models/metering/resources.rb
fog-1.30.0 lib/fog/openstack/models/metering/resources.rb
fog-1.29.0 lib/fog/openstack/models/metering/resources.rb
fog-1.28.0 lib/fog/openstack/models/metering/resources.rb
fog-1.27.0 lib/fog/openstack/models/metering/resources.rb
fog-1.26.0 lib/fog/openstack/models/metering/resources.rb
fog-1.25.0 lib/fog/openstack/models/metering/resources.rb
nsidc-fog-1.24.1 lib/fog/openstack/models/metering/resources.rb
fog-1.24.0 lib/fog/openstack/models/metering/resources.rb
ns-fog-1.22.11 lib/fog/openstack/models/metering/resources.rb
ns-fog-1.22.10 lib/fog/openstack/models/metering/resources.rb
ns-fog-1.22.9 lib/fog/openstack/models/metering/resources.rb
ns-fog-1.22.8 lib/fog/openstack/models/metering/resources.rb
ns-fog-1.22.7 lib/fog/openstack/models/metering/resources.rb
ns-fog-1.22.6 lib/fog/openstack/models/metering/resources.rb
fog-1.23.0 lib/fog/openstack/models/metering/resources.rb
ns-fog-1.22.4 lib/fog/openstack/models/metering/resources.rb