incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1039289 - in /incubator/deltacloud/trunk/server/lib/deltacloud: base_driver/features.rb drivers/ec2/ec2_driver.rb
Date Fri, 26 Nov 2010 09:58:49 GMT
Author: mfojtik
Date: Fri Nov 26 09:58:49 2010
New Revision: 1039289

URL: http://svn.apache.org/viewvc?rev=1039289&view=rev
Log:
Expose security_group feature for ec2.

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

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/features.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/features.rb?rev=1039289&r1=1039288&r2=1039289&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/features.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/features.rb Fri Nov 26 09:58:49
2010
@@ -143,6 +143,14 @@ module Deltacloud
       end
     end
 
+    declare_feature :instances, :security_group do
+      description "Put instance in one or more security groups on launch"
+      operation :create do
+        param :security_group, :array, :optional, nil,
+        "Array of security group names"
+      end
+    end
+
     declare_feature :instances, :authentication_key do
       operation :create do
         param :keyname, :string,  :optional, nil

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb?rev=1039289&r1=1039288&r2=1039289&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb Fri Nov 26
09:58:49 2010
@@ -33,6 +33,7 @@ class EC2Driver < Deltacloud::BaseDriver
 
   feature :instances, :user_data
   feature :instances, :authentication_key
+  feature :instances, :security_group
   feature :images, :owner_id
   feature :buckets, :bucket_location
   feature :instances, :register_to_load_balancer
@@ -183,7 +184,8 @@ class EC2Driver < Deltacloud::BaseDriver
         :monitoring_enabled => true,
         :instance_type => hwp.name,
         :disable_api_termination => false,
-        :instance_initiated_shutdown_behavior => 'terminate'
+        :instance_initiated_shutdown_behavior => 'terminate',
+        :security_group => opts[:security_group]
       )
       new_instance = convert_instance( ec2_instances.instancesSet.item.first, 'pending' )
       if opts[:load_balancer_id] and opts[:load_balancer_id]!=""



Mime
View raw message