]>
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
19 mon
= [x
for x
in context
.instance
.get_mons()
20 if x
['name'] == self
.name
]
23 return {'message': 'Failed to identify the monitor node "{}"'.format(self
.name
)}
28 class Mon(RestController
):
29 @expose(template
='json')
31 def get(self
, **kwargs
):
33 Show the information for all the monitors
35 return context
.instance
.get_mons()
39 def _lookup(self
, name
, *remainder
):
40 return MonName(name
), remainder