Use the Delete DNS Plan API to delete the DNS plan present on the Virtualizor panel, passing the plan ID. Multiple plans can be deleted by passing the plan IDs as comma separated values. The API response will contain "done" as the array DNS plans on success.
HTTP Request
https://hostname:4085/index.php?act=dnsplans
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | dnsplans | The action specified to perform operation | Yes |
delete | POST | Int | ID of the DNS Plan. For deleting multiple DNS plans, pass in the IDs as comma separated values | 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);
$post = array();
$post['delete'] = 4;
$post['delete'] = '4,5'; // for deleting multiple plans
$output = $admin->delete_dnsplans($post);
print_r(json_encode($output));
?>
Output
{
"title": "DNS Plans",
"done": {
"4": {
"dnsplid": "4",
"pdnsid": "10",
"plan_name": "test4",
"max_domains": "1000",
"max_domain_records": "1999",
"def_ttl": "10000"
},
"5": {
"dnsplid": "5",
"pdnsid": "10",
"plan_name": "test5",
"max_domains": "1000",
"max_domain_records": "1999",
"def_ttl": "10000"
}
},
"dnsplans": null,
"timenow": 1535719165,
"time_taken": "0.230"
}