From: marios <[email protected]>
definition of the launch_time attribute is now placed in the Instance class
itself (rather than in a given driver that wishes to use it).
---
server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 3 ++-
.../drivers/rimuhosting/rimuhosting_driver.rb | 3 ++-
server/lib/deltacloud/models/instance.rb | 2 +-
server/views/instances/show.html.haml | 5 +++++
server/views/instances/show.xml.haml | 3 +++
5 files changed, 13 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..0f4e128 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -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..6972d64 100755
--- a/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb
+++ b/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb
@@ -119,7 +119,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/lib/deltacloud/models/instance.rb
b/server/lib/deltacloud/models/instance.rb
index d313bc7..60a2e8a 100644
--- a/server/lib/deltacloud/models/instance.rb
+++ b/server/lib/deltacloud/models/instance.rb
@@ -27,7 +27,7 @@ class Instance < BaseModel
attr_accessor :public_addresses
attr_accessor :private_addresses
attr_accessor :instance_profile
-
+ attr_accessor :launch_time
def initialize(init=nil)
super(init)
self.actions = [] if self.actions.nil?
diff --git a/server/views/instances/show.html.haml
b/server/views/instances/show.html.haml
index f27dcb7..27a8d29 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
+ - unless @instance.launch_time.nil?
+ %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..bab150b 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
+ - unless @instance.launch_time.nil?
+ %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