Exemplo n.º 1
0
    def GET(self, account, rse=None):
        """ get the current limits for an account on a specific RSE

        HTTP Success:
            200 OK

        HTTP Error:
            404 Not Found
            500 InternalError

        :param X-Rucio-Account: Account identifier.
        :param X-Rucio-Auth-Token: as an 32 character hex string.

        :param account:   The account name.
        :param rse:       The rse name.

        :returns: JSON dict containing informations about the requested user.
        """
        header('Content-Type', 'application/json')
        try:
            if rse:
                limits = get_account_limit(account=account, rse=rse)
            else:
                limits = get_account_limits(account=account)
        except RSENotFound, e:
            raise generate_http_error(404, 'RSENotFound', e.args[0][0])
Exemplo n.º 2
0
    def GET(self, account, rse=None):
        """ get the current limits for an account on a specific RSE

        HTTP Success:
            200 OK

        HTTP Error:
            404 Not Found
            406 Not Acceptable
            500 InternalError

        :param X-Rucio-Account: Account identifier.
        :param X-Rucio-Auth-Token: as an 32 character hex string.

        :param account:   The account name.
        :param rse:       The rse name.

        :returns: JSON dict containing informations about the requested user.
        """
        header('Content-Type', 'application/json')
        try:
            if rse:
                limits = get_account_limit(account=account,
                                           rse=rse,
                                           vo=ctx.env.get('vo'))
            else:
                limits = get_account_limits(account=account,
                                            vo=ctx.env.get('vo'))
        except RSENotFound as error:
            raise generate_http_error(404, 'RSENotFound', error.args[0])

        return render_json(**limits)
Exemplo n.º 3
0
    def get(self, account, rse=None):
        """ get the current limits for an account on a specific RSE

        .. :quickref: AccountLimits; Get account limits.

        :param account: The account name.
        :param rse: The rse name.
        :resheader Content-Type: application/json
        :status 200: OK.
        :status 401: Invalid auth token.
        :status 404: RSE not found.
        :status 406: Not Acceptable.
        :status 500: Database exception
        :returns: JSON dict containing informations about the requested user.
        """

        try:
            if rse:
                limits = get_account_limit(account=account, rse=rse)
            else:
                limits = get_account_limits(account=account)
        except RSENotFound as error:
            return generate_http_error_flask(404, 'RSENotFound', error.args[0])

        return Response(render_json(**limits), content_type="application/json")