-
Notifications
You must be signed in to change notification settings - Fork 10
/
get.py
34 lines (31 loc) · 872 Bytes
/
get.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import daemon.handler
class Handler(daemon.handler.BaseHandler):
"""
Return the api handlers manifest.
"""
routes = (
("GET", "api"),
(None, "get_api"),
)
prototype = []
access = {
"roles": ["guest"],
"namespaces": "ANY",
}
def action(self, nodename, thr=None, **kwargs):
sigs = []
data = []
for h in thr.parent.handlers.values():
sig = h.routes[0]
if sig in sigs:
continue
sigs.append(sig)
data.append({
"routes": [{"method": r[0], "path": r[1]} for r in h.routes],
"prototype": h.prototype,
"access": h.access,
"desc": h.__doc__.strip(),
"stream": h.stream,
"multiplex": h.multiplex,
})
return data