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:
|
type_
|
The account type
TYPE:
|
email
|
The Email address associated with the account.
TYPE:
|
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:
|
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:
|
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:
|
key
|
Account property like status.
TYPE:
|
value
|
Property value.
TYPE:
|
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:
|
filters
|
A dictionary key:account attribute to use for the filtering
TYPE:
|
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:
|
identity
|
The identity key name. For example x509 DN, or a username.
TYPE:
|
authtype
|
The type of the authentication (x509, gss, userpass).
TYPE:
|
default
|
If True, the account should be used by default with the provided identity.
TYPE:
|
email
|
The Email address associated with the identity.
TYPE:
|
password
|
Password if authtype is userpass.
TYPE:
|
del_identity ¶
del_identity(account, identity, authtype)
Delete an identity's membership association with an account.
PARAMETER | DESCRIPTION |
---|---|
account
|
The account name.
TYPE:
|
identity
|
The identity key name. For example x509 DN, or a username.
TYPE:
|
authtype
|
The type of the authentication (x509, gss, userpass).
TYPE:
|
list_identities ¶
list_identities(account)
List all identities on an account.
PARAMETER | DESCRIPTION |
---|---|
account
|
The account name.
TYPE:
|
list_account_rules ¶
list_account_rules(account)
List the associated rules of an account.
PARAMETER | DESCRIPTION |
---|---|
account
|
The account name.
TYPE:
|
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:
|
rse_expression
|
Valid RSE expression
TYPE:
|
locality
|
The scope of the account limit. 'local' or 'global'.
TYPE:
|
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:
|
rse_expression
|
The rse expression.
TYPE:
|
get_global_account_limits ¶
get_global_account_limits(account)
List all RSE expression limits of this account.
PARAMETER | DESCRIPTION |
---|---|
account
|
The account name.
TYPE:
|
get_local_account_limits ¶
get_local_account_limits(account)
List the account rse limits of this account.
PARAMETER | DESCRIPTION |
---|---|
account
|
The account name.
TYPE:
|
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:
|
rse
|
The rse name.
TYPE:
|
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:
|
rse
|
The rse name.
TYPE:
|
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:
|
rse_expression
|
The rse expression.
TYPE:
|
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:
|
rse
|
The rse name.
TYPE:
|
list_account_attributes ¶
list_account_attributes(account)
List the attributes for an account.
PARAMETER | DESCRIPTION |
---|---|
account
|
The account name.
TYPE:
|
add_account_attribute ¶
add_account_attribute(account, key, value)
Adds an attribute to an account.
PARAMETER | DESCRIPTION |
---|---|
account
|
The account name.
TYPE:
|
key
|
The attribute key.
TYPE:
|
value
|
The attribute value.
TYPE:
|
delete_account_attribute ¶
delete_account_attribute(account, key)
Delete an attribute for an account.
PARAMETER | DESCRIPTION |
---|---|
account
|
The account name.
TYPE:
|
key
|
The attribute key.
TYPE:
|