Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-11-09 14:51:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d916c5370240f5144d703f8a7d65771465744ca8
d916c537
1 parent
a89ed68a
refine the api server.
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
5 行增加
和
1 行删除
trunk/research/api-server/server.py
trunk/research/api-server/server.py
查看文件 @
d916c53
...
...
@@ -527,6 +527,7 @@ class ArmServer:
self
.
id
=
str
(
global_arm_server_id
)
self
.
ip
=
None
self
.
device_id
=
None
self
.
summaries
=
None
self
.
public_ip
=
cherrypy
.
request
.
remote
.
ip
self
.
heartbeat
=
time
.
time
()
...
...
@@ -544,10 +545,11 @@ class ArmServer:
data
[
"id"
]
=
self
.
id
data
[
"ip"
]
=
self
.
ip
data
[
"device_id"
]
=
self
.
device_id
data
[
"summaries"
]
=
self
.
summaries
data
[
"public_ip"
]
=
self
.
public_ip
data
[
"heartbeat"
]
=
self
.
heartbeat
data
[
"heartbeat_h"
]
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
time
.
localtime
(
self
.
heartbeat
))
data
[
"
summaries
"
]
=
"http://
%
s:1985/api/v1/summaries"
%
(
self
.
ip
)
data
[
"
api
"
]
=
"http://
%
s:1985/api/v1/summaries"
%
(
self
.
ip
)
data
[
"console"
]
=
"http://ossrs.net/console/ng_index.html#/summaries?host=
%
s&port=1985"
%
(
self
.
ip
)
return
data
...
...
@@ -606,6 +608,8 @@ class RESTServers(object):
self
.
__nodes
.
append
(
node
)
node
.
ip
=
json_req
[
"ip"
]
if
"summaries"
in
json_req
:
node
.
summaries
=
json_req
[
"summaries"
]
node
.
device_id
=
device_id
node
.
public_ip
=
cherrypy
.
request
.
remote
.
ip
node
.
heartbeat
=
time
.
time
()
...
...
请
注册
或
登录
后发表评论