Skip to content

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

Constructor of the BaseClient.

Parameters:

Name Type Description Default
rucio_host Optional[str]

The address of the rucio server, if None it is read from the config file.

None
rucio_port

The port of the rucio server, if None it is read from the config file.

required
auth_host Optional[str]

The address of the rucio authentication server, if None it is read from the config file.

None
auth_port

The port of the rucio authentication server, if None it is read from the config file.

required
account Optional[str]

The account to authenticate to rucio.

None
use_ssl

Enable or disable ssl for commucation. Default is enabled.

required
ca_cert Optional[str]

The path to the rucio server certificate.

None
auth_type Optional[str]

The type of authentication (e.g.: 'userpass', 'kerberos' ...)

None
creds Optional[dict[str, Any]]

Dictionary with credentials needed for authentication.

None
user_agent Optional[str]

Indicates the client.

'rucio-clients'
vo Optional[str]

The VO to authenticate into.

None
logger Logger

Logger object to use. If None, use the default LOG created by the module

LOG

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)

Parameters:

Name Type Description Default
dids Sequence[dict[str, str]]

The data identifier set.

required
copies int

The number of replicas.

required
rse_expression str

Boolean string expression to give the list of RSEs.

required
priority int

Priority of the transfers.

3
lifetime Optional[int]

The lifetime of the replication rules (in seconds).

None
grouping str

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.

'DATASET'
notify str

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

'N'
source_replica_expression Optional[str]

RSE Expression for RSEs to be considered for source replicas.

None
activity Optional[str]

Transfer Activity to be passed to FTS.

None
account Optional[str]

The account owning the rule.

None
meta Optional[str]

Metadata, as dictionary.

None
ignore_availability bool

Option to ignore the availability of RSEs.

False
purge_replicas bool

When the rule gets deleted purge the associated replicas immediately.

False
ask_approval bool

Ask for approval of this replication rule.

False
asynchronous bool

Create rule asynchronously by judge-injector.

False
locked bool

If the rule is locked, it cannot be deleted.

False
delay_injection Optional[int]
None
comment Optional[str]

Comment about the rule.

None
weight Optional[int]

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

None

delete_replication_rule(rule_id, purge_replicas=None)

Deletes a replication rule and all associated locks.

Parameters:

Name Type Description Default
rule_id str

The id of the rule to be deleted

required
purge_replicas Optional[bool]

Immediately delete the replicas.

None

get_replication_rule(rule_id)

Get a replication rule.

Parameters:

Name Type Description Default
rule_id str

The id of the rule to be retrieved.

required

update_replication_rule(rule_id, options)

Parameters:

Name Type Description Default
rule_id str

The id of the rule to be retrieved.

required
options dict[str, Any]

Options dictionary.

required

reduce_replication_rule(rule_id, copies, exclude_expression=None)

Parameters:

Name Type Description Default
rule_id str

Rule to be reduced.

required
copies int

Number of copies of the new rule.

required
exclude_expression Optional[str]

RSE Expression of RSEs to exclude.

None

move_replication_rule(rule_id, rse_expression, override)

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

Parameters:

Name Type Description Default
rule_id str

Rule to be moved.

required
rse_expression str

RSE expression of the new rule.

required
override Mapping[str, Any]

Configurations to update for the new rule.

required

approve_replication_rule(rule_id)

Parameters:

Name Type Description Default
rule_id str

Rule to be approved.

required

deny_replication_rule(rule_id, reason=None)

Parameters:

Name Type Description Default
rule_id str

Rule to be denied.

required
reason Optional[str]

Reason for denying the rule.

None

list_replication_rule_full_history(scope, name)

List the rule history of a DID.

Parameters:

Name Type Description Default
scope Union[str, bytes]

The scope of the DID.

required
name Union[str, bytes]

The name of the DID.

required

examine_replication_rule(rule_id)

Examine a replication rule for errors during transfer.

Parameters:

Name Type Description Default
rule_id str

Rule to be denied.

required

list_replica_locks(rule_id)

List details of all replica locks for a rule.

Parameters:

Name Type Description Default
rule_id str

Rule to be denied.

required

list_replication_rules(filters=None)

List all replication rules which match a filter

Parameters:

Name Type Description Default
filters Optional[dict[str, Any]]

dictionary of attributes by which the rules should be filtered

None

Returns:

Type Description
Iterator[dict[str, Any]]

True if successful, otherwise false.