Example #1
0
    def on_link_adj(self, request, macaddr):
        hostinfo = self.get_host(macaddr, "/host/%s/adj/link")
        if not isinstance(hostinfo, dict):
            return hostinfo

        adjs = getlladj(self.db, macaddr)
        return Response(json.dumps(adjs), mimetype="application/json")
Example #2
0
 def on_adj(self, request):
     adjs = {}
     for host in self.db.hosts.find():
         adjs.update(getlladj(self.db, host["ident"]));
     return Response(json.dumps(adjs), mimetype="application/json")