if ($_GET['action'] == 'get_domain_id') { if (!empty($_GET['domain'])) { if ($PowerDNS->isValidDomain($_GET['domain'])) { $response = $PowerDNS->getDomainID($_GET['domain']); $output = json_encode($response); } else { $output = json_encode(array("status" => "error", "msg" => "Invalid Domain.")); } } else { $output = json_encode(array("status" => "error", "msg" => "Missing data for get_domain_id.")); } } // Add Record if ($_GET['action'] == 'add_record') { if (!empty($_GET['domain_id']) && !empty($_GET['name']) && !empty($_GET['type']) && !empty($_GET['content']) && !empty($_GET['ttl'])) { $response = $PowerDNS->addRecord($_GET['domain_id'], $_GET['name'], $_GET['type'], $_GET['content'], $_GET['ttl'], $_GET['prio']); $output = json_encode($response); } else { $output = json_encode(array("status" => "error", "msg" => "Missing data for add_record.")); } } // Delete Record if ($_GET['action'] == 'delete_record') { if (!empty($_GET['record_id'])) { $response = $PowerDNS->deleteRecord($_GET['record_id']); $output = json_encode($response); } else { $output = json_encode(array("status" => "error", "msg" => "Missing data for delete_record.")); } } // Get Domains by SolusVM Container ID