class POXNomSnapshotter(object):
  def __init__(self):
    self.encoder = NOMEncoder()

  def get_snapshot(self):
    nom = {"switches":[], "hosts":[], "links":[]}
    for s in core.topology.getEntitiesOfType(Switch):
      nom["switches"].append(self.encoder.encode(s))
    for h in core.topology.getEntitiesOfType(Host):
      nom["hosts"].append(self.encoder.encode(h))
    for l in core.topology.getEntitiesOfType(Link):
      nom["links"].append(self.encoder.encode(l))
    return nom
Exemple #2
0
class POXNomSnapshotter(object):
    def __init__(self):
        self.encoder = NOMEncoder()

    def get_snapshot(self):
        nom = {"switches": [], "hosts": [], "links": []}
        for s in core.topology.getEntitiesOfType(Switch):
            nom["switches"].append(self.encoder.encode(s))
        for h in core.topology.getEntitiesOfType(Host):
            nom["hosts"].append(self.encoder.encode(h))
        for l in core.topology.getEntitiesOfType(Link):
            nom["links"].append(self.encoder.encode(l))
        return nom
 def __init__(self):
   self.encoder = NOMEncoder()
Exemple #4
0
 def __init__(self):
     self.encoder = NOMEncoder()