49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/cimi/service/volume.rb', line 49
def self.from_storage_volume(volume, context)
self.new(context, :values => {
:name => volume.name || volume.id,
:created => volume.created.nil? ? nil : Time.parse(volume.created).xmlschema,
:id => context.volume_url(volume.id),
:capacity => context.to_kibibyte(volume.capacity, 'GB'),
:bootable => "false", :snapshots => [], :type => 'http://schemas.dmtf.org/cimi/1/mapped',
:state => volume.state == 'IN-USE' ? 'AVAILABLE' : volume.state,
:meters => [],
:operations => [{:href=> context.volume_url(volume.id), :rel => "delete"}]
})
end
|