You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2010/07/09 01:17:26 UTC

svn commit: r962019 - in /incubator/deltacloud/trunk/framework: ./ app/controllers/ config/ lib/deltacloud/

Author: lutter
Date: Thu Jul  8 23:17:25 2010
New Revision: 962019

URL: http://svn.apache.org/viewvc?rev=962019&view=rev
Log:
Modified the SPI so that key/value pairs are used instead of arrays

Modified:
    incubator/deltacloud/trunk/framework/.gitignore
    incubator/deltacloud/trunk/framework/Rakefile
    incubator/deltacloud/trunk/framework/app/controllers/flavors_controller.rb
    incubator/deltacloud/trunk/framework/app/controllers/images_controller.rb
    incubator/deltacloud/trunk/framework/app/controllers/instances_controller.rb
    incubator/deltacloud/trunk/framework/app/controllers/storage_snapshots_controller.rb
    incubator/deltacloud/trunk/framework/app/controllers/storage_volumes_controller.rb
    incubator/deltacloud/trunk/framework/config/environment.rb
    incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb

Modified: incubator/deltacloud/trunk/framework/.gitignore
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/.gitignore?rev=962019&r1=962018&r2=962019&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/.gitignore (original)
+++ incubator/deltacloud/trunk/framework/.gitignore Thu Jul  8 23:17:25 2010
@@ -1,2 +1,3 @@
 log/*.log
 *.swp
+*.kpf

Modified: incubator/deltacloud/trunk/framework/Rakefile
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/Rakefile?rev=962019&r1=962018&r2=962019&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/Rakefile (original)
+++ incubator/deltacloud/trunk/framework/Rakefile Thu Jul  8 23:17:25 2010
@@ -9,4 +9,4 @@ require 'rake/rdoctask'
 
 require 'tasks/rails'
 
-require 'torquebox/tasks'
+#require 'torquebox/tasks'

Modified: incubator/deltacloud/trunk/framework/app/controllers/flavors_controller.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/controllers/flavors_controller.rb?rev=962019&r1=962018&r2=962019&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/controllers/flavors_controller.rb (original)
+++ incubator/deltacloud/trunk/framework/app/controllers/flavors_controller.rb Thu Jul  8 23:17:25 2010
@@ -16,7 +16,7 @@ class FlavorsController < ApplicationCon
   end
 
   def show
-    @flavor = driver.flavor( credentials, params[:id] )
+    @flavor = driver.flavor( credentials, :id => params[:id] )
     respond_to do |format|
       format.html
       format.json

Modified: incubator/deltacloud/trunk/framework/app/controllers/images_controller.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/controllers/images_controller.rb?rev=962019&r1=962018&r2=962019&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/controllers/images_controller.rb (original)
+++ incubator/deltacloud/trunk/framework/app/controllers/images_controller.rb Thu Jul  8 23:17:25 2010
@@ -9,7 +9,7 @@ class ImagesController < ApplicationCont
     if ( params[:owner].nil? ) 
       @images = driver.images( credentials )
     else
-      @images = driver.images( credentials, params[:owner] )
+      @images = driver.images( credentials, :owner => params[:owner] )
     end
 
     respond_to do |format|
@@ -22,7 +22,7 @@ class ImagesController < ApplicationCont
   end
 
   def show
-    @image = driver.image( credentials, params[:id] )
+    @image = driver.image( credentials, :id => params[:id]  )
 
     respond_to do |format|
       format.html

Modified: incubator/deltacloud/trunk/framework/app/controllers/instances_controller.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/controllers/instances_controller.rb?rev=962019&r1=962018&r2=962019&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/controllers/instances_controller.rb (original)
+++ incubator/deltacloud/trunk/framework/app/controllers/instances_controller.rb Thu Jul  8 23:17:25 2010
@@ -18,7 +18,7 @@ class InstancesController < ApplicationC
   end
 
   def show
-    @instance = driver.instance( credentials, params[:id] )
+    @instance = driver.instance( credentials, :id => params[:id] )
 
     respond_to do |format|
       format.html {
@@ -33,7 +33,7 @@ class InstancesController < ApplicationC
   end
 
   def destroy
-    driver.delete_instance( credentials, params[:id] )
+    driver.delete_instance( credentials, :id=> params[:id] )
     redirect_to :action=>:show
   end
 
@@ -42,12 +42,12 @@ class InstancesController < ApplicationC
                   :id=>params[:id],
                   :image_id=>params[:image_id],
                 } 
-    @image   = driver.image( credentials, params[:image_id] )
+    @image   = driver.image( credentials, :id => params[:image_id] )
     @flavors = driver.flavors_by_architecture( credentials, @image[:architecture] )
   end
 
   def create
-    @image   = driver.image( credentials, params[:image_id] )
+    @image   = driver.image( credentials, :id => params[:image_id] )
     if ( params[:flavor_id].nil? )
       @flavors = driver.flavors_by_architecture( credentials, @image[:architecture] )
       @instance = {

Modified: incubator/deltacloud/trunk/framework/app/controllers/storage_snapshots_controller.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/controllers/storage_snapshots_controller.rb?rev=962019&r1=962018&r2=962019&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/controllers/storage_snapshots_controller.rb (original)
+++ incubator/deltacloud/trunk/framework/app/controllers/storage_snapshots_controller.rb Thu Jul  8 23:17:25 2010
@@ -17,7 +17,7 @@ class StorageSnapshotsController < Appli
   end
 
   def show
-    @snapshot = driver.snapshot( credentials, params[:id] )
+    @snapshot = driver.snapshot( credentials, :id => params[:id] )
     respond_to do |format|
       format.html
       format.json

Modified: incubator/deltacloud/trunk/framework/app/controllers/storage_volumes_controller.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/app/controllers/storage_volumes_controller.rb?rev=962019&r1=962018&r2=962019&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/app/controllers/storage_volumes_controller.rb (original)
+++ incubator/deltacloud/trunk/framework/app/controllers/storage_volumes_controller.rb Thu Jul  8 23:17:25 2010
@@ -18,7 +18,7 @@ class StorageVolumesController < Applica
   end
 
   def show
-    @volume = driver.volume( credentials, params[:id] )
+    @volume = driver.volume( credentials, :id => params[:id] )
     respond_to do |format|
       format.html
       format.json

Modified: incubator/deltacloud/trunk/framework/config/environment.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/config/environment.rb?rev=962019&r1=962018&r2=962019&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/config/environment.rb (original)
+++ incubator/deltacloud/trunk/framework/config/environment.rb Thu Jul  8 23:17:25 2010
@@ -27,7 +27,7 @@ Rails::Initializer.run do |config|
   #config.gem "torquebox-gem"
 
   #config.gem "torquebox-rails"
-  config.gem "right_aws"
+  #config.gem "right_aws"
 
   # Only load the plugins named here, in the order given (default is alphabetical).
   # :all can be used as a placeholder for all plugins not explicitly named
@@ -51,7 +51,7 @@ Rails::Initializer.run do |config|
 end
 
 
-DRIVER=:mock
+DRIVER=:ec2
 
 DRIVER_ROOT = File.dirname( __FILE__ ) + "/../../deltacloud-driver-#{DRIVER}"
 $: << DRIVER_ROOT+'/lib'
@@ -61,5 +61,7 @@ case DRIVER
     DRIVER_CLASS_NAME = "MockDriver"
   when :ec2
     DRIVER_CLASS_NAME = "Ec2Driver"
+  when :rhevm
+    DRIVER_CLASS_NAME = "RHEVMDriver"
 end
 

Modified: incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb?rev=962019&r1=962018&r2=962019&view=diff
==============================================================================
--- incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb (original)
+++ incubator/deltacloud/trunk/framework/lib/deltacloud/base_driver.rb Thu Jul  8 23:17:25 2010
@@ -6,37 +6,37 @@ module DeltaCloud
 
   class BaseDriver
 
-    def flavor(credentials, id)
-      flavors = flavors(credentials, [id]) 
+    def flavor(credentials, opts)
+      flavors = flavors(credentials, opts)
       return flavors.first unless flavors.empty?
       nil
     end
 
     def flavors_by_architecture(credentials, architecture)
-      flavors(credentials).select{|f| f[:architecture] == architecture}
+      flavors(credentials, :architecture => architecture)
     end
 
 
-    def image(credentials, id)
-      images = images(credentials, [id])
+    def image(credentials, opts)
+      images = images(credentials, opts)
       return images.first unless images.empty?
       nil
     end
     
-    def instance(credentials, id)
-      instances = instances(credentials, [id])
+    def instance(credentials, opts)
+      instances = instances(credentials, opts)
       return instances.first unless instances.empty?
       nil
     end
 
-    def volume(credentials, id)
-      volumes = volumes(credentials, [id])
+    def volume(credentials, opts)
+      volumes = volumes(credentials, opts)
       return volumes.first unless volumes.empty?
       nil
     end
 
-    def snapshot(credentials, id)
-      snapshots = snapshots(credentials, [id])
+    def snapshot(credentials, opts)
+      snapshots = snapshots(credentials, opts)
       return snapshots.first unless snapshots.empty?
       nil
     end