Replica Rest API

Overview

Resource Operation Description
BadReplicasStates GET /replicas/bad/states List bad replicas.
  POST /replicas/bad Declare bad replicas.
BadReplicasSummary GET /replicas/bad/summary List bad replicas by incident.
DatasetReplicas GET /replicas/(scope)/(name)/datasets List dataset replicas.
ListReplicas POST /replicas/list List all replicas for did.
Replicas PUT /replicas/ update replicas state.
  POST /replicas/ create replicas at RSE
  DELETE /replicas/ Delete replica at RSE.
  GET /replicas/(scope)/(name) List all replicas for did
ReplicasDIDs POST /replicas/dids List DIDs for replicas.
ReplicasRSE GET /replicas/rse/(rse) List dataset replicas per RSE.
SuspiciousReplicas POST /replicas/suspicious Declare suspicious replicas.

Details

GET /replicas/bad/summary

Return a summary of the bad replicas by incident.

Query Parameters:
 
  • rse_expression – The RSE expression.
  • from_date – The start date.
  • to_date – The end date.
Response Headers:
 
Status Codes:
Returns:

List of bad replicas by incident.

GET /replicas/bad/states

List the bad or suspicious replicas by states.

Query Parameters:
 
  • state – The state of the file (SUSPICIOUS or BAD).
  • rse – The RSE name.
  • younger_than – date in format “%Y-%m-%dT%H:%M:%S.%f” to select bad replicas younger than this date.
  • older_than – date in format “%Y-%m-%dT%H:%M:%S.%f” to select bad replicas older than this date.
  • limit – The maximum number of replicas returned.
  • list_pfns – Flag to include pfns.
Response Headers:
 
Status Codes:
Returns:

List of dicts of bad file replicas.

POST /replicas/suspicious

Declare a list of suspicious replicas.

Request JSON Object:
 
  • pfns (string) – The list of PFNs.
  • reason (string) – The reason of the loss.
Response Headers:
 
Status Codes:
Returns:

A list of not successfully declared files.

POST /replicas/list

List all replicas for data identifiers.

Request Headers:
 
  • HTTP_ACCEPT – application/metalink4+xml
Query Parameters:
 
  • schemes – A list of schemes to filter the replicas.
  • sort – Requested sorting of the result, e.g., ‘geoip’, ‘closeness’, ‘dynamic’, ‘ranking’.
Request JSON Object:
 
  • dids (list) – list of DIDs.
  • schemes (list) – A list of schemes to filter the replicas.
  • unavailable (bool) – Also include unavailable replicas.
  • all_states (bool) – Return all replicas whatever state they are in. Adds an extra ‘states’ entry in the result dictionary.
  • rse_expression (string) – The RSE expression to restrict on a list of RSEs.
  • client_location (dict) – Client location dictionary for PFN modification {‘ip’, ‘fqdn’, ‘site’}.
  • sort (bool) – Requested sorting of the result, e.g., ‘geoip’, ‘closeness’, ‘dynamic’, ‘ranking’.
  • domain (string) – The network domain for the call, either None, ‘wan’ or ‘lan’. None is fallback to ‘wan’, ‘all’ is both [‘lan’,’wan’]
Response Headers:
 
Status Codes:
Returns:

A dictionary containing all replicas information.

Returns:

A metalink description of replicas if metalink(4)+xml is specified in Accept:

POST /replicas/dids

List the DIDs associated to a list of replicas.

Request JSON Object:
 
  • pfns (string) – The list of PFNs.
  • rse (string) – The RSE name.
Response Headers:
 
Status Codes:
Returns:

A list of dictionaries containing the mapping PFNs to DIDs.

POST /replicas/bad

Declare a list of bad replicas.

Request JSON Object:
 
  • pfns (string) – The list of PFNs.
  • reason (string) – The reason of the loss.
Response Headers:
 
Status Codes:
Returns:

A list of not successfully declared files.

PUT /replicas/

Update a file replicas state at a given RSE.

Request JSON Object:
 
  • rse (string) – The RSE name.
  • files (list) – list of dicts with ‘scope’, ‘name’ and ‘state’.
Status Codes:
POST /replicas/

Create file replicas at a given RSE.

Request JSON Object:
 
  • rse (string) – The RSE name.
  • files (list) – list of dicts with ‘scope’, ‘name’, ‘bytes’, ‘meta’ and ‘adler32’.
  • ignore_availability (bool) – Flag to ignore the RSE blacklisting.
Status Codes:
DELETE /replicas/

Delete file replicas at a given RSE.

Request JSON Object:
 
  • rse (string) – The RSE name.
  • files (list) – list of dicts with ‘scope’, ‘name’.
  • ignore_availability (bool) – Flag to ignore the RSE blacklisting.
Status Codes:
GET /replicas/(scope)/(name)

List all replicas for data identifiers.

HTTP Success:
200 OK
HTTP Error:
401 Unauthorized 500 InternalError
Request Headers:
 
  • HTTP_ACCEPT – application/metalink4+xml
Parameters:
  • scope – data identifier scope.
  • name – data identifier name.
Response Headers:
 
Status Codes:
Returns:

A dictionary containing all replicas information.

Returns:

A metalink description of replicas if metalink(4)+xml is specified in Accept:

GET /replicas/rse/(rse)

List dataset replicas per RSE.

Response Headers:
 
Status Codes:
Returns:

A dictionary containing all replicas on the RSE.

GET /replicas/(scope)/(name)/datasets

List dataset replicas.

Query Parameters:
 
  • deep – Flag to ennable lookup at the file level.
Response Headers:
 
Status Codes:
Returns:

A dictionary containing all replicas information.