Skip to content
Snippets Groups Projects
Commit 14c48f4f authored by baldwinlouie's avatar baldwinlouie
Browse files

git commit -m 'Issue #2995729 by baldwinlouie: launch time not being brought...

git commit -m 'Issue #2995729 by baldwinlouie: launch time not being brought back when refreshing aws ec2 instances'
parent 3cdf88f9
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,12 @@ interface InstanceInterface extends ContentEntityInterface, EntityOwnerInterface
/**
* {@inheritdoc}
*/
public function launched();
public function set_launch_time($launch_time);
/**
* {@inheritdoc}
*/
public function launch_time();
/**
* {@inheritdoc}
......
......@@ -235,8 +235,15 @@ class Instance extends CloudContentEntityBase implements InstanceInterface {
/**
* {@inheritdoc}
*/
public function launched() {
return $this->get('launched')->value;
public function set_launch_time($launch_time) {
return $this->set('launch_time', $launch_time);
}
/**
* {@inheritdoc}
*/
public function launch_time() {
return $this->get('launch_time')->value;
}
/**
......
......@@ -562,6 +562,7 @@ class AwsEc2Service implements AwsEc2ServiceInterface {
$entity->setInstanceState($instance['State']['Name']);
$entity->setElasticIp($instance['elastic_ip']);
$entity->setRefreshed($timestamp);
$entity->set_launch_time($instance['LaunchTime']->__toString());
$entity->save();
continue;
}
......@@ -597,6 +598,7 @@ class AwsEc2Service implements AwsEc2ServiceInterface {
'affinity' => $instance['affinity'],
'state_transition_reason' => $instance['StateTransitionReason'],
'instance_lock' => FALSE,
'launch_time' => $instance['LaunchTime']->__toString(),
'created' => strtotime($instance['LaunchTime']->__toString()),
'changed' => $timestamp,
'refreshed' => $timestamp,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment