예제 #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_local_account_limit(account=account,
                                       rse=rse,
                                       issuer=request.environ.get('issuer'),
                                       vo=request.environ.get('vo'))
        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
예제 #2
0
    def delete(self, account, rse):
        """
        ---
        summary: Delete a local account limit
        tags:
          - Account Limit
        parameters:
        - name: account
          in: path
          description: The account for the accountlimit.
          schema:
            type: string
          style: simple
        - name: rse
          in: path
          description: The rse for the accountlimit.
          schema:
            type: string
          style: simple
        responses:
          200:
            description: OK
          401:
            description: Invalid Auth Token
          404:
            description: No RSE or account found for the given id.
        """
        try:
            delete_local_account_limit(account=account, rse=rse, issuer=request.environ.get('issuer'), vo=request.environ.get('vo'))
        except AccessDenied as error:
            return generate_http_error_flask(401, error)
        except (AccountNotFound, RSENotFound) as error:
            return generate_http_error_flask(404, error)

        return '', 200
예제 #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_local_account_limit(account=account,
                                       rse=rse,
                                       issuer=ctx.env.get('issuer'),
                                       vo=ctx.env.get('vo'))
        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()
예제 #4
0
    def delete(self, account, rse):
        """ Delete an account limit.

        .. :quickref: LocalAccountLimit; Delete local 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_local_account_limit(account=account,
                                       rse=rse,
                                       issuer=request.environ.get('issuer'),
                                       vo=request.environ.get('vo'))
        except AccessDenied as error:
            return generate_http_error_flask(401, 'AccessDenied',
                                             error.args[0])
        except AccountNotFound as error:
            return generate_http_error_flask(404, 'AccountNotFound',
                                             error.args[0])
        except RSENotFound as error:
            return generate_http_error_flask(404, 'RSENotFound', error.args[0])
        except Exception as error:
            logging.exception("Internal Error")
            return str(error), 500
        return '', 200
예제 #5
0
    def delete(self, account, rse):
        """ Delete an account limit.

        .. :quickref: LocalAccountLimit; Delete local 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_local_account_limit(account=account, rse=rse, issuer=request.environ.get('issuer'), vo=request.environ.get('vo'))
        except AccessDenied as error:
            return generate_http_error_flask(401, error)
        except (AccountNotFound, RSENotFound) as error:
            return generate_http_error_flask(404, error)

        return '', 200