def deleteSliver (slice_urn = None, sliver_urn = None): slice_name = GeniDB.getFlowvisorSliceName(slice_urn=slice_urn, sliver_urn = sliver_urn) if FV.sliceExists(slice_name): # stats = FV.getCombinedStats(slice_name) # GeniDB.insertFinalStats(slice_urn, stats) FV.deleteSlice(slice_name) GeniDB.deleteSliver(slice_urn=slice_urn, sliver_urn=sliver_urn) foam.geni.approval.rebuildDB()
def deleteSliver(slice_urn=None, sliver_urn=None): slice_name = GeniDB.getFlowvisorSliceName(slice_urn=slice_urn, sliver_urn=sliver_urn) if FV.sliceExists(slice_name): # stats = FV.getCombinedStats(slice_name) # GeniDB.insertFinalStats(slice_urn, stats) FV.deleteSlice(slice_name) GeniDB.deleteSliver(slice_urn=slice_urn, sliver_urn=sliver_urn) foam.geni.approval.rebuildDB()
def rejectSliver (self): if not request.json: return try: self.validate(request.json, [("sliver_urn", (unicode,str))]) slice_name = GeniDB.getFlowvisorSliceName(sliver_urn=request.json["sliver_urn"]) sobj = GeniDB.getSliverObj(request.json["sliver_urn"]) data = GeniDB.getSliverData(sobj.getURN(), True) GeniDB.setSliverStatus(request.json["sliver_urn"], False) if FV.sliceExists(slice_name): FV.deleteSlice(slice_name) foam.task.emailRejectSliver(data) return jsonify(None) except JSONValidationError, e: jd = e.__json__() return jsonify(jd, code = 1, msg = jd["exception"])