function delIPAllocation() { $ip_bin = assertIPArg('ip'); assertUIntArg('object_id'); unbindIPFromObject($ip_bin, $_REQUEST['object_id']); showFuncMessage(__FUNCTION__, 'OK'); }
function unbindIPv6FromObject($ip_bin, $object_id) { if (strlen($ip_bin) != 16) { throw new InvalidArgException('ip_bin', $ip_bin, "Invalid binary IP"); } return unbindIPFromObject($ip_bin, $object_id); }
function delIPAllocation() { $ip_bin = assertIPArg('ip'); assertUIntArg('object_id'); unbindIPFromObject($ip_bin, $_REQUEST['object_id']); ############################################################################################### # delete zabbix interface $object = spotEntity('object', $_REQUEST['object_id']); $result = deleteInterface($object['dname'], $_REQUEST['ip']); if (isset($result['error'])) { showError('Deleting zabbix interface is failed. Error message:' . $result['error']); } # END ############################################################################################### showFuncMessage(__FUNCTION__, 'OK'); }
} bindIPToObject($ip_bin, $_REQUEST['object_id'], $_REQUEST['bond_name'], $_REQUEST['bond_type']); redirectUser($_SERVER['SCRIPT_NAME'] . '?method=get_object&object_id=' . $_REQUEST['object_id']); break; // delete an IP address allocation for an object // UI equivalent: /index.php? // UI handler: delIPAllocation() // delete an IP address allocation for an object // UI equivalent: /index.php? // UI handler: delIPAllocation() case 'delete_object_ip_allocation': require_once 'inc/init.php'; $ip_bin = assertIPArg('ip'); assertUIntArg('object_id'); // TODO: raise exception if the IP doesn't exist unbindIPFromObject($ip_bin, $_REQUEST['object_id']); redirectUser($_SERVER['SCRIPT_NAME'] . '?method=get_object&object_id=' . $_REQUEST['object_id']); break; // add a port to an object // UI equivalent: /index.php?page= // UI handler: addPortForObject() // add a port to an object // UI equivalent: /index.php?page= // UI handler: addPortForObject() case 'add_port': require_once 'inc/init.php'; assertUIntArg('object_id'); assertStringArg('port_name', TRUE); genericAssertion('port_l2address', 'l2address0'); genericAssertion('port_name', 'string'); $new_port_id = commitAddPort($_REQUEST['object_id'], trim($_REQUEST['port_name']), $_REQUEST['port_type_id'], trim($_REQUEST['port_label']), trim($_REQUEST['port_l2address']));