Use the Delete IP API to delete an IP address from your server. The API response will contain "done" as "1" after the IP address is successfully deleted.
IP addresses used by a VPS cannot be deleted.
HTTP Request
https://hostname:4085/index.php?act=ips&delete=IPID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | ips | The action specified to perform the operation and will return "done" as "1" after the IP is deleted successfully | Yes |
delete | GET | Int | The ID of the IP address, for deleting multiple addresses pass 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'] = 143243;
$post['delete'] = '143243, 156832'; // For deleting Multiple IPs
$output = $admin->delete_ips($post);
print_r(json_encode($output));
?>
Output
{
"title": "IP List",
"done": "1",
"ips": {
"143101": {
"ipid": "143101",
"ippid": "null",
"ip_serid": "3",
"vpsid": "0",
"ip": "107.189.34.29",
"ipv6": "null",
"ipr_netmask": "",
"primary": "0",
"ipr_ips": "",
"mac_addr": "",
"locked": "0",
"ipp_serid": "null",
"ippool_name": "null",
"gateway": "null",
"netmask": "null",
"ns1": "null",
"ns2": "null",
"nat": "null",
"nat_name": "null",
"routing": "null",
"internal": "null",
"bridge": "null",
"mtu": "null",
"hostname": "null"
},
"143250": {
"ipid": "143250",
"ippid": "null",
"ip_serid": "1",
"vpsid": "0",
"ip": "122.122.1.33",
"ipv6": "null",
"ipr_netmask": "",
"primary": "0",
"ipr_ips": "",
"mac_addr": "null",
"locked": "0",
"ipp_serid": "null",
"ippool_name": "null",
"gateway": "null",
"netmask": "null",
"ns1": "null",
"ns2": "null",
"nat": "null",
"nat_name": "null",
"routing": "null",
"internal": "null",
"bridge": "null",
"mtu": "null",
"hostname": "null"
}
},
"timenow": "1475130453",
"time_taken": "0.191"
}