API Edit IP

From Virtualizor Wiki
Jump to: navigation, search
NOTE
This is OLD API Documentation. Click on the following link for New API Documentation
Admin API

Edit IP

Parameters Type Description
editip POST Flag to Edit IP
ip POST New IPv4 or IPv6 Address
mac_addr POST New MAC Address
ipid POST IP address id to be edited

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['editip'] = 'submit';
    $post['ip']       = 'xxxx:xxx:xxx:80a1:0000:0000:081f:3dcc';
    $post['mac_addr'] = 'aa:aa:aa:aa:aa:aa';
    $post['ipid']     = '3643';

    $output = $admin->editips($post);
    print_r($output);
?>

Returns:

Array
(
    [title] => Edit IPs
    [done] => 1
    [ippools] => Array
        (
            [0] => Array
                (
                    [ippid] => 0
                    [ippool_name] => None
                    [gateway] => 
                    [netmask] => 
                    [ns1] => 
                    [ns2] => 
                )

            [248] => Array
                (
                    [ippid] => 248
                    [ipp_serid] => 0
                    [ippool_name] => poolv6
                    [gateway] => fe80::1
                    [netmask] => 64
                    [ns1] => 8.8.8.8
                    [ns2] => 8.8.4.4
                    [ipv6] => 1
                    [nat] => 0
                    [nat_name] => 
                    [routing] => 0
                )

        )

    [ip] => Array
        (
            [ipid] => 3643
            [ippid] => 248
            [ip_serid] => 0
            [vpsid] => 0
            [ip] => 2a01:4f8:160:80a1:0000:0000:081f:3dcc
            [ipv6] => 1
            [primary] => 0
            [mac_addr] => 
            [ipp_serid] => 0
            [ippool_name] => poolv6
            [gateway] => fe80::1
            [netmask] => 64
            [ns1] => 8.8.8.8
            [ns2] => 8.8.4.4
            [nat] => 0
            [nat_name] => 
            [routing] => 0
        )

    [ipid] => 3643
    [timenow] => 1403077345
    [time_taken] => 0.016
)