deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH 1/2] Adds CIMI::VolumeImage to server.rb (index/show)
Date Fri, 25 Nov 2011 12:07:49 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/cimi/server.rb |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/server/lib/cimi/server.rb b/server/lib/cimi/server.rb
index 2bd3a39..fdd7f17 100644
--- a/server/lib/cimi/server.rb
+++ b/server/lib/cimi/server.rb
@@ -255,4 +255,32 @@ global_collection :volumes do
     end
   end
 
+global_collection :volume_images do
+  description 'This entity represents an image that could be place on a pre-loaded volume.'
+
+  operation :index do
+    description "List all volumes images"
+    control do
+      volume_images = VolumeImage.all(self)
+      respond_to do |format|
+        format.xml { volume_images.to_xml_cimi_collection(self) }
+        format.json { volume_images.to_json_cimi_collection(self) }
+      end
+    end
+  end
+
+  operation :show do
+    description "Show a specific volume image"
+    param :id, :string, :required
+    control do
+      volume_image = VolumeImage.find(params[:id], self)
+      respond_to do |format|
+        format.xml { volume_image.to_xml }
+        format.json { volume_image.to_json }
+      end
+    end
+  end
+
+end
+
 end
-- 
1.7.6.4


Mime
View raw message