def get(self, source, destination): """ Get RSE distance between source and destination. .. :quickref: Distance; Get RSE distance. :param source: the source RSE name. :param destination: the destination RSE name. :resheader Content-Type: application/json :status 200: OK. :status 401: Invalid Auth Token. :status 406: Not Acceptable. :status 500: Internal Error. :returns: List of dictionaries with RSE distances. """ try: distance = get_distance(source=source, destination=destination, issuer=request.environ.get('issuer'), vo=request.environ.get('vo')) return Response(dumps(distance, cls=APIEncoder), content_type="application/json") except RSENotFound as error: return generate_http_error_flask(404, 'RSENotFound', error.args[0]) except RucioException as error: return generate_http_error_flask(500, error.__class__.__name__, error.args[0]) except Exception as error: print(format_exc()) return error, 500
def GET(self, source, destination): """ Get RSE distance between source and destination. :param rse: the RSE name. """ header('Content-Type', 'application/json') try: distance = get_distance(source=source, destination=destination, issuer=ctx.env.get('issuer')) return dumps(distance, cls=APIEncoder) except RSENotFound, error: raise generate_http_error(404, 'RSENotFound', error[0][0])
def GET(self, source, destination): """ Get RSE distance between source and destination. :param rse: the RSE name. """ header('Content-Type', 'application/json') try: distance = get_distance(source=source, destination=destination, issuer=ctx.env.get('issuer')) return dumps(distance, cls=APIEncoder) except RSENotFound as error: raise generate_http_error(404, 'RSENotFound', error.args[0]) except RucioException as error: raise generate_http_error(500, error.__class__.__name__, error.args[0]) except Exception as error: print(format_exc()) raise InternalError(error)