Skip to content

Lifetimeclient

Classes

LifetimeClient

LifetimeClient(
    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,
)

Lifetime client class for working with Lifetime Model exceptions

Functions

list_exceptions
list_exceptions(exception_id=None, states=None)

Lists lifetime model exceptions that allow extending data lifetimes beyond their configured policies.

The lifetime model exceptions are used to override the default lifecycle policies for data identifiers (files, datasets, containers, or archives) that need to be kept longer than usual. These exceptions can be filtered by their ID or approval state (this feature is not available yet).

PARAMETER DESCRIPTION
exception_id

The unique identifier of a specific exception. If provided, returns only that exception.

TYPE: Optional[str] DEFAULT: None

states

Filter exceptions by their states. Possible values are: - A (APPROVED): Exception was approved - R (REJECTED): Exception was rejected - W (WAITING): Exception is waiting for approval by an admin (or other authorized account)

TYPE: Optional[Sequence[LifetimeExceptionsState]] DEFAULT: None

RETURNS DESCRIPTION
Iterator[dict[str, Any]]

An iterator of dictionaries containing the exception details: - id: The unique identifier of the exception - scope: The scope of the data identifier - name: The name of the data identifier - did_type: Type of the data identifier: F (file), D (dataset), C (container), A (archive), X (deleted file), Y (deleted dataset), Z (deleted container) - account: The account that requested the exception - pattern: Pattern used for matching data identifiers - comments: User provided comments explaining the exception - state: Current state of the exception - created_at: When the exception was created (returned as timestamp string) - expires_at: When the exception expires (returned as timestamp string)

add_exception
add_exception(dids, account, pattern, comments, expires_at)

Creates a lifetime model exception request to extend the expiration date of data identifiers (DIDs).

These exceptions allow requesting extensions to DIDs' lifetimes, subject to approval and configured maximum extension periods. The request includes details about which DIDs should have extended lifetimes, who is requesting it, and why it's needed.

PARAMETER DESCRIPTION
dids

List of dictionaries containing the data identifiers to be excepted. Each dictionary must contain: - scope: The scope of the data identifier - name: The name of the data identifier

TYPE: list[dict[str, Any]]

account

The account requesting the exception

TYPE: str

pattern

Associated pattern for the exception request

TYPE: str

comments

Justification for why the exception is needed (e.g. "Needed for my XYZ analysis..")

TYPE: str

expires_at

When the exception should expire (datetime object)

TYPE: datetime

RETURNS DESCRIPTION
dict[str, Any]

A dictionary containing: - exceptions: Dictionary mapping exception IDs to lists of DIDs that were successfully added - unknown: List of DIDs that could not be found - not_affected: List of DIDs that did not qualify for an exception

Functions