deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1214350 - /deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
Date Wed, 14 Dec 2011 17:17:08 GMT
Author: marios
Date: Wed Dec 14 17:17:08 2011
New Revision: 1214350

URL: http://svn.apache.org/viewvc?rev=1214350&view=rev
Log:
Add fetching of EC2 regions via API call (for drivers collection)

Modified:
    deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb

Modified: deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb?rev=1214350&r1=1214349&r2=1214350&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb (original)
+++ deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb Wed Dec 14 17:17:08 2011
@@ -695,6 +695,12 @@ module Deltacloud
           end
         end
 
+        def providers(credentials, opts={})
+          ec2 = new_client(credentials)
+          providers = ec2.describe_regions.map{|r| Provider.new( {:id=>r, :name=>r,
+           :url=>"#{ENV['API_HOST']}:#{ENV['API_PORT']}#{settings.root_url}\;provider=#{r}"
}) }
+        end
+
         def valid_credentials?(credentials)
           retval = true
           begin



Mime
View raw message