API Add DNS Plan

From Virtualizor Wiki
Jump to: navigation, search

Add DNS Plan

Parameters Type Description
adddnsplan POST Flag to Add DNS Plan
plan_name POST Name of the Plan
dnsserverid POST Id of DNS Server on which plan is to be created
maxdomains POST Maximum number of Domains
maxdomainsrec. POST Maximum number of Records for Domain
ttl POST Time To Live value

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['adddnsplan'] = 1;
    $post['plan_name'] = 'apitest';
    $post['dnsserverid'] = 1;
    $post['maxdomains'] = 10;
    $post['maxdomainsrec'] = 5;
    $post['ttl'] = 10;
	
    $output = $admin->adddnsplan($post);
?>

Returns:

Array
(
    [title] => Add DNS Plan
    [done] => TRUE;
    [error] => 
    [timenow] => 1431427114
    [time_taken] => 0.140
)