1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/ibm/models/storage/volume.rb

39 lines
1 KiB
Ruby
Raw Normal View History

2012-01-10 17:20:56 -05:00
require 'fog/core/model'
module Fog
module Storage
class IBM
class Volume < Fog::Model
identity :id
attribute :location
attribute :instance_id, :aliases => 'instanceId'
attribute :owner
attribute :name
attribute :format
attribute :size
attribute :state
attribute :storage_area, :aliases => 'storageArea'
attribute :created_at, :aliases => 'createdTime'
attribute :product_codes, :aliases => 'productCodes'
attribute :platform_version, :aliases => 'platformVersion'
attribute :clone_status, :aliases => 'cloneStatus'
attribute :offering_id
def save
requires :name, :offering_id, :format, :location, :size
data = connection.create_volume(name, offering_id, format, location, size)
merge_attributes(data.body)
data.body['success']
end
def destroy
requires :id
connection.delete_volume(id)
end
end
end
end
end