winlin

support query server by id.

@@ -621,7 +621,7 @@ class RESTServers(object): @@ -621,7 +621,7 @@ class RESTServers(object):
621 ''' 621 '''
622 get all servers which report to this api-server. 622 get all servers which report to this api-server.
623 ''' 623 '''
624 - def GET(self): 624 + def GET(self, id=None):
625 enable_crossdomain() 625 enable_crossdomain()
626 626
627 try: 627 try:
@@ -631,7 +631,8 @@ class RESTServers(object): @@ -631,7 +631,8 @@ class RESTServers(object):
631 631
632 data = [] 632 data = []
633 for node in self.__nodes: 633 for node in self.__nodes:
634 - data.append(node.json_dump()) 634 + if id == None or node.id == str(id) or node.device_id == str(id):
  635 + data.append(node.json_dump())
635 636
636 return json.dumps(data) 637 return json.dumps(data)
637 finally: 638 finally: