コード例 #1
0
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);
}
コード例 #2
0
ファイル: slbv2.php プロジェクト: ivladdalvi/racktables
function commitDeleteVSG($id)
{
    releaseFiles('ipvs', $id);
    destroyTagsForEntity('ipvs', $id);
    usePreparedDeleteBlade('VS', array('id' => $id));
}
コード例 #3
0
ファイル: ophandlers.php プロジェクト: xtha/salt
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');
}
コード例 #4
0
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');
}
コード例 #5
0
ファイル: database.php プロジェクト: rhysm/racktables
function destroyIPv6Prefix($id)
{
    releaseFiles('ipv6net', $id);
    usePreparedDeleteBlade('IPv6Network', array('id' => $id));
    destroyTagsForEntity('ipv6net', $id);
}
コード例 #6
0
ファイル: slb.php プロジェクト: ivladdalvi/racktables
function commitDeleteRSPool($pool_id = 0)
{
    releaseFiles('ipv4rspool', $pool_id);
    destroyTagsForEntity('ipv4rspool', $pool_id);
    usePreparedDeleteBlade('IPv4RSPool', array('id' => $pool_id));
}
コード例 #7
0
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');
}
コード例 #8
0
     // 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":