Use the Delete DNS Server API to delete the PowerDNS server information from the node. The API response will contain "done" as the information of the deleted server on success.
Only the information of the PowerDNS server will be deleted, the server cannot be deleted using this API.
HTTP Request
https://hostname:4085/index.php?act=pdns
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | pdns | The action will return done as the information of pdns server that is deleted | Yes |
delete | POST | Int | The pdns server ID that needs to be deleted | Yes |
reslen | GET | Int | Number of records to be returned, default is 50 | Yes |
page | GET | Int | Page number, each page show 50 records | Yes |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass);
$page = 1;
$reslen = 20;
$post = array();
$post['delete'] = 15;
$output = $admin->pdns($page, $reslen,$post);
print_r(json_encode($output));
?>
Output
{
"title": "Power DNS",
"done": {
"15": {
"id": "15",
"name": "api-test",
"description": "apidesc",
"sql_ipaddress": "127.0.5.5",
"sql_port": "3306",
"sql_username": "user",
"sql_password": "sql_password",
"sql_database": "apidb",
"use_ssl": "1",
"encrypt_sql_pass": "1",
"salt": "vz8lkq9o"
}
},
"pdns": "null",
"timenow": "1480655312",
"time_taken": "0.112"
}