add get dns record id method, test

This commit is contained in:
Michael
2019-05-25 22:10:36 -05:00
parent fab0bc7a12
commit 246925dec2
3 changed files with 57 additions and 0 deletions

View File

@@ -125,6 +125,15 @@ class DNS implements API
return $this->body->result;
}
public function getRecordID(string $zoneID, string $type = '', string $name = ''): string
{
$records = $this->listRecords($zoneID, $type, $name);
if (isset($records->result{0}->id)) {
return $records->result{0}->id;
}
return false;
}
public function updateRecordDetails(string $zoneID, string $recordID, array $details): \stdClass
{
$response = $this->adapter->put('zones/' . $zoneID . '/dns_records/' . $recordID, $details);