Skip to content

Ruleclient

Classes

RuleClient

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

RuleClient class for working with replication rules

Functions

add_replication_rule
add_replication_rule(
    dids,
    copies,
    rse_expression,
    priority=3,
    lifetime=None,
    grouping="DATASET",
    notify="N",
    source_replica_expression=None,
    activity=None,
    account=None,
    meta=None,
    ignore_availability=False,
    purge_replicas=False,
    ask_approval=False,
    asynchronous=False,
    locked=False,
    delay_injection=None,
    comment=None,
    weight=None,
)
PARAMETER DESCRIPTION
dids

The data identifier set.

TYPE: Sequence[dict[str, str]]

copies

The number of replicas.

TYPE: int

rse_expression

Boolean string expression to give the list of RSEs.

TYPE: str

priority

Priority of the transfers.

TYPE: int DEFAULT: 3

lifetime

The lifetime of the replication rules (in seconds).

TYPE: Optional[int] DEFAULT: None

grouping

ALL - All files will be replicated to the same RSE. DATASET - All files in the same dataset will be replicated to the same RSE. NONE - Files will be completely spread over all allowed RSEs without any grouping considerations at all.

TYPE: str DEFAULT: 'DATASET'

notify

Notification setting for the rule (Y, N, C).

TYPE: str DEFAULT: 'N'

source_replica_expression

RSE Expression for RSEs to be considered for source replicas.

TYPE: Optional[str] DEFAULT: None

activity

Transfer Activity to be passed to FTS.

TYPE: Optional[str] DEFAULT: None

account

The account owning the rule.

TYPE: Optional[str] DEFAULT: None

meta

Metadata, as dictionary.

TYPE: Optional[str] DEFAULT: None

ignore_availability

Option to ignore the availability of RSEs.

TYPE: bool DEFAULT: False

purge_replicas

When the rule gets deleted purge the associated replicas immediately.

TYPE: bool DEFAULT: False

ask_approval

Ask for approval of this replication rule.

TYPE: bool DEFAULT: False

asynchronous

Create rule asynchronously by judge-injector.

TYPE: bool DEFAULT: False

locked

If the rule is locked, it cannot be deleted.

TYPE: bool DEFAULT: False

delay_injection

TYPE: Optional[int] DEFAULT: None

comment

Comment about the rule.

TYPE: Optional[str] DEFAULT: None

weight

If the weighting option of the replication rule is used, the choice of RSEs takes their weight into account.

TYPE: Optional[int] DEFAULT: None

delete_replication_rule
delete_replication_rule(rule_id, purge_replicas=None)

Deletes a replication rule and all associated locks.

PARAMETER DESCRIPTION
rule_id

The id of the rule to be deleted

TYPE: str

purge_replicas

Immediately delete the replicas.

TYPE: Optional[bool] DEFAULT: None

get_replication_rule
get_replication_rule(rule_id)

Get a replication rule.

PARAMETER DESCRIPTION
rule_id

The id of the rule to be retrieved.

TYPE: str

update_replication_rule
update_replication_rule(rule_id, options)
PARAMETER DESCRIPTION
rule_id

The id of the rule to be retrieved.

TYPE: str

options

Options dictionary.

TYPE: dict[str, Any]

reduce_replication_rule
reduce_replication_rule(
    rule_id, copies, exclude_expression=None
)
PARAMETER DESCRIPTION
rule_id

Rule to be reduced.

TYPE: str

copies

Number of copies of the new rule.

TYPE: int

exclude_expression

RSE Expression of RSEs to exclude.

TYPE: Optional[str] DEFAULT: None

move_replication_rule
move_replication_rule(rule_id, rse_expression, override)

Move a replication rule to another RSE and, once done, delete the original one.

PARAMETER DESCRIPTION
rule_id

Rule to be moved.

TYPE: str

rse_expression

RSE expression of the new rule.

TYPE: str

override

Configurations to update for the new rule.

TYPE: Mapping[str, Any]

approve_replication_rule
approve_replication_rule(rule_id)
PARAMETER DESCRIPTION
rule_id

Rule to be approved.

TYPE: str

deny_replication_rule
deny_replication_rule(rule_id, reason=None)
PARAMETER DESCRIPTION
rule_id

Rule to be denied.

TYPE: str

reason

Reason for denying the rule.

TYPE: Optional[str] DEFAULT: None

list_replication_rule_full_history
list_replication_rule_full_history(scope, name)

List the rule history of a DID.

PARAMETER DESCRIPTION
scope

The scope of the DID.

TYPE: Union[str, bytes]

name

The name of the DID.

TYPE: Union[str, bytes]

examine_replication_rule
examine_replication_rule(rule_id)

Examine a replication rule for errors during transfer.

PARAMETER DESCRIPTION
rule_id

Rule to be denied.

TYPE: str

list_replica_locks
list_replica_locks(rule_id)

List details of all replica locks for a rule.

PARAMETER DESCRIPTION
rule_id

Rule to be denied.

TYPE: str

list_replication_rules
list_replication_rules(filters=None)

List all replication rules which match a filter

PARAMETER DESCRIPTION
filters

dictionary of attributes by which the rules should be filtered

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

RETURNS DESCRIPTION
Iterator[dict[str, Any]]

True if successful, otherwise false.

Functions