API List IPs

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

Get list of IPs


Parameters Description
page_number If not specified, then only first 50 records are returned
count Number of records to be returned, default is 50

Example Code:

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

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

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

    $output = $admin->ips(1, 25);
    
    print_r($output);

?>

Returns:

Array
(
    [title] => IP List
    [ips] => Array
        (
            [3713] => Array
                (
                    [ipid] => 3713
                    [ippid] => 
                    [ip_serid] => 1
                    [vpsid] => 0
                    [ip] => 1.1.1.2
                    [ipv6] => 
                    [primary] => 1
                    [mac_addr] => 
                    [ipp_serid] => 
                    [ippool_name] => 
                    [gateway] => 
                    [netmask] => 
                    [ns1] => 
                    [ns2] => 
                    [nat] => 
                    [nat_name] => 
                    [routing] => 
                    [hostname] => 
                )

            [3711] => Array
                (
                    [ipid] => 3711
                    [ippid] => 
                    [ip_serid] => 1
                    [vpsid] => 0
                    [ip] => 192.168.11.4
                    [ipv6] => 
                    [primary] => 0
                    [mac_addr] => 
                    [ipp_serid] => 
                    [ippool_name] => 
                    [gateway] => 
                    [netmask] => 
                    [ns1] => 
                    [ns2] => 
                    [nat] => 
                    [nat_name] => 
                    [routing] => 
                    [hostname] => 
                )

            [3712] => Array
                (
                    [ipid] => 3712
                    [ippid] => 
                    [ip_serid] => 1

                    .
                    .
                    .
                    .

    [timenow] => 1400147182
    [time_taken] => 0.090
)