deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1214355 - /deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb
Date Wed, 14 Dec 2011 17:23:31 GMT
Author: marios
Date: Wed Dec 14 17:23:31 2011
New Revision: 1214355

URL: http://svn.apache.org/viewvc?rev=1214355&view=rev
Log:
Adds storage_volume create/delete to mock driver

Modified:
    deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb

Modified: deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb?rev=1214355&r1=1214354&r2=1214355&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb (original)
+++ deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb Wed Dec 14 17:23:31
2011
@@ -245,6 +245,25 @@ module Deltacloud::Drivers::Mock
       volumes
     end
 
+    def create_storage_volume(credentials, opts=nil)
+      check_credentials(credentials)
+      opts ||= {}
+      opts[:capacity] ||= "1"
+      volume = {
+            :id => "Volume#{Time.now.to_i}",
+            :created => Time.now.to_s,
+            :state => "AVAILABLE",
+            :capacity => opts[:capacity],
+      }
+      @client.store(:storage_volumes, volume)
+      StorageVolume.new(volume)
+    end
+
+    def destroy_storage_volume(credentials, opts=nil)
+      check_credentials(credentials)
+      @client.destroy(:storage_volumes, opts[:id])
+    end
+
     #
     # Storage Snapshots
     #



Mime
View raw message