You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2012/11/29 09:21:46 UTC
[PATCH] CIMI - fixes DELETE route for Volume (+adds delete operation for entries)
From: marios <ma...@redhat.com>
Signed-off-by: marios <ma...@redhat.com>
---
server/lib/cimi/collections/volumes.rb | 2 +-
server/lib/cimi/models/volume.rb | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/server/lib/cimi/collections/volumes.rb b/server/lib/cimi/collections/volumes.rb
index 59fd69d..a05c396 100644
--- a/server/lib/cimi/collections/volumes.rb
+++ b/server/lib/cimi/collections/volumes.rb
@@ -64,7 +64,7 @@ module CIMI::Collections
end
end
- operation :destroy do
+ operation :destroy, :with_capability => :destroy_storage_volume do
description "Delete a specified Volume"
control do
Volume.delete!(params[:id], self)
diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
index d777cd0..6bae401 100644
--- a/server/lib/cimi/models/volume.rb
+++ b/server/lib/cimi/models/volume.rb
@@ -87,7 +87,8 @@ class CIMI::Model::Volume < CIMI::Model::Base
:snapshots => [], #fixme...
:type => 'http://schemas.dmtf.org/cimi/1/mapped',
:state => volume.state,
- :meters => []
+ :meters => [],
+ :operations => [{:href=> context.volume_url(volume.id), :rel => "delete"}]
} )
end
--
1.7.11.7
Re: [PATCH] CIMI - fixes DELETE route for Volume (+adds delete
operation for entries)
Posted by David Lutterkort <lu...@redhat.com>.
On Thu, 2012-11-29 at 10:21 +0200, marios@redhat.com wrote:
> From: marios <ma...@redhat.com>
ACK && pushed; though this still needs to be addressed:
> diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
> index d777cd0..6bae401 100644
> --- a/server/lib/cimi/models/volume.rb
> +++ b/server/lib/cimi/models/volume.rb
> @@ -87,7 +87,8 @@ class CIMI::Model::Volume < CIMI::Model::Base
> :snapshots => [], #fixme...
> :type => 'http://schemas.dmtf.org/cimi/1/mapped',
> :state => volume.state,
> - :meters => []
> + :meters => [],
> + :operations => [{:href=> context.volume_url(volume.id), :rel => "delete"}]
We should only include the delete operation if the driver supports it.
David