Add first-class hosting subdomain create/attach in Domains panel.
Deploy Ladill Hosting / deploy (push) Successful in 1m9s
Deploy Ladill Hosting / deploy (push) Successful in 1m9s
Customers can create label-based subdomains under primary/addon sites with a separate max_domains×5 quota, nginx/docroot/SSL provisioning, and managed DNS A records when Ladill controls the parent zone. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -151,6 +151,40 @@ class PowerDnsClient
|
||||
return ['status' => 'updated', 'count' => count($rrsets)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete specific name+type rrsets from an existing zone (best-effort).
|
||||
*
|
||||
* @param string $zoneName
|
||||
* @param array<int, array{name: string, type?: string}> $records
|
||||
*/
|
||||
public function deleteRecords(string $zoneName, array $records): array
|
||||
{
|
||||
if ($records === []) {
|
||||
return ['status' => 'noop'];
|
||||
}
|
||||
|
||||
$zoneName = rtrim($zoneName, '.').'.';
|
||||
|
||||
$rrsets = array_map(function (array $record): array {
|
||||
return [
|
||||
'name' => rtrim($record['name'], '.').'.',
|
||||
'type' => strtoupper($record['type'] ?? 'A'),
|
||||
'changetype' => 'DELETE',
|
||||
'records' => [],
|
||||
];
|
||||
}, $records);
|
||||
|
||||
$response = $this->httpClient()->patch("servers/{$this->server()}/zones/{$zoneName}", [
|
||||
'rrsets' => $rrsets,
|
||||
]);
|
||||
|
||||
if ($response->failed() && $response->status() !== 404) {
|
||||
$response->throw();
|
||||
}
|
||||
|
||||
return ['status' => 'deleted', 'count' => count($rrsets)];
|
||||
}
|
||||
|
||||
public function deleteZone(Domain $domain): void
|
||||
{
|
||||
$zoneName = $this->zoneName($domain);
|
||||
|
||||
Reference in New Issue
Block a user