Account Methods

class rucio.client.accountclient.AccountClient(rucio_host=None, auth_host=None, account=None, ca_cert=None, auth_type=None, creds=None, timeout=None, user_agent='rucio-clients')[source]

Bases: rucio.client.baseclient.BaseClient

Account client class for working with rucio accounts

ACCOUNTS_BASEURL = 'accounts'
add_account(account, type, email)[source]

Sends the request to create a new account.

Parameters:
  • account – the name of the account.
  • type – The account type
  • email – The Email address associated with the account.
Returns:

True if account was created successfully else False.

Raises Duplicate:
 

if account already exists.

add_account_attribute(account, key, value)[source]

Adds an attribute to an account.

Parameters:
  • account – The account name.
  • key – The attribute key.
  • value – The attribute value.
add_identity(account, identity, authtype, email, default=False)[source]

Adds a membership association between identity and account.

Parameters:
  • account – The account name.
  • identity – The identity key name. For example x509 DN, or a username.
  • authtype – The type of the authentication (x509, gss, userpass).
  • default – If True, the account should be used by default with the provided identity.
  • email – The Email address associated with the identity.
del_identity(account, identity, authtype, default=False)[source]

Delete an identity’s membership association with an account.

Parameters:
  • account – The account name.
  • identity – The identity key name. For example x509 DN, or a username.
  • authtype – The type of the authentication (x509, gss, userpass).
  • default – If True, the account should be used by default with the provided identity.
delete_account(account)[source]

Sends the request to disable an account.

Parameters:account – the name of the account.
Returns:True is account was disabled successfully. False otherwise.
Raises AccountNotFound:
 if account doesn’t exist.
delete_account_attribute(account, key)[source]

Delete an attribute for an account.

Parameters:
  • account – The account name.
  • key – The attribute key.
get_account(account)[source]

Sends the request to get information about a given account.

Parameters:account – the name of the account.
Returns:a list of attributes for the account. None if failure.
Raises AccountNotFound:
 if account doesn’t exist.
get_account_limit(account, rse)[source]

List the account rse limits of this account for the specific rse.

Parameters:
  • account – The account name.
  • rse – The rse name.
get_account_limits(account)[source]

List the account rse limits of this account.

Parameters:account – The account name.
get_account_usage(account, rse=None)[source]

List the account usage for one or all rses of this account.

Parameters:
  • account – The account name.
  • rse – The rse name.
list_account_attributes(account)[source]

List the attributes for an account.

Parameters:account – The account name.
list_account_rules(account)[source]

List the associated rules of an account.

Parameters:account – The account name.
list_accounts(account_type=None, identity=None)[source]

Sends the request to list all rucio accounts.

Parameters:
  • type – The account type
  • identity – The identity key name. For example x509 DN, or a username.
Returns:

a list containing account info dictionary for all rucio accounts.

Raises AccountNotFound:
 

if account doesn’t exist.

list_identities(account)[source]

List all identities on an account.

Parameters:account – The account name.
set_account_status(account, status)[source]

Set the status of an account.

Parameters:
  • account – Name of the account.
  • status – The status for the account.
whoami()[source]

Get information about account whose token is used

Returns:a list of attributes for the account. None if failure.
Raises AccountNotFound:
 if account doesn’t exist.