Use the Delete Server API to unslave the slave server from your master server by passing the ID of the slave server.
HTTP Request
https://hostname:4085/index.php?act=servers&delete=SERID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | servers | The action specified to perform the operation | Yes |
delete | POST | Int | The server ID which needs to be deleted | 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);
$del_serid = 2;
$output = $admin->servers($del_serid);
print_r(json_encode($output));
?>
Output
{
"title": "Servers",
"servs": [{
"serid": "0",
"sgid": "0",
"server_name": "localhost",
"virt": "kvm openvz",
"ip": "127.0.0.1",
"internal_ip": "",
"vnc_ip": "",
"settings": "a:30:{s:6:\"update\";i:1;s:12:\"email_update\";i:1;s:17:\"novnc_server_name\";i:1;s:6:\"cpu_nm\";i:1;s:10:\"soft_email\";s:21:\"test@test.com\";s:8:\"timezone\";s:1:\"1\";s:9:\"interface\";s:4:\"eth0\";s:16:\"alert_load_limit\";i:0;s:16:\"alert_disk_limit\";i:0;s:7:\"ping_ip\";s:0:\"\";s:16:\"enable_tuntap_cp\";i:0;s:13:\"enable_ppp_cp\";i:1;s:14:\"addvs_cpu_prio\";s:0:\"\";s:13:\"addvs_io_prio\";s:0:\"\";s:14:\"addvs_io_class\";s:0:\"\";s:5:\"vswap\";i:1;s:5:\"ploop\";i:0;s:14:\"node_bandwidth\";i:100;s:17:\"disable_backup_cp\";i:0;s:20:\"del_slave_ostemplate\";i:0;s:19:\"openvz_suspend_load\";d:0;s:9:\"cron_time\";s:11:\"18 16 * * 3\";s:14:\"emps_cron_time\";s:11:\"18 16 * * 3\";s:11:\"cookie_name\";s:14:\"SIMCookies3081\";s:8:\"vpslimit\";s:3:\"200\";s:10:\"overcommit\";i:0;s:6:\"vnc_ip\";s:0:\"\";s:15:\"change_ssh_port\";i:2044;s:13:\"max_ssh_login\";i:20;s:6:\"vcores\";i:0;}",
"unique_txt": "",
"lv": "",
"hvm": "0",
"licnumvs": "0",
"total_ram": "15912",
"overcommit": "0",
"ram": "6407",
"total_space": "909",
"space": "186",
"os": "CentOS release 6.7 (Final)",
"os_arch": "x86_64",
"uname": "Linux hostname 2.6.32-042stab108.8 #1 SMP Wed Jul 22 17:23:23 MSK 2015 x86_64 x86_64 x86_64 GNU\/Linux",
"version": "2.8.7",
"patch": "4",
"lic_expires": "28\/12\/2016 GMT",
"checked": "1474851663",
"locked": "0",
"vcores": "29",
"ips": "18490",
"ipv6": "97",
"ipv6_subnet": "93",
"ips_int": "28",
"bandwidth": "0",
"update_resource": "0",
"location": "{\"city\":\"Atlanta\",\"state\":\"Georgia\",\"country_code\":\"US\"}",
"numvps": "8",
"alloc_ram": "17584",
"alloc_space": "149",
"alloc_cpu": "7144",
"alloc_cpu_percent": "100.00",
"alloc_bandwidth": "4",
"virts": ["kvm", "openvz"]
}, {
"serid": "1",
"sgid": "15",
"server_name": "KVM Slave: ip_addr",
"virt": "kvm",
"ip": "ip_addr",
"internal_ip": "",
"vnc_ip": "ip_addr",
"settings": "a:25:{s:6:\"update\";i:1;s:12:\"email_update\";i:1;s:17:\"novnc_server_name\";i:1;s:6:\"cpu_nm\";i:0;s:10:\"soft_email\";s:19:\"testme@mail_server\";s:8:\"timezone\";s:1:\"1\";s:9:\"interface\";s:8:\"enp3s4f0\";s:16:\"alert_load_limit\";i:0;s:16:\"alert_disk_limit\";i:0;s:7:\"ping_ip\";s:0:\"\";s:14:\"addvs_cpu_prio\";s:0:\"\";s:13:\"addvs_io_prio\";s:0:\"\";s:14:\"addvs_io_class\";s:0:\"\";s:14:\"node_bandwidth\";i:100;s:20:\"del_slave_ostemplate\";i:0;s:19:\"openvz_suspend_load\";d:0;s:9:\"cron_time\";s:10:\"35 4 * * *\";s:14:\"emps_cron_time\";s:12:\"1 1 7,22 * *\";s:11:\"cookie_name\";s:13:\"SIMCookies551\";s:8:\"vpslimit\";s:0:\"\";s:10:\"overcommit\";i:0;s:6:\"vnc_ip\";s:14:\"ip_addr\";s:15:\"change_ssh_port\";i:2044;s:13:\"max_ssh_login\";i:10;s:6:\"vcores\";i:0;}",
"unique_txt": "",
"lv": "",
"hvm": "0",
"licnumvs": "0",
"total_ram": "15885",
"overcommit": "0",
"ram": "1515",
"total_space": "1239",
"space": "260",
"os": "CentOS Linux release 7.2.1511 (Core)",
"os_arch": "x86_64",
"uname": "Linux hostname 3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 11:03:55 UTC 2016 x86_64 x86_64 x86_64 GNU\/Linux",
"version": "2.8.7",
"patch": "4",
"lic_expires": "28\/12\/2016 GMT",
"checked": "1474851664",
"locked": "0",
"vcores": "45",
"ips": "56",
"ipv6": "50",
"ipv6_subnet": "20",
"ips_int": "5",
"bandwidth": "0",
"update_resource": "0",
"location": "{\"city\":\"Atlanta\",\"state\":\"Georgia\",\"country_code\":\"US\"}",
"numvps": "11",
"alloc_ram": "19400",
"alloc_space": "356",
"alloc_cpu": "14336",
"alloc_cpu_percent": "360.00",
"alloc_bandwidth": "2",
"virts": ["kvm"]
}],
"servers": [{
"serid": "0",
"sgid": "0",
"server_name": "localhost",
"virt": "kvm openvz",
"ip": "127.0.0.1",
"internal_ip": "",
"vnc_ip": "",
"settings": "a:30:{s:6:\"update\";i:1;s:12:\"email_update\";i:1;s:17:\"novnc_server_name\";i:1;s:6:\"cpu_nm\";i:1;s:10:\"soft_email\";s:21:\"test@test.com\";s:8:\"timezone\";s:1:\"1\";s:9:\"interface\";s:4:\"eth0\";s:16:\"alert_load_limit\";i:0;s:16:\"alert_disk_limit\";i:0;s:7:\"ping_ip\";s:0:\"\";s:16:\"enable_tuntap_cp\";i:0;s:13:\"enable_ppp_cp\";i:1;s:14:\"addvs_cpu_prio\";s:0:\"\";s:13:\"addvs_io_prio\";s:0:\"\";s:14:\"addvs_io_class\";s:0:\"\";s:5:\"vswap\";i:1;s:5:\"ploop\";i:0;s:14:\"node_bandwidth\";i:100;s:17:\"disable_backup_cp\";i:0;s:20:\"del_slave_ostemplate\";i:0;s:19:\"openvz_suspend_load\";d:0;s:9:\"cron_time\";s:11:\"18 16 * * 3\";s:14:\"emps_cron_time\";s:11:\"18 16 * * 3\";s:11:\"cookie_name\";s:14:\"SIMCookies3081\";s:8:\"vpslimit\";s:3:\"200\";s:10:\"overcommit\";i:0;s:6:\"vnc_ip\";s:0:\"\";s:15:\"change_ssh_port\";i:2044;s:13:\"max_ssh_login\";i:20;s:6:\"vcores\";i:0;}",
"unique_txt": "",
"lv": "",
"hvm": "0",
"licnumvs": "0",
"total_ram": "15912",
"overcommit": "0",
"ram": "6407",
"total_space": "909",
"space": "186",
"os": "CentOS release 6.7 (Final)",
"os_arch": "x86_64",
"uname": "Linux hostname 2.6.32-042stab108.8 #1 SMP Wed Jul 22 17:23:23 MSK 2015 x86_64 x86_64 x86_64 GNU\/Linux",
"version": "2.8.7",
"patch": "4",
"lic_expires": "28\/12\/2016 GMT",
"checked": "1474851663",
"locked": "0",
"vcores": "29",
"ips": "18490",
"ipv6": "97",
"ipv6_subnet": "93",
"ips_int": "28",
"bandwidth": "0",
"update_resource": "0",
"location": "{\"city\":\"Atlanta\",\"state\":\"Georgia\",\"country_code\":\"US\"}",
"numvps": "8",
"alloc_ram": "17584",
"alloc_space": "149",
"alloc_cpu": "7144",
"alloc_cpu_percent": "100.00",
"alloc_bandwidth": "4",
"virts": ["kvm", "openvz"]
}, {
"serid": "1",
"sgid": "15",
"server_name": "KVM Slave: ip_addr",
"virt": "kvm",
"ip": "ip_addr",
"internal_ip": "",
"vnc_ip": "ip_addr",
"settings": "a:25:{s:6:\"update\";i:1;s:12:\"email_update\";i:1;s:17:\"novnc_server_name\";i:1;s:6:\"cpu_nm\";i:0;s:10:\"soft_email\";s:19:\"testme@mail_server\";s:8:\"timezone\";s:1:\"1\";s:9:\"interface\";s:8:\"enp3s4f0\";s:16:\"alert_load_limit\";i:0;s:16:\"alert_disk_limit\";i:0;s:7:\"ping_ip\";s:0:\"\";s:14:\"addvs_cpu_prio\";s:0:\"\";s:13:\"addvs_io_prio\";s:0:\"\";s:14:\"addvs_io_class\";s:0:\"\";s:14:\"node_bandwidth\";i:100;s:20:\"del_slave_ostemplate\";i:0;s:19:\"openvz_suspend_load\";d:0;s:9:\"cron_time\";s:10:\"35 4 * * *\";s:14:\"emps_cron_time\";s:12:\"1 1 7,22 * *\";s:11:\"cookie_name\";s:13:\"SIMCookies551\";s:8:\"vpslimit\";s:0:\"\";s:10:\"overcommit\";i:0;s:6:\"vnc_ip\";s:14:\"ip_addr\";s:15:\"change_ssh_port\";i:2044;s:13:\"max_ssh_login\";i:10;s:6:\"vcores\";i:0;}",
"unique_txt": "",
"lv": "",
"hvm": "0",
"licnumvs": "0",
"total_ram": "15885",
"overcommit": "0",
"ram": "1515",
"total_space": "1239",
"space": "260",
"os": "CentOS Linux release 7.2.1511 (Core)",
"os_arch": "x86_64",
"uname": "Linux hostname 3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 11:03:55 UTC 2016 x86_64 x86_64 x86_64 GNU\/Linux",
"version": "2.8.7",
"patch": "4",
"lic_expires": "28\/12\/2016 GMT",
"checked": "1474851664",
"locked": "0",
"vcores": "45",
"ips": "56",
"ipv6": "50",
"ipv6_subnet": "20",
"ips_int": "5",
"bandwidth": "0",
"update_resource": "0",
"location": "{\"city\":\"Atlanta\",\"state\":\"Georgia\",\"country_code\":\"US\"}",
"numvps": "11",
"alloc_ram": "19400",
"alloc_space": "356",
"alloc_cpu": "14336",
"alloc_cpu_percent": "360.00",
"alloc_bandwidth": "2",
"virts": ["kvm"]
}],
"timenow": "1474852126",
"time_taken": "0.693"
}