Exemplo n.º 1
0
    def delete(self, account, rse):
        """ Delete an account limit.

        .. :quickref: AccountLimit; Delete account limits.

        :param account: Account name.
        :param rse: RSE name.
        :status 200: Successfully deleted.
        :status 401: Invalid auth token.
        :status 404: RSE not found.
        :status 404: Account not found
        """
        try:
            delete_account_limit(account=account,
                                 rse=rse,
                                 issuer=request.environ.get('issuer'))
        except AccessDenied as exception:
            return generate_http_error_flask(401, 'AccessDenied',
                                             exception.args[0])
        except AccountNotFound as exception:
            return generate_http_error_flask(404, 'AccountNotFound',
                                             exception.args[0])
        except RSENotFound as exception:
            return generate_http_error_flask(404, 'RSENotFound',
                                             exception.args[0])
        except Exception as exception:
            print(format_exc())
            return exception, 500
        return "OK", 200
Exemplo n.º 2
0
    def DELETE(self, account, rse):
        """ Delete an account limit.
        HTTP Success:
            200 OK

        HTTP Error:
            401 Unauthorized
            404 Not Found
            500 Internal Error

        :param X-Rucio-Auth-Account: Account identifier.
        :param X-Rucio-Auth-Token:   As an 32 character hex string.
        :param account:              Account name.
        :param rse:                  RSE name.
        """
        try:
            delete_account_limit(account=account,
                                 rse=rse,
                                 issuer=ctx.env.get('issuer'))
        except AccessDenied as exception:
            raise generate_http_error(401, 'AccessDenied', exception.args[0])
        except AccountNotFound as exception:
            raise generate_http_error(404, 'AccountNotFound',
                                      exception.args[0])
        except RSENotFound as exception:
            raise generate_http_error(404, 'RSENotFound', exception.args[0])
        except Exception as exception:
            print format_exc()
            raise InternalError(exception)
        raise OK()
Exemplo n.º 3
0
    def DELETE(self, account, rse):
        """ Delete an account limit.
        HTTP Success:
            200 OK

        HTTP Error:
            401 Unauthorized
            404 Not Found
            500 Internal Error

        :param X-Rucio-Auth-Account: Account identifier.
        :param X-Rucio-Auth-Token:   As an 32 character hex string.
        :param account:              Account name.
        :param rse:                  RSE name.
        """
        try:
            delete_account_limit(account=account, rse=rse, issuer=ctx.env.get('issuer'))
        except AccessDenied, e:
            raise generate_http_error(401, 'AccessDenied', e.args[0][0])