Sha256: a62f69292aa5143fa6cb09fc7bbcc1303091a3822ccd071066b6cd6daf8dc99f

Contents?: true

Size: 885 Bytes

Versions: 7

Compression:

Stored size: 885 Bytes

Contents

require 'fog/openstack/models/model'

module Fog
  module Volume
    class OpenStack
      class Volume < Fog::OpenStack::Model
        attribute :metadata
        attribute :status
        attribute :size
        attribute :volume_type, :aliases => ['volumeType', 'type']
        attribute :snapshot_id, :aliases => 'snapshotId'
        attribute :imageRef, :aliases => 'image_id'
        attribute :availability_zone, :aliases => 'availabilityZone'
        attribute :created_at, :aliases => 'createdAt'
        attribute :attachments
        attribute :source_volid

        def destroy
          requires :id
          service.delete_volume(id)
          true
        end

        def extend(size)
          requires :id
          service.extend_volume(id, size)
          true
        end

        def ready?
          status == 'available'
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fog-openstack-0.1.5 lib/fog/openstack/models/volume/volume.rb
fog-openstack-0.1.4 lib/fog/openstack/models/volume/volume.rb
fog-openstack-0.1.3 lib/fog/openstack/models/volume/volume.rb
fog-openstack-0.1.2 lib/fog/openstack/models/volume/volume.rb
fog-openstack-0.1.1 lib/fog/openstack/models/volume/volume.rb
fog-openstack-0.1.0 lib/fog/openstack/models/volume/volume.rb
fog-1.37.0 lib/fog/openstack/models/volume/volume.rb