You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/06/28 11:06:31 UTC
[2/9] git commit: Added start functionality to stopped EC2 instances
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 <da...@me.com>
Authored: Tue Apr 30 07:00:40 2013 -0400
Committer: marios <ma...@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 = {}