def GET(self, section):
"""
List configuration of a section
HTTP Success:
200 OK
HTTP Error:
401 Unauthorized
404 NotFound
"""
header('Content-Type', 'application/json')
res = {}
for item in config.items(section, issuer=ctx.env.get('issuer')):
res[item[0]] = item[1]
if res == {}:
raise generate_http_error(404, 'ConfigNotFound', 'No configuration found for section \'%s\'' % section)
return json.dumps(res)
评论列表
文章目录