DNS-Eintrag aktualisieren
updateDnsRecord()
Wird ausgeführt, wenn ein Kunde im Storefront einen DNS-Eintrag anlegt.
Parameter
Typ | Name | Beschreibung |
|---|---|---|
IpamRdnsHost | $ipamRdnsHost, | Der DNS-Host |
String | $zoneName | Der Zonenname |
DnsRecordItem | $originalDnsRecord | Der DNS-Eintrag VORHER |
DnsRecordItem | $updatedDnsRecord | Der neue, aktualisierte DNS-Eintrag. |
Antwort
Keine Antwort.
Das Auslösen einer Exception() zeigt eine allgemeine Fehlermeldung an: Das Auslösen einer StorefrontException() zeigt dem Kunden die genaue Meldung an.
Beispielcode
public function updateDnsRecord(IpamRdnsHost $ipamRdnsHost, string $zoneName, DnsRecordItem $originalDnsRecord, DnsRecordItem $updatedDnsRecord) {
$zoneName = $this->getZoneName($zoneName, $ipamRdnsHost);
try {
$this->_sendRequest($ipamRdnsHost, "zones/{$zoneName}/dns_records/{$originalDnsRecord->id}", "PUT", [
"content" => $updatedDnsRecord->content,
"name" => $updatedDnsRecord->hostname,
"type" => $updatedDnsRecord->type,
"ttl" => $updatedDnsRecord->ttl,
]);
} catch (ClientException $e) {
throw new Exception($this->_getErrorMessage($e));
}
}Testen
Du kannst diese Funktion testen, indem Du als Kunde einen DNS-Eintrag aktualisierst.
War das hilfreich?