deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/9] git commit: Added start functionality to stopped EC2 instances
Date Fri, 28 Jun 2013 09:06:31 GMT
Added start functionality to stopped EC2 instances


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/eb329da1
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/eb329da1
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/eb329da1

Branch: refs/heads/master
Commit: eb329da1b5c7f9f17f80c6ae70da1e1d5c0d15b1
Parents: 4d62d3c
Author: David Ellinger <david.ellinger@me.com>
Authored: Tue Apr 30 07:00:40 2013 -0400
Committer: marios <marios@redhat.com>
Committed: Fri Jun 28 12:05:49 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/eb329da1/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index b740254..f462b37 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -297,6 +297,16 @@ module Deltacloud
           end
         end
 
+
+        def start_instance(credentials, instance_id)
+          ec2 = new_client(credentials)
+          if ec2.start_instances([instance_id])
+            instance(credentials, :id => instance_id)
+          else
+            raise Deltacloud::BackendError.new(500, "Instance", "Instance start failed",
"")
+          end
+        end
+
         def run_on_instance(credentials, opts={})
           target = instance(credentials, :id => opts[:id])
           param = {}


Mime
View raw message