def GET(self, scope):
"""
Return all data identifiers in the given scope.
HTTP Success:
200 OK
HTTP Error:
401 Unauthorized
404 Not Found
:param scope: The scope name.
"""
header('Content-Type', 'application/x-json-stream')
name = None
recursive = False
if ctx.query:
params = parse_qs(ctx.query[1:])
if 'name' in params:
name = params['name'][0]
if 'recursive' in params:
recursive = True
try:
for did in scope_list(scope=scope, name=name, recursive=recursive):
yield render_json(**did) + '\n'
except DataIdentifierNotFound, error:
raise generate_http_error(404, 'DataIdentifierNotFound', error.args[0][0])
except Exception, error:
print format_exc()
raise InternalError(error)
评论列表
文章目录