def test_global_account_limit(self): """ ACCOUNT_LIMIT (CORE): Set, get and delete global account limit """ account_limit.set_global_account_limit(self.account, 'MOCK', 200000, session=self.db_session) assert account_limit.get_global_account_limit(account=self.account, rse_expression='MOCK', session=self.db_session) == 200000 assert account_limit.get_global_account_limit(account=self.account, rse_expression='MOCK2', session=self.db_session) is None account_limit.delete_global_account_limit(self.account, 'MOCK', session=self.db_session) assert account_limit.get_global_account_limit(account=self.account, rse_expression='MOCK', session=self.db_session) is None
def test_set_global_account_limit(self): """ ACCOUNT_LIMIT (CLIENTS): Set global account limit """ self.alclient.set_global_account_limit(self.account.external, 'MOCK', 200000) assert account_limit.get_global_account_limit( account=self.account, rse_expression='MOCK') == 200000 assert account_limit.get_global_account_limit( account=self.account, rse_expression='MOCK2') is None
def test_delete_global_account_limit(self): """ ACCOUNTLIMIT (CLIENTS): Delete global account limit """ rse_exp = 'MOCK' account_limit.set_global_account_limit(account=self.account, rse_expression=rse_exp, bytes_=10, session=self.db_session) self.alclient.delete_global_account_limit(account=self.account.external, rse_expression=rse_exp) result = account_limit.get_global_account_limit(account=self.account, rse_expression=rse_exp) assert result is None
def get_global_account_limit(account, rse_expression): """ Lists the limitation names/values for the specified account name and rse expression. REST API: http://<host>:<port>/rucio/account/<account>/limits :param account: The account name. :param rse_expression: The rse expression. :returns: The account limit. """ account = InternalAccount(account) return {rse_expression: account_limit_core.get_global_account_limit(account=account, rse_expression=rse_expression)}
def get_global_account_limit(account, rse_expression, vo='def', session=None): """ Lists the limitation names/values for the specified account name and rse expression. REST API: http://<host>:<port>/rucio/account/<account>/limits :param account: The account name. :param rse_expression: The rse expression. :param vo: The VO to act on. :param session: The database session in use. :returns: The account limit. """ account = InternalAccount(account, vo=vo) return {rse_expression: account_limit_core.get_global_account_limit(account=account, rse_expression=rse_expression, session=session)}