Skip to content

Accountclient

Classes

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,
    logger=LOG,
)

Account client class for working with rucio accounts

Functions

add_account
add_account(account, type_, email)

Sends the request to create a new account.

PARAMETER DESCRIPTION
account

the name of the account.

TYPE: str

type_

The account type

TYPE: str

email

The Email address associated with the account.

TYPE: str

RETURNS DESCRIPTION
bool

True if account was created successfully else False.

RAISES DESCRIPTION
Duplicate

if account already exists.

delete_account
delete_account(account)

Sends the request to disable an account.

PARAMETER DESCRIPTION
account

the name of the account.

TYPE: str

RETURNS DESCRIPTION
bool

True is account was disabled successfully. False otherwise.

RAISES DESCRIPTION
AccountNotFound

if account doesn't exist.

get_account
get_account(account)

Sends the request to get information about a given account.

PARAMETER DESCRIPTION
account

the name of the account.

TYPE: str

RETURNS DESCRIPTION
Optional[dict[str, Any]]

a list of attributes for the account. None if failure.

RAISES DESCRIPTION
AccountNotFound

if account doesn't exist.

update_account
update_account(account, key, value)

Update a property of an account.

PARAMETER DESCRIPTION
account

Name of the account.

TYPE: str

key

Account property like status.

TYPE: str

value

Property value.

TYPE: Any

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

Sends the request to list all rucio accounts.

PARAMETER DESCRIPTION
type

The account type

identity

The identity key name. For example x509 DN, or a username.

TYPE: Optional[str] DEFAULT: None

filters

A dictionary key:account attribute to use for the filtering

TYPE: Optional[dict[str, Any]] DEFAULT: None

RETURNS DESCRIPTION
Iterator[dict[str, Any]]

a list containing account info dictionary for all rucio accounts.

RAISES DESCRIPTION
AccountNotFound

if account doesn't exist.

whoami
whoami()

Get information about account whose token is used

RETURNS DESCRIPTION
Optional[dict[str, Any]]

a list of attributes for the account. None if failure.

RAISES DESCRIPTION
AccountNotFound

if account doesn't exist.

add_identity
add_identity(
    account,
    identity,
    authtype,
    email,
    default=False,
    password=None,
)

Adds a membership association between identity and account.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

identity

The identity key name. For example x509 DN, or a username.

TYPE: str

authtype

The type of the authentication (x509, gss, userpass).

TYPE: str

default

If True, the account should be used by default with the provided identity.

TYPE: bool DEFAULT: False

email

The Email address associated with the identity.

TYPE: str

password

Password if authtype is userpass.

TYPE: Optional[str] DEFAULT: None

del_identity
del_identity(account, identity, authtype)

Delete an identity's membership association with an account.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

identity

The identity key name. For example x509 DN, or a username.

TYPE: str

authtype

The type of the authentication (x509, gss, userpass).

TYPE: str

list_identities
list_identities(account)

List all identities on an account.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

list_account_rules
list_account_rules(account)

List the associated rules of an account.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

get_account_limits
get_account_limits(account, rse_expression, locality)

Return the correct account limits for the given locality.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

rse_expression

Valid RSE expression

TYPE: str

locality

The scope of the account limit. 'local' or 'global'.

TYPE: str

get_global_account_limit
get_global_account_limit(account, rse_expression)

List the account limit for the specific RSE expression.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

rse_expression

The rse expression.

TYPE: str

get_global_account_limits
get_global_account_limits(account)

List all RSE expression limits of this account.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

get_local_account_limits
get_local_account_limits(account)

List the account rse limits of this account.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

get_local_account_limit
get_local_account_limit(account, rse)

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

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

rse

The rse name.

TYPE: str

get_local_account_usage
get_local_account_usage(account, rse=None)

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

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

rse

The rse name.

TYPE: Optional[str] DEFAULT: None

get_global_account_usage
get_global_account_usage(account, rse_expression=None)

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

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

rse_expression

The rse expression.

TYPE: Optional[str] DEFAULT: None

get_account_usage_history
get_account_usage_history(account, rse)

List the account usage history of this account on rse.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

rse

The rse name.

TYPE: str

list_account_attributes
list_account_attributes(account)

List the attributes for an account.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

add_account_attribute
add_account_attribute(account, key, value)

Adds an attribute to an account.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

key

The attribute key.

TYPE: str

value

The attribute value.

TYPE: Any

delete_account_attribute
delete_account_attribute(account, key)

Delete an attribute for an account.

PARAMETER DESCRIPTION
account

The account name.

TYPE: str

key

The attribute key.

TYPE: str

Functions