incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r982189 - /incubator/deltacloud/trunk/client/lib/deltacloud.rb
Date Wed, 04 Aug 2010 10:18:26 GMT
Author: mfojtik
Date: Wed Aug  4 10:18:25 2010
New Revision: 982189

URL: http://svn.apache.org/viewvc?rev=982189&view=rev
Log:
Updated client to support credentials

Modified:
    incubator/deltacloud/trunk/client/lib/deltacloud.rb

Modified: incubator/deltacloud/trunk/client/lib/deltacloud.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/lib/deltacloud.rb?rev=982189&r1=982188&r2=982189&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/lib/deltacloud.rb (original)
+++ incubator/deltacloud/trunk/client/lib/deltacloud.rb Wed Aug  4 10:18:25 2010
@@ -240,6 +240,17 @@ module DeltaCloud
       end
       declare_entry_points_methods(@entry_points)
     end
+    
+    def create_instance_credential(opts={}, &block)
+      params = { :name => opts[:name] }
+      instance_credential = nil
+      request(:post, entry_points[:instance_credentials], {}, params) do |response|
+        c = DeltaCloud.define_class("InstanceCredential")
+        instance_credential = base_object(c, :instance_credential, response)
+        yield instance_credential if block_given?
+      end
+      return instance_credential
+    end
 
     # Create a new instance, using image +image_id+. Possible optiosn are
     #
@@ -255,11 +266,13 @@ module DeltaCloud
       name = opts[:name]
       realm_id = opts[:realm]
       user_data = opts[:user_data]
+      key_name = opts[:key_name]
 
       params = {}
       ( params[:realm_id] = realm_id ) if realm_id
       ( params[:name] = name ) if name
       ( params[:user_data] = user_data ) if user_data
+      ( params[:keyname] = user_data ) if key_name
 
       if opts[:hardware_profile].is_a?(String)
         params[:hwp_id] = opts[:hardware_profile]



Mime
View raw message