コード例 #1
0
ファイル: server.py プロジェクト: tegola-hubs/dendria
    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")
コード例 #2
0
ファイル: server.py プロジェクト: tegola-hubs/dendria
 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")