1 from pecan import expose
2 from pecan.rest import RestController
4 from restful import module
5 from restful.decorators import auth
8 class ServerFqdn(RestController):
9 def __init__(self, fqdn):
13 @expose(template='json')
15 def get(self, **kwargs):
17 Show the information for the server fqdn
19 return module.instance.get_server(self.fqdn)
23 class Server(RestController):
24 @expose(template='json')
26 def get(self, **kwargs):
28 Show the information for all the servers
30 return module.instance.list_servers()
34 def _lookup(self, fqdn, *remainder):
35 return ServerFqdn(fqdn), remainder