def PUT(self, account):
""" update the status for a given account name
HTTP Success:
200 OK
HTTP Error:
401 Unauthorized
404 Not Found
500 InternalError
"""
json_data = data()
try:
parameter = loads(json_data)
except ValueError:
raise generate_http_error(400, 'ValueError', 'cannot decode json parameter dictionary')
status = parameter.get('status', 'ACTIVE')
try:
set_account_status(account, status=status, issuer=ctx.env.get('issuer'))
except ValueError:
raise generate_http_error(400, 'ValueError', 'Unknown status %s' % status)
except AccessDenied, e:
raise generate_http_error(401, 'AccessDenied', e.args[0][0])
except AccountNotFound, e:
raise generate_http_error(404, 'AccountNotFound', e.args[0][0])
except Exception, e:
raise InternalError(e)
raise OK()
评论列表
文章目录