def GET(self, account):
"""
Return the account usage of the account.
HTTP Success:
200 OK
HTTP Error:
401 Unauthorized
404 Not Found
:param account: The account name.
"""
header('Content-Type', 'application/x-json-stream')
try:
for usage in get_account_usage(account=account, rse=None, issuer=ctx.env.get('issuer')):
yield dumps(usage, cls=APIEncoder) + '\n'
except AccountNotFound, e:
raise generate_http_error(404, 'AccountNotFound', e.args[0][0])
except AccessDenied, e:
raise generate_http_error(401, 'AccessDenied', e.args[0][0])
except Exception, e:
print format_exc()
raise InternalError(e)
评论列表
文章目录