1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

support query server by id.

This commit is contained in:
winlin 2015-11-09 15:19:50 +08:00
parent d916c53702
commit 18b50d961f

View file

@ -621,7 +621,7 @@ class RESTServers(object):
''' '''
get all servers which report to this api-server. get all servers which report to this api-server.
''' '''
def GET(self): def GET(self, id=None):
enable_crossdomain() enable_crossdomain()
try: try:
@ -631,7 +631,8 @@ class RESTServers(object):
data = [] data = []
for node in self.__nodes: 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) return json.dumps(data)
finally: finally: