You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/11/12 20:44:02 UTC
[3/6] git commit: CIMI: Fixed format of capacity property,
removed obsolete properties
CIMI: Fixed format of capacity property, removed obsolete properties
* guestInterface, supportSnapshots removed
* capacity is now 1.0.1 compliant
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/85e8b1e1
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/85e8b1e1
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/85e8b1e1
Branch: refs/heads/master
Commit: 85e8b1e1c558b85550c607f1a65470786f9c11eb
Parents: 935cc01
Author: Michal Fojtik <mf...@redhat.com>
Authored: Mon Nov 12 12:16:31 2012 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Mon Nov 12 20:22:10 2012 +0100
----------------------------------------------------------------------
server/lib/cimi/models/volume_configuration.rb | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/85e8b1e1/server/lib/cimi/models/volume_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume_configuration.rb b/server/lib/cimi/models/volume_configuration.rb
index dd9f068..7b7860d 100644
--- a/server/lib/cimi/models/volume_configuration.rb
+++ b/server/lib/cimi/models/volume_configuration.rb
@@ -18,12 +18,9 @@ class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
acts_as_root_entity :as => "volumeConfigs"
text :format
- struct :capacity do
- scalar :quantity
- scalar :units
- end
- text :supports_snapshots
- text :guest_interface
+
+ text :capacity
+
array :operations do
scalar :rel, :href
end
@@ -50,10 +47,10 @@ class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
def self.create(size, context)
self.new( {
:id => context.volume_configuration_url(size),
- :name => size,
- :description => "volume configuration with #{size} GiB",
+ :name => "volume-#{size}",
+ :description => "Volume configuration with #{size} kilobytes",
:created => Time.now.xmlschema,
- :capacity => {:quantity=>size, :units=>"gibibytes"},
+ :capacity => context.to_kibibyte(size, "MB"),
:supports_snapshots => "true"
# FIXME :guest_interface => "NFS"
} )