コード例 #1
0
    def get(self, rse):
        """
        List all QoS policies of an RSE.

        .. :quickref: QoSPolicy; List all QoS policies of an RSE.

        :param rse: The RSE name.
        :resheader Content-Type: application/json
        :status 200: OK.
        :status 401: Invalid Auth Token.
        :status 500: Internal Error.
        :returns: List of QoS policies
        """

        try:
            qos_policies = list_qos_policies(
                rse=rse,
                issuer=request.environ.get('issuer'),
                vo=request.environ.get('vo'))
            return Response(dumps(qos_policies, 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
コード例 #2
0
ファイル: rses.py プロジェクト: davidgcameron/rucio
    def get(self, rse):
        """
        List all QoS policies of an RSE.

        .. :quickref: QoSPolicy; List all QoS policies of an RSE.

        :param rse: The RSE name.
        :resheader Content-Type: application/json
        :status 200: OK.
        :status 401: Invalid Auth Token.
        :returns: List of QoS policies
        """
        try:
            qos_policies = list_qos_policies(rse=rse, issuer=request.environ.get('issuer'), vo=request.environ.get('vo'))
            return Response(dumps(qos_policies, cls=APIEncoder), content_type='application/json')
        except RSENotFound as error:
            return generate_http_error_flask(404, error)
コード例 #3
0
    def GET(self, rse):
        """
        List all QoS policies of an RSE.

        :param rse: the RSE name.
        """
        header('Content-Type', 'application/json')

        try:
            qos_policies = list_qos_policies(rse=rse, issuer=ctx.env.get('issuer'), vo=ctx.env.get('vo'))
            return dumps(qos_policies, 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)