public function deleteAction() { $main_buss_id = $this->getRequest("main_buss_id", ""); $path = $this->getRequest("path", ""); $op_user = $this->userInfo["userName"]; if ($path === "" || $main_buss_id === "") { $res = InfoDescUtil::getErrorMsg(InfoDescUtil::ERR_BAD_ARGS); QconfMgrLog::err(__FILE__, __LINE__, "parameter 'main_buss_id' or 'path' is null!"); echo json_encode($res); return; } //[USERPERM CHECK] $userperm_ret = UserPermServ::checkPerm($op_user, $path); if ($userperm_ret === FALSE) { QconfMgrLog::err(__FILE__, __LINE__, "Insufficient permission of {$op_user} on node {$path}"); $res = InfoDescUtil::getErrorMsg(InfoDescUtil::ERR_USER_PERM_PERMISSION_DENIED); echo json_encode($res); return; } $delete_ret = SnapShotUtil::deleteSnapShot($main_buss_id, $path); if ($delete_ret === FALSE) { $res = InfoDescUtil::getErrorMsg(InfoDescUtil::ERR_SNAPSHOT_MODULE_FAILED); QconfMgrLog::err(__FILE__, __LINE__, "failed to delte snapshot by node_whole({$path}), main_buss_id({$main_buss_id})"); echo json_encode($res); return; } OpServ::insert(InfoDescUtil::OP_TYPE_SNAPSHOT_DELETE, $path, "", InfoDescUtil::OP_STATUS_SUCCESS, $main_buss_id, 0, $op_user, ""); $res = array("errno" => "0", "errmsg" => "", "data" => "create snapshot success!"); $json = json_encode($res); echo $json; }