Sha256: d569543e63f7b1d7aa3fe62774a23c2cda15a8ad76bf147b36c72920e5128bfb

Contents?: true

Size: 1016 Bytes

Versions: 16

Compression:

Stored size: 1016 Bytes

Contents

require 'fog/core/collection'
require 'fog/hp/models/block_storage_v2/volume'

module Fog
  module HP
    class BlockStorageV2
      class Volumes < Fog::Collection
        attribute :filters

        model Fog::HP::BlockStorageV2::Volume

        def initialize(attributes)
          self.filters ||= {}
          super
        end

        def all(filters = filters)
          details = filters.delete(:details)
          self.filters = filters
          non_aliased_filters = Fog::HP.convert_aliased_attributes_to_original(self.model, filters)
          if details
            data = service.list_volumes_detail(non_aliased_filters).body['volumes']
          else
            data = service.list_volumes(non_aliased_filters).body['volumes']
          end
          load(data)
        end

        def get(volume_id)
          volume = service.get_volume_details(volume_id).body['volume']
          new(volume)
        rescue Fog::HP::BlockStorageV2::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/hp/models/block_storage_v2/volumes.rb
fog-1.26.0 lib/fog/hp/models/block_storage_v2/volumes.rb
fog-1.25.0 lib/fog/hp/models/block_storage_v2/volumes.rb
nsidc-fog-1.24.1 lib/fog/hp/models/block_storage_v2/volumes.rb
fog-1.24.0 lib/fog/hp/models/block_storage_v2/volumes.rb
ns-fog-1.22.11 lib/fog/hp/models/block_storage_v2/volumes.rb
ns-fog-1.22.10 lib/fog/hp/models/block_storage_v2/volumes.rb
ns-fog-1.22.9 lib/fog/hp/models/block_storage_v2/volumes.rb
ns-fog-1.22.8 lib/fog/hp/models/block_storage_v2/volumes.rb
ns-fog-1.22.7 lib/fog/hp/models/block_storage_v2/volumes.rb
ns-fog-1.22.6 lib/fog/hp/models/block_storage_v2/volumes.rb
fog-1.23.0 lib/fog/hp/models/block_storage_v2/volumes.rb
ns-fog-1.22.4 lib/fog/hp/models/block_storage_v2/volumes.rb
ns-fog-1.22.3 lib/fog/hp/models/block_storage_v2/volumes.rb
ns-fog-1.22.2 lib/fog/hp/models/block_storage_v2/volumes.rb
fog-1.22.1 lib/fog/hp/models/block_storage_v2/volumes.rb