Account Methods

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

Bases: rucio.client.baseclient.BaseClient

Account client class for working with rucio accounts

ACCOUNTS_BASEURL = 'accounts'
add_account(account, type, email)

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)

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, password=None)

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.

  • password – Password if authtype is userpass.

del_identity(account, identity, authtype)

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)

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)

Delete an attribute for an account.

Parameters
  • account – The account name.

  • key – The attribute key.

get_account(account)

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_limits(account, rse_expression, locality)

Return the correct account limits for the given locality.

Parameters
  • account – The account name.

  • rse_expression – Valid RSE expression

  • locality – The scope of the account limit. ‘local’ or ‘global’.

get_account_usage_history(account, rse)

List the account usage history of this account on rse.

Parameters
  • account – The account name.

  • rse – The rse name.

get_global_account_limit(account, rse_expression)

List the account limit for the specific RSE expression.

Parameters
  • account – The account name.

  • rse_expression – The rse expression.

get_global_account_limits(account)

List all RSE expression limits of this account.

Parameters

account – The account name.

get_global_account_usage(account, rse_expression=None)

List the account usage for one or all RSE expressions of this account.

Parameters
  • account – The account name.

  • rse_expression – The rse expression.

get_local_account_limit(account, rse)

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

Parameters
  • account – The account name.

  • rse – The rse name.

get_local_account_limits(account)

List the account rse limits of this account.

Parameters

account – The account name.

get_local_account_usage(account, rse=None)

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)

List the attributes for an account.

Parameters

account – The account name.

list_account_rules(account)

List the associated rules of an account.

Parameters

account – The account name.

list_accounts(account_type=None, identity=None, filters=None)

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.

  • filters – A dictionnary key:account attribute to use for the filtering

Returns

a list containing account info dictionary for all rucio accounts.

Raises

AccountNotFound – if account doesn’t exist.

list_identities(account)

List all identities on an account.

Parameters

account – The account name.

update_account(account, key, value)

Update a property of an account.

Parameters
  • account – Name of the account.

  • key – Account property like status.

  • value – Property value.

whoami()

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.