1 from pecan import expose, response
2 from pecan.rest import RestController
4 from restful import module
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 module.instance.get_mons()
26 return {'message': 'Failed to identify the monitor node "%s"' % 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 module.instance.get_mons()
43 def _lookup(self, name, *remainder):
44 return MonName(name), remainder