From: marios <[email protected]>

Signed-off-by: marios <[email protected]>
---
 server/lib/cimi/server.rb |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/server/lib/cimi/server.rb b/server/lib/cimi/server.rb
index 85fa2f6..64f3b8c 100644
--- a/server/lib/cimi/server.rb
+++ b/server/lib/cimi/server.rb
@@ -238,4 +238,45 @@ global_collection :volumes do
     end
   end
 
+  operation :create do
+    description "Create a new Volume."
+    control do
+      params.merge!({:content_type => (request.content_type.end_with?("+json") 
? :json  : :xml) })
+      #((request.content_type.end_with?("+xml")) ? :xml : report_error(415) ) 
FIXME
+      new_volume = Volume.create(params, self)
+      respond_to do |format|
+        format.json { new_volume.to_json }
+        format.xml { new_volume.to_xml }
+      end
+    end
+  end
+
+end
+
+global_collection :volume_configurations do
+  description "The Volume Configuration entity represents the set of 
configuration values needed to create a Volume with certain characteristics. 
Volume Configurations are created by Providers and MAY, at the Providers 
discretion, be created by Consumers"
+
+  operation :index do
+    description "Get list all VolumeConfigurations"
+    control do
+      volume_configs = VolumeConfiguration.all(self)
+      respond_to do |format|
+        format.xml { volume_configs.to_xml_cimi_collection(self) }
+        format.json { volume_configs.to_json_cimi_collection(self) }
+      end
+    end
+  end
+
+  operation :show do
+    description "Get a specific VolumeConfiguration"
+    param :id, :required, :string
+    control do
+      volume_config = VolumeConfiguration.find(params[:id], self)
+      respond_to do |format|
+        format.xml { volume_config.to_xml }
+        format.json { volume_config.json }
+      end
+    end
+  end
+
 end
-- 
1.7.6.4

Reply via email to