incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/4] Updated client to support credentials
Date Tue, 03 Aug 2010 12:26:29 GMT
---
 client/lib/deltacloud.rb |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/client/lib/deltacloud.rb b/client/lib/deltacloud.rb
index ead3fe5..c9c39cd 100644
--- a/client/lib/deltacloud.rb
+++ b/client/lib/deltacloud.rb
@@ -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]
-- 
1.7.2


Mime
View raw message