Delete DNS Plans

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

NameMethodValueDescriptionRequired
actGETdnsplansThe action specified to perform operationYes
deletePOSTIntID of the DNS Plan. For deleting multiple DNS plans, pass in the IDs as comma separated valuesYes

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"
}
Was this helpful to you?