Sha256: 6d9060b02b1718304130e82ac17606bb13c8d47b6cf59ec830ebd2d6be53f822

Contents?: true

Size: 606 Bytes

Versions: 4

Compression:

Stored size: 606 Bytes

Contents

require 'fog/compute/gridscale/models/paging_collection'

module Fog
  module Compute
    class Gridscale
      class Storages < Fog::Compute::Gridscale::PagingCollection
        model Fog::Compute::Gridscale::Storage

        def all(filters={})
          data = service.storages_get(filters)
          droplets = data.body["storages"].values
          load(droplets)
        end

        def get(object_uuid)
          storage = service.storage_get(object_uuid).body['storage']
          new(storage) if storage
        rescue Fog::Errors::NotFound
          nil
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-gridscale-0.1.5 lib/fog/compute/gridscale/models/storages.rb
fog-gridscale-0.1.4 lib/fog/compute/gridscale/models/storages.rb
fog-gridscale-0.1.3 lib/fog/compute/gridscale/models/storages.rb
fog-gridscale-0.1.2 lib/fog/compute/gridscale/models/storages.rb