API List Plans

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 Plans


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->plans(1,20);
    
    print_r($output);

?>

Returns:

Array
(
    [title] => Plans
    [plans] => Array
        (
            [5] => Array
                (
                    [plid] => 5
                    [plan_name] => xen
                    [virt] => xen
                    [ips] => 3
                    [space] => 10
                    [inodes] => 0
                    [ram] => 1204
                    [burst] => 0
                    [swap] => 1024
                    [cpu] => 1000
                    [cores] => 4
                    [cpu_percent] => 100.00
                    [bandwidth] => 0
                    [network_speed] => 0
                    [nic_type] => 
                    [io] => 0
                    [virtio] => 0
                    [ubc] => 
                )

            [4] => Array
                (
                    [plid] => 4
                    [plan_name] => openVZ
                    [virt] => openvz
                    [ips] => 1
                    [space] => 10
                    [inodes] => 0
                    [ram] => 1024
                    [burst] => 0
                    [swap] => 0
                    [cpu] => 1000
                    [cores] => 4
                    [cpu_percent] => 100.00
                    [bandwidth] => 0
                    [network_speed] => 0
                    [nic_type] => 
                    [io] => 3
                    [virtio] => 0
                    [ubc] => 
                )

            [6] => Array
                (
                    [plid] => 6
                    [plan_name] => kvm
                    [virt] => kvm
                    [ips] => 3
                    [space] => 100
                    [inodes] => 0
                    [ram] => 1024
                    [burst] => 0
                    [swap] => 1024
                    [cpu] => 1000
                    [cores] => 4
                    [cpu_percent] => 100.00
                    [bandwidth] => 0
                    [network_speed] => 0
                    [nic_type] => 
                    [io] => 0
                    [virtio] => 0
                    [ubc] => 
                )

            [7] => Array
                (
                    [plid] => 7
                    [plan_name] => kvm2
                    [virt] => kvm
                    [ips] => 1
                    [space] => 10
                    [inodes] => 0
                    [ram] => 1024
                    [burst] => 0
                    [swap] => 1024
                    [cpu] => 1000
                    [cores] => 4
                    [cpu_percent] => 100.00
                    [bandwidth] => 0
                    [network_speed] => 0
                    [nic_type] => 
                    [io] => 0
                    [virtio] => 0
                    [ubc] => 
                )

            [8] => Array
                (
                    [plid] => 8
                    [plan_name] => kvm3
                    [virt] => kvm
                    [ips] => 1
                    [space] => 10
                    [inodes] => 0
                    [ram] => 1024
                    [burst] => 0
                    [swap] => 1024
                    [cpu] => 1000
                    [cores] => 4
                    [cpu_percent] => 100.00
                    [bandwidth] => 0
                    [network_speed] => 0
                    [nic_type] => 
                    [io] => 0
                    [virtio] => 0
                    [ubc] => 
                )

            [11] => Array
                (
                    [plid] => 11
                    [plan_name] => apitest
                    [virt] => openvz
                    [ips] => 5
                    [space] => 5
                    [inodes] => 0
                    [ram] => 5
                    [burst] => 5
                    [swap] => 0
                    [cpu] => 5
                    [cores] => 5
                    [cpu_percent] => 5.00
                    [bandwidth] => 5
                    [network_speed] => 512
                    [nic_type] => 
                    [io] => 6
                    [virtio] => 0
                    [ubc] => 
                )

        )

    [timenow] => 1403245469
    [time_taken] => 0.016
)