From 18b50d961fe1a5c60289fdaf3a1aa6050ffa5244 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 9 Nov 2015 15:19:50 +0800 Subject: [PATCH] support query server by id. --- trunk/research/api-server/server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trunk/research/api-server/server.py b/trunk/research/api-server/server.py index 8cdb99be6..f20739ef7 100755 --- a/trunk/research/api-server/server.py +++ b/trunk/research/api-server/server.py @@ -621,7 +621,7 @@ class RESTServers(object): ''' get all servers which report to this api-server. ''' - def GET(self): + def GET(self, id=None): enable_crossdomain() try: @@ -631,7 +631,8 @@ class RESTServers(object): data = [] for node in self.__nodes: - data.append(node.json_dump()) + if id == None or node.id == str(id) or node.device_id == str(id): + data.append(node.json_dump()) return json.dumps(data) finally: