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
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()