Use the List Plans API to list all the plans that are created on the Virtualizor panel. Plans help facilitate the creation of Virtual Private Servers on your server. The API response contains all the information of the plans which are listed according to their IDs. To filter or limit the size of the list, you can specify one or more query parameters.
HTTP Request
https://hostname:4085/index.php?act=plans
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | plans | The action specified to list all vps plans | Yes |
page | POST | Int | If not specified then first 50 records would be returned | No |
reslen | POST | Int | Number of records to be returned, default is 50 | No |
planname | POST | text | Will Search plans according to the plan name | No |
ptype | POST | text | Will search according to the plan type (kvm, openvz, xen, xcp, lxc, vzo, vzk) | No |
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['planname'] = 'Dummy';
$post['ptype'] = 'kvm' ;
$output = $admin->plans($page,$reslen,$post);
print_r(json_encode($output));
?>
Output
{
"title": "Plans",
"plans": {
"1": {
"plid": "1",
"plan_name": "Dummy",
"virt": "kvm",
"ips": "1",
"ips6": "0",
"ips6_subnet": "0",
"ips_int": "0",
"space": "2",
"inodes": "0",
"ram": "128",
"burst": "0",
"swap": "128",
"cpu": "1000",
"cores": "1",
"cpu_percent": "0.00",
"bandwidth": "1",
"network_speed": "0",
"upload_speed": "-1",
"nic_type": "virtio",
"io": "0",
"virtio": "0",
"ubc": "a:0:{}",
"ploop": "0",
"band_suspend": "0",
"dns_nameserver": "a:0:{}",
"ppp": "0",
"tuntap": "0",
"control_panel": "0",
"mgs": "",
"cpu_mode": "default",
"sec_iso": "",
"hvm": "0",
"kvm_cache": "0",
"io_mode": "0",
"osreinstall_limit": "0",
"total_iops_sec": "0",
"read_bytes_sec": "0",
"write_bytes_sec": "0",
"vnc_keymap": "en-us",
"osid": "270",
"kvm_vga": "0",
"acceleration": "0",
"vif_type": "",
"pv_on_hvm": "0",
"iso": "",
"vnc": "1",
"admin_managed": "0",
"shadow": "0",
"acpi": "1",
"apic": "1",
"pae": "1",
"recipe": "0",
"topology_sockets": "0",
"topology_cores": "0",
"topology_threads": "0",
"disable_nw_config": "0",
"rdp": "0",
"openvz_features": "a:7:{s:4:\"fuse\";i:0;s:4:\"ipip\";i:0;s:5:\"ipgre\";i:0;s:3:\"nfs\";i:0;s:14:\"quotaugidlimit\";i:0;s:7:\"iolimit\";i:0;s:9:\"iopslimit\";i:0;}",
"speed_cap": "",
"numa": "0",
"bpid": "0",
"install_xentools": "0",
"ippoolid": "",
"is_enabled": "1"
}
},
"timenow": 1535713000,
"time_taken": "0.207"
}