當前位置: 首頁>>代碼示例>>Python>>正文


Python GeniDB.deleteSliver方法代碼示例

本文整理匯總了Python中foam.geni.db.GeniDB.deleteSliver方法的典型用法代碼示例。如果您正苦於以下問題:Python GeniDB.deleteSliver方法的具體用法?Python GeniDB.deleteSliver怎麽用?Python GeniDB.deleteSliver使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在foam.geni.db.GeniDB的用法示例。


在下文中一共展示了GeniDB.deleteSliver方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: deleteSliver

# 需要導入模塊: from foam.geni.db import GeniDB [as 別名]
# 或者: from foam.geni.db.GeniDB import deleteSliver [as 別名]
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()
開發者ID:HalasNet,項目名稱:felix,代碼行數:10,代碼來源:lib.py

示例2: StringIO

# 需要導入模塊: from foam.geni.db import GeniDB [as 別名]
# 或者: from foam.geni.db.GeniDB import deleteSliver [as 別名]
    GeniDB.getSliverPriority(opts["sliver_urn"])
    return
  except UnknownSliver, e:
    pass

  s = StringIO(str(opts["req_rspec"]))
  rspec_dom = ET.parse(s)
  root_elem = rspec_dom.getroot()

  sliver = GENISliver(rspec_dom)
  sliver._uuid = opts["fvslicename"]
  GeniDB.insertSliver(opts["slice_urn"], sliver, str(opts["req_rspec"]), opts["exp"])
  GeniDB.setSliverPriority(opts["sliver_urn"], opts["priority"])
  GeniDB.setSliverStatus(opts["sliver_urn"], opts["status"])
  if opts["deleted"]:
    GeniDB.deleteSliver(sliver_urn = opts["sliver_urn"])

class GENISliver(foam.flowvisor.FSAllocation):
  def __init__ (self, dom):
    super(GENISliver, self).__init__()

    self.__urn = None
    self.__slice_urn = None
    self.__user_urn = None
    self.__ref = None
    self.__pend_reason = None

    if dom:
      self.__parseDatav3(dom)

  def __str__ (self):
開發者ID:HalasNet,項目名稱:felix,代碼行數:33,代碼來源:lib.py


注:本文中的foam.geni.db.GeniDB.deleteSliver方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。