Use the Delete Plans API to delete the plans from the Virtualizor panel by passing the plan ID. The plan ID can be obtain from the list plan API. For deleting multiple plans you can pass in the plan IDs as comma separated values. The API response will contain "done" as the details of the deleted plans after the plan has been deleted successfully.
HTTP Request
https://hostname:4085/index.php?act=plans&delete=PLID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | plans | The action will list the plans after deleting the specified plans. | Yes |
delete | POST | Int | The plan ID that needs to be deleted, for multiple plans you need to pass the IDs as comma separated values | Yes |
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);
$post = array();
$post['delete'] = 2;
$post['delete'] = '2,3'; // for deleting multiple plans
$output = $admin->delete_plans($post);
print_r(json_encode($output));
?>
Output
{
"title": "Plans",
"done": {
"2": {
"plid": "2",
"plan_name": "Api Plan",
"virt": "kvm",
"ips": "0",
"ips6": "0",
"ips6_subnet": "0",
"ips_int": "0",
"space": "1",
"inodes": "0",
"ram": "128",
"burst": "0",
"swap": "128",
"cpu": "0",
"cores": "2",
"cpu_percent": "0.00",
"bandwidth": "0",
"network_speed": "0",
"upload_speed": "0",
"nic_type": "",
"io": "0",
"virtio": "0",
"ubc": "a:0:{}",
"ploop": "0",
"band_suspend": "0",
"dns_nameserver": "a:0:{}",
"ppp": "0",
"tuntap": "0",
"control_panel": "",
"mgs": "",
"cpu_mode": "",
"sec_iso": "",
"hvm": "0",
"kvm_cache": "",
"io_mode": "",
"osreinstall_limit": "0",
"total_iops_sec": "0",
"read_bytes_sec": "0",
"write_bytes_sec": "0",
"vnc_keymap": "",
"osid": "0",
"kvm_vga": "0",
"acceleration": "0",
"vif_type": "",
"pv_on_hvm": "0",
"iso": "",
"vnc": "0",
"admin_managed": "0",
"shadow": "0",
"acpi": "0",
"apic": "0",
"pae": "0",
"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"
}
},
"plans": null,
"timenow": 1535713467,
"time_taken": "0.207"
}