diff --git a/src/HPCloud/Services/DBaaS/InstanceDetails.php b/src/HPCloud/Services/DBaaS/InstanceDetails.php index 74da4b2..74b3827 100644 --- a/src/HPCloud/Services/DBaaS/InstanceDetails.php +++ b/src/HPCloud/Services/DBaaS/InstanceDetails.php @@ -58,6 +58,10 @@ class InstanceDetails { $o->password = $json['credential']['password']; } + if (!empty($json['name'])) { + $o->name = $json['name']; + } + return $o; } @@ -138,8 +142,8 @@ class InstanceDetails { * is returned. * * @attention - * In version 1.0 of the DBaaS protocol, this is ONLY available immediately - * after creation or from the results of an Instance::describe() call. + * In version 1.0 of the DBaaS protocol, this is ONLY available after the + * DB instance has been brought all the way up. * * This returns the DNS name of the host (or possibly an IP address). * diff --git a/test/Tests/DBaaSInstanceTest.php b/test/Tests/DBaaSInstanceTest.php index d8be918..6ea0e38 100644 --- a/test/Tests/DBaaSInstanceTest.php +++ b/test/Tests/DBaaSInstanceTest.php @@ -68,7 +68,8 @@ class DBaaSInstanceTest extends DBaaSTestCase { $this->assertNotEmpty($details->username()); $this->assertNotEmpty($details->password()); $this->assertNotEmpty($details->id()); - $this->assertNotEmpty($details->hostname()); + // This is now no longer returned from a create(). + //$this->assertNotEmpty($details->hostname()); $this->assertNotEmpty($details->createdOn()); $this->assertEquals($dbName, $details->name()); @@ -101,7 +102,8 @@ class DBaaSInstanceTest extends DBaaSTestCase { $this->assertEmpty($details->username()); $this->assertEmpty($details->password()); - $this->assertNotEmpty($details->hostname()); + // This is no longer available until after the server is up. + //$this->assertNotEmpty($details->hostname()); $this->assertNotEmpty($details->createdOn()); $this->assertEquals($db->id(), $details->id());