Get Virtualizor

Delete DNS Server

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

NameMethodValueDescriptionRequired
actGETpdnsThe action will return done as the information of pdns server that is deletedYes
deletePOSTIntThe pdns server ID that needs to be deletedYes
reslenGETIntNumber of records to be returned, default is 50Yes
pageGETIntPage number, each page show 50 recordsYes

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"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list