Sha256: c981fce5eca5a1bd6a0c26b601e81ef818afe0afb1be9c254681be6b9f9b5815

Contents?: true

Size: 886 Bytes

Versions: 2

Compression:

Stored size: 886 Bytes

Contents

require 'yao/resources/volume_action'

module Yao::Resources
  class Volume < Base
    include ProjectAssociationable

    friendly_attributes :attachments, :availability_zone, :bootable, :descriptions, :encrypted, :metadata, :multiattach, :name, :replication_status, :size, :snapshot_id, :status, :user_id, :volume_type
    alias :type :volume_type

    map_attribute_to_attribute 'os-vol-host-attr:host' => :host
    map_attribute_to_attribute 'os-vol-tenant-attr:tenant_id' => :tenant_id

    map_attributes_to_time :created_at, :updated_at
    alias :created :created_at
    alias :updated :updated_at

    self.service        = "volumev3"
    self.resource_name  = "volume"
    self.resources_name = "volumes"
    self.resources_detail_available = true

    def status=(s)
      self.class.set_status(self.id, s)
      self['status'] = s
    end

    extend VolumeAction
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yao-0.21.0 lib/yao/resources/volume.rb
yao-0.20.0 lib/yao/resources/volume.rb