Replica Methods

rucio.api.replica.add_replicas(rse, files, issuer, ignore_availability=False)

Bulk add file replicas.

Parameters:
  • rse – The RSE name.
  • files – The list of files.
  • issuer – The issuer account.
  • ignore_availability – Ignore the RSE blacklisting.
Returns:

True is successful, False otherwise

rucio.api.replica.declare_bad_file_replicas(pfns, reason, issuer)

Declare a list of bad replicas.

Parameters:
  • pfns – The list of PFNs.
  • reason – The reason of the loss.
  • issuer – The issuer account.
rucio.api.replica.declare_suspicious_file_replicas(pfns, reason, issuer)

Declare a list of bad replicas.

Parameters:
  • pfns – The list of PFNs.
  • reason – The reason of the loss.
  • issuer – The issuer account.
rucio.api.replica.delete_replicas(rse, files, issuer, ignore_availability=False)

Bulk delete file replicas.

Parameters:
  • rse – The RSE name.
  • files – The list of files.
  • issuer – The issuer account.
  • ignore_availability – Ignore the RSE blacklisting.
Returns:

True is successful, False otherwise

rucio.api.replica.get_bad_replicas_summary(rse_expression=None, from_date=None, to_date=None)

List the bad file replicas summary. Method used by the rucio-ui. :param rse_expression: The RSE expression. :param from_date: The start date. :param to_date: The end date. :param session: The database session in use.

rucio.api.replica.get_did_from_pfns(pfns, rse)

Get the DIDs associated to a PFN on one given RSE

Parameters:
  • pfns – The list of PFNs.
  • rse – The RSE name.
Returns:

A dictionary {pfn: {‘scope’: scope, ‘name’: name}}

rucio.api.replica.list_bad_replicas_status(state=BAD, rse=None, younger_than=None, older_than=None, limit=None, list_pfns=False)

List the bad file replicas history states. Method used by the rucio-ui. :param state: The state of the file (SUSPICIOUS or BAD). :param rse: The RSE name. :param younger_than: datetime object to select bad replicas younger than this date. :param older_than: datetime object to select bad replicas older than this date. :param limit: The maximum number of replicas returned.

rucio.api.replica.list_dataset_replicas(scope, name, deep=False)
Parameters:
  • scope – The scope of the dataset.
  • name – The name of the dataset.
  • deep – Lookup at the file level.
Returns:

A list of dict dataset replicas

rucio.api.replica.list_datasets_per_rse(rse, filters=None, limit=None)
Parameters:
  • scope – The scope of the dataset.
  • name – The name of the dataset.
  • filters – dictionary of attributes by which the results should be filtered.
  • limit – limit number.
  • session – Database session to use.
Returns:

A list of dict dataset replicas

rucio.api.replica.list_replicas(dids, schemes=None, unavailable=False, request_id=None, ignore_availability=True, all_states=False, rse_expression=None, client_location=None, domain=None)

List file replicas for a list of data identifiers.

Parameters:
  • dids – The list of data identifiers (DIDs).
  • schemes – A list of schemes to filter the replicas. (e.g. file, http, …)
  • unavailable – Also include unavailable replicas in the list.
  • request_id – ID associated with the request for debugging.
  • all_states – Return all replicas whatever state they are in. Adds an extra ‘states’ entry in the result dictionary.
  • rse_expression – The RSE expression to restrict replicas on a set of RSEs.
  • client_location – Client location dictionary for PFN modification {‘ip’, ‘fqdn’, ‘site’}
  • domain – The network domain for the call, either None, ‘wan’ or ‘lan’. Compatibility fallback: None falls back to ‘wan’.
rucio.api.replica.update_replicas_states(rse, files, issuer)

Update File replica information and state.

Parameters:
  • rse – The RSE name.
  • files – The list of files.
  • issuer – The issuer account.