From: marios <[email protected]>
---
server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 5 +++--
.../drivers/rimuhosting/rimuhosting_driver.rb | 7 ++++++-
server/views/instances/show.html.haml | 5 +++++
server/views/instances/show.xml.haml | 3 +++
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 076bfc4..b49c5e5 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -22,7 +22,7 @@ require 'AWS'
class Instance
attr_accessor :keyname
attr_accessor :authn_error
-
+ attr_accessor :launch_time
def authn_feature_failed?
return true unless authn_error.nil?
end
@@ -297,7 +297,8 @@ class EC2Driver < Deltacloud::BaseDriver
:private_addresses=>( ec2_instance['privateDnsName'] == '' ? [] :
[ec2_instance['privateDnsName']] ),
:instance_profile =>InstanceProfile.new(hwp_name),
:actions=>instance_actions_for( state ),
- :keyname => ec2_instance['keyName']
+ :keyname => ec2_instance['keyName'],
+ :launch_time => ec2_instance['launchTime']
} )
instance.authn_error = "Key not set for instance" unless
ec2_instance['keyName']
return instance
diff --git a/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb
b/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb
index 2b0002b..2756805 100755
--- a/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb
+++ b/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb
@@ -19,6 +19,10 @@
require "deltacloud/base_driver"
require "deltacloud/drivers/rimuhosting/rimuhosting_client"
+class Instance
+ attr_accessor :launch_time
+end
+
module Deltacloud
module Drivers
module RimuHosting
@@ -119,7 +123,8 @@ class RimuHostingDriver < Deltacloud::BaseDriver
:owner_id => "root",
:instance_profile => InstanceProfile.new("none"),
:actions => instance_actions_for("RUNNING"),
- :public_addresses => inst["allocated_ips"]["primary_ip"]
+ :public_addresses => inst["allocated_ips"]["primary_ip"],
+ :launch_time => inst["billing_info"]["order_date"]["iso_format"]
})
end
diff --git a/server/views/instances/show.html.haml
b/server/views/instances/show.html.haml
index f27dcb7..8d88036 100644
--- a/server/views/instances/show.html.haml
+++ b/server/views/instances/show.html.haml
@@ -36,6 +36,11 @@
%dt Private Addresses
%dd
= @instance.private_addresses.collect { |address|
"<div>#{address}</div>" }.join
+ - if @instance.instance_variables.include?("@launch_time")
+ %di
+ %dt Launch Time
+ %dd
+ = @instance.launch_time
%di
%dt
%dd
diff --git a/server/views/instances/show.xml.haml
b/server/views/instances/show.xml.haml
index cfe5e80..d4b6962 100644
--- a/server/views/instances/show.xml.haml
+++ b/server/views/instances/show.xml.haml
@@ -26,6 +26,9 @@
- @instance.private_addresses.each do |address|
%address<
=address
+ - if @instance.instance_variables.include?("@launch_time")
+ %launch-time<
+ [email protected]_time
- if driver_has_auth_features?
%authentication{ :type => driver_auth_feature_name }
- if @instance.authn_feature_failed?
--
1.6.6.1
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel