function deleteRackTablesData() { // delete racktables items data $query = 'delete from item_information;'; usePreparedExecuteBlade($query); // delete racktables object data $allObjects = scanRealmByText('object'); foreach ($allObjects as $object) { $racklist = getResidentRacksData($object["id"], FALSE); commitDeleteObject($object["id"]); foreach ($racklist as $rack_id) { usePreparedDeleteBlade('RackThumbnail', array('rack_id' => $rack_id)); } } // delete racktables rack data $allRacks = scanRealmByText('rack'); foreach ($allRacks as $rack) { releaseFiles('rack', $rack['id']); destroyTagsForEntity('rack', $rack['id']); usePreparedDeleteBlade('RackSpace', array('rack_id' => $rack['id'])); commitDeleteObject($rack['id']); resetRackSortOrder($rack['row_id']); } $query = 'delete from rack_position;'; usePreparedExecuteBlade($query); $query = 'delete from rack_airconditioner;'; usePreparedExecuteBlade($query); }
function commitDeleteVSG($id) { releaseFiles('ipvs', $id); destroyTagsForEntity('ipvs', $id); usePreparedDeleteBlade('VS', array('id' => $id)); }
function deleteRack() { assertUIntArg('rack_id'); $rackData = spotEntity('rack', $_REQUEST['rack_id']); amplifyCell($rackData); if (count($rackData['mountedObjects'])) { showFuncMessage(__FUNCTION__, 'ERR1'); return; } releaseFiles('rack', $_REQUEST['rack_id']); destroyTagsForEntity('rack', $_REQUEST['rack_id']); usePreparedDeleteBlade('RackSpace', array('rack_id' => $_REQUEST['rack_id'])); commitDeleteObject($_REQUEST['rack_id']); resetRackSortOrder($rackData['row_id']); showFuncMessage(__FUNCTION__, 'OK', array($rackData['name'])); return buildRedirectURL('rackspace', 'default'); }
function deleteRack() { assertUIntArg('rack_id'); $rackData = spotEntity('rack', $_REQUEST['rack_id']); ############################################################################################### # delete zabbix group $result = deleteGroup($rackData["name"]); if (isset($result["error"])) { showError("Deleting zabbix group is failed. Error message:" . $result["error"]); } # END ############################################################################################### amplifyCell($rackData); if (count($rackData['mountedObjects'])) { showFuncMessage(__FUNCTION__, 'ERR1'); return; } releaseFiles('rack', $_REQUEST['rack_id']); destroyTagsForEntity('rack', $_REQUEST['rack_id']); usePreparedDeleteBlade('RackSpace', array('rack_id' => $_REQUEST['rack_id'])); commitDeleteObject($_REQUEST['rack_id']); resetRackSortOrder($rackData['row_id']); showFuncMessage(__FUNCTION__, 'OK', array($rackData['name'])); ############################################################################################## # delete position information from DB usePreparedDeleteBlade('rack_position', array('rack_id' => $_REQUEST["rack_id"])); # delete airconditioner information from DB usePreparedDeleteBlade('rack_airconditioner', array('rack_id' => $_REQUEST["rack_id"])); ############################################################################################## return buildRedirectURL('rackspace', 'default'); }
function destroyIPv6Prefix($id) { releaseFiles('ipv6net', $id); usePreparedDeleteBlade('IPv6Network', array('id' => $id)); destroyTagsForEntity('ipv6net', $id); }
function commitDeleteRSPool($pool_id = 0) { releaseFiles('ipv4rspool', $pool_id); destroyTagsForEntity('ipv4rspool', $pool_id); usePreparedDeleteBlade('IPv4RSPool', array('id' => $pool_id)); }
function deleteLocation() { setFuncMessages(__FUNCTION__, array('OK' => 7, 'ERR1' => 206)); assertUIntArg('location_id'); $locationData = spotEntity('location', $_REQUEST['location_id']); amplifyCell($locationData); if (count($locationData['locations']) || count($locationData['rows'])) { showFuncMessage(__FUNCTION__, 'ERR1', array($locationData['name'])); return; } releaseFiles('location', $_REQUEST['location_id']); destroyTagsForEntity('location', $_REQUEST['location_id']); commitDeleteObject($_REQUEST['location_id']); showFuncMessage(__FUNCTION__, 'OK', array($locationData['name'])); return buildRedirectURL('rackspace', 'editlocations'); }
// api.php?method=delete_rack&name[]=test1 // api.php?method=delete_rack&name[]=test1 case "delete_rack": require_once 'inc/init.php'; $id = getEntityIdByName("rack", $_REQUEST["name"]); if ($id < 0) { echo json_encode(array("error" => "In racktables the rack " . $_REQUEST["name"] . "is not existed.")); return; } $rack = spotEntity("rack", $id); amplifyCell($rack); if (count($rack["mountedObjects"])) { echo json_encode(array("error" => "There are mounted Objects in the rack " . $_REQUEST["name"] . ".")); return; } releaseFiles("rack", $rack["id"]); destroyTagsForEntity("rack", $rack['id']); usePreparedDeleteBlade("RackSpace", array("rack_id" => $rack["id"])); commitDeleteObject($rack["id"]); resetRackSortOrder($rack["row_id"]); # delete position information usePreparedDeleteBlade('rack_position', array('rack_id' => $id)); # delete airconditioner information usePreparedDeleteBlade('rack_airconditioner', array('rack_id' => $id)); echo json_encode(array("result" => $rack["id"])); return; // add_object // api.php?method=my_add_object&type=4&name=test&label=&asset_no=&taglist[]=&has_problems=no // add_object // api.php?method=my_add_object&type=4&name=test&label=&asset_no=&taglist[]=&has_problems=no case "my_add_object":