You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/11/12 12:34:54 UTC
[PATCH core 2/5] CIMI: Removed obsoleted properties, added type and state to Volume
From: Michal Fojtik <mf...@redhat.com>
* guestInterface and supportSnapshots removed
* type and state added
Signed-off-by: Michal fojtik <mf...@redhat.com>
---
server/lib/cimi/models/volume.rb | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
index 739629a..7332847 100644
--- a/server/lib/cimi/models/volume.rb
+++ b/server/lib/cimi/models/volume.rb
@@ -17,16 +17,21 @@ class CIMI::Model::Volume < CIMI::Model::Base
acts_as_root_entity
+ text :state
+
+ href :type
+
struct :capacity do
scalar :quantity
scalar :units
end
+
text :bootable
- text :supports_snapshots
+
array :snapshots do
scalar :ref
end
- text :guest_interface
+
array :meters do
scalar :ref
end
@@ -94,9 +99,9 @@ class CIMI::Model::Volume < CIMI::Model::Base
:id => context.volume_url(volume.id),
:capacity => { :quantity=>volume.capacity, :units=>"gibibyte" }, #FIXME... units will vary
:bootable => "false", #fixme ... will vary... ec2 doesn't expose this
- :supports_snapshots => "true", #fixme, will vary (true for ec2)
:snapshots => [], #fixme...
- :guest_interface => "",
+ :type => { :href => 'http://schemas.dmtf.org/cimi/1/mapped' },
+ :state => volume.state,
:meters => []
} )
end
--
1.8.0
Re: [PATCH core 2/5] CIMI: Removed obsoleted properties, added type
and state to Volume
Posted by "marios@redhat.com" <ma...@redhat.com>.
ACK
minor nit/note...
not sure what to do about 'in-use' state...
I mean, yes, 'providers may define additional states'. Right now, volume
doesn't define anything like 'in-use' for Volume... mainly because
volumes can be 'shared' so 'available' can also mean "it's already being
used but is also available". Whether providers allow mapped volumed to
be shared is advertised by a capability "SharedVolumeSupport" under
Volume ResourceMetadata. Just something to think about... perhaps we
need a mantis issue to ask for 'in-use' equivalent state "not available"
for example,
marios
On 12/11/12 13:34, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mf...@redhat.com>
>
> * guestInterface and supportSnapshots removed
> * type and state added
>
> Signed-off-by: Michal fojtik <mf...@redhat.com>
> ---
> server/lib/cimi/models/volume.rb | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
> index 739629a..7332847 100644
> --- a/server/lib/cimi/models/volume.rb
> +++ b/server/lib/cimi/models/volume.rb
> @@ -17,16 +17,21 @@ class CIMI::Model::Volume < CIMI::Model::Base
>
> acts_as_root_entity
>
> + text :state
> +
> + href :type
> +
> struct :capacity do
> scalar :quantity
> scalar :units
> end
> +
> text :bootable
> - text :supports_snapshots
> +
> array :snapshots do
> scalar :ref
> end
> - text :guest_interface
> +
> array :meters do
> scalar :ref
> end
> @@ -94,9 +99,9 @@ class CIMI::Model::Volume < CIMI::Model::Base
> :id => context.volume_url(volume.id),
> :capacity => { :quantity=>volume.capacity, :units=>"gibibyte" }, #FIXME... units will vary
> :bootable => "false", #fixme ... will vary... ec2 doesn't expose this
> - :supports_snapshots => "true", #fixme, will vary (true for ec2)
> :snapshots => [], #fixme...
> - :guest_interface => "",
> + :type => { :href => 'http://schemas.dmtf.org/cimi/1/mapped' },
> + :state => volume.state,
> :meters => []
> } )
> end
>