]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/restful/api/mon.py
1 from pecan
import expose
, response
2 from pecan
.rest
import RestController
4 from restful
import context
5 from restful
.decorators
import auth
8 class MonName(RestController
):
9 def __init__(self
, name
):
13 @expose(template
='json')
15 def get(self
, **kwargs
):
17 Show the information for the monitor name
20 lambda x
: x
['name'] == self
.name
,
21 context
.instance
.get_mons()
26 return {'message': 'Failed to identify the monitor node "{}"'.format(self
.name
)}
32 class Mon(RestController
):
33 @expose(template
='json')
35 def get(self
, **kwargs
):
37 Show the information for all the monitors
39 return context
.instance
.get_mons()
43 def _lookup(self
, name
, *remainder
):
44 return MonName(name
), remainder