def GET(self, url, rse, operation):
"""
GET redirect URL.
HTTP Success:
200 OK
HTTP Error:
401 Unauthorized
500 InternalError
:returns: A URL refering to the file.
"""
# header('Access-Control-Allow-Origin', ctx.env.get('HTTP_ORIGIN'))
# header('Access-Control-Allow-Headers', ctx.env.get('HTTP_ACCESS_CONTROL_REQUEST_HEADERS'))
# header('Access-Control-Allow-Methods', '*')
# header('Access-Control-Allow-Credentials', 'true')
try:
pos = url.index('/')
url = ''.join([url[:pos], '/', url[pos:]])
if operation == 'connect':
objectstore.connect(rse, url)
else:
result = objectstore.get_signed_urls([url], rse=rse, operation=operation)
if isinstance(result[url], Exception):
raise result[url]
return result[url]
except RucioException, e:
raise generate_http_error(500, e.__class__.__name__, e.args[0])
except Exception, e:
print traceback.format_exc()
raise InternalError(e)
raise OK()
评论列表
文章目录