Skip to main content

RSEClient

get_rse

Returns details about the referred RSE.

Arguments:

rse: Name of the referred RSE

Raises:

RSENotFound: if the referred RSE was not found in the database

Returns:

A dict containing all attributes of the referred RSE

add_rse

Sends the request to create a new RSE.

Arguments:

rse: the name of the rse.

deterministic: Boolean to know if the pfn is generated deterministically.

volatile: Boolean for RSE cache.

city: City for the RSE.

region_code: The region code for the RSE.

country_name: The country.

continent: The continent.

time_zone: Timezone.

staging_area: Staging area.

ISP: Internet service provider.

rse_type: RSE type.

latitude: Latitude coordinate of RSE.

longitude: Longitude coordinate of RSE.

ASN: Access service network.

availability: Availability.

Raises:

Duplicate: if rse already exists.

Returns:

True if location was created successfully else False.

update_rse

Update RSE properties like availability or name.

Arguments:

rse: the name of the new rse.

parameters: A dictionnary with property (name, read, write, delete as keys).

delete_rse

Sends the request to delete a rse.

Arguments:

rse: the name of the rse.

Returns:

True if location was created successfully else False.

list_rses

Sends the request to list all rucio locations(RSEs).

Returns:

a list containing the names of all rucio locations.

add_rse_attribute

Sends the request to add a RSE attribute.

Arguments:

rse: the name of the rse.

key: the attribute key.

value: the attribute value.

Raises:

Duplicate: if RSE attribute already exists.

Returns:

True if RSE attribute was created successfully else False.

delete_rse_attribute

Sends the request to delete a RSE attribute.

Arguments:

rse: the RSE name.

key: the attribute key.

Returns:

True if RSE attribute was deleted successfully else False.

list_rse_attributes

Sends the request to get RSE attributes.

Arguments:

rse: The RSE name.

Returns:

A dict with the RSE attribute name/value pairs.

add_protocol

Sends the request to create a new protocol for the given RSE.

Arguments:

rse: the name of the rse.

scheme: identifier of this protocol

params: Attributes of the protocol. Supported are: hostname: hostname for this protocol (default = localhost) port: port for this protocol (default = 0) prefix: string used as a prfeix for this protocol when generating the PFN (default = None) impl: qualified name of the implementation class for this protocol (mandatory) read: integer representing the priority of this procotol for read operations (default = -1) write: integer representing the priority of this procotol for write operations (default = -1) delete: integer representing the priority of this procotol for delete operations (default = -1) extended_attributes: miscellaneous protocol specific information e.g. spacetoken for SRM (default = None)

Raises:

Duplicate: if protocol with same hostname, port and protocol identifier already exists for the given RSE.

RSENotFound: if the RSE doesn't exist.

KeyNotFound: if params is missing manadtory attributes to create the protocol.

AccessDenied: if not authorized.

Returns:

True if protocol was created successfully else False.

get_protocols

Returns protocol information. Parameter comibantions are:

(operation OR default) XOR protocol.

Arguments:

rse: the RSE name.

protocol_domain: The scope of the protocol. Supported are 'LAN', 'WAN', and 'ALL' (as default).

operation: The name of the requested operation (read, write, or delete). If None, all operations are queried.

default: Indicates if only the default operations should be returned.

scheme: The identifier of the requested protocol.

Raises:

RSENotFound: if the RSE doesn't exist.

RSEProtocolNotSupported: if no matching protocol entry could be found.

RSEOperationNotSupported: if no matching protocol entry for the requested operation could be found.

Returns:

A list with details about each matching protocol.

lfns2pfns

Returns PFNs that should be used at a RSE, corresponding to requested LFNs.

The PFNs are generated for the RSE regardless of whether a replica exists for the LFN.

Arguments:

rse: the RSE name

lfns: A list of LFN strings to translate to PFNs.

protocol_domain: The scope of the protocol. Supported are 'LAN', 'WAN', and 'ALL' (as default).

operation: The name of the requested operation (read, write, or delete). If None, all operations are queried.

scheme: The identifier of the requested protocol (gsiftp, https, davs, etc).

Raises:

RSENotFound: if the RSE doesn't exist.

RSEProtocolNotSupported: if no matching protocol entry could be found.

RSEOperationNotSupported: if no matching protocol entry for the requested operation could be found.

Returns:

A dictionary of LFN / PFN pairs.

delete_protocols

Deletes matching protocols from RSE. Protocols using the same identifier can be

distinguished by hostname and port.

Arguments:

rse: the RSE name.

scheme: identifier of the protocol.

hostname: hostname of the protocol.

port: port of the protocol.

Raises:

RSEProtocolNotSupported: if no matching protocol entry could be found.

RSENotFound: if the RSE doesn't exist.

AccessDenied: if not authorized.

Returns:

True if success.

update_protocols

Updates matching protocols from RSE. Protocol using the same identifier can be

distinguished by hostname and port.

Arguments:

rse: the RSE name.

scheme: identifier of the protocol.

data: A dict providing the new values of the protocol attibutes. Keys must match column names in database.

hostname: hostname of the protocol.

port: port of the protocol.

Raises:

RSEProtocolNotSupported: if no matching protocol entry could be found.

RSENotFound: if the RSE doesn't exist.

KeyNotFound: if invalid data was provided for update.

AccessDenied: if not authorized.

Returns:

True if success.

swap_protocols

Swaps the priorities of the provided operation.

Arguments:

rse: the RSE name.

domain: the domain in which priorities should be swapped i.e. wan or lan.

operation: the operation that should be swapped i.e. read, write, or delete.

scheme_a: the scheme of one of the two protocols to be swapped, e.g. srm.

scheme_b: the scheme of the other of the two protocols to be swapped, e.g. http.

Raises:

RSEProtocolNotSupported: if no matching protocol entry could be found.

RSENotFound: if the RSE doesn't exist.

KeyNotFound: if invalid data was provided for update.

AccessDenied: if not authorized.

Returns:

True if success.

add_qos_policy

Add a QoS policy from an RSE.

Arguments:

rse_id: The id of the RSE.

qos_policy: The QoS policy to add.

session: The database session in use.

Raises:

Duplicate: If the QoS policy already exists.

Returns:

True if successful, except otherwise.

delete_qos_policy

Delete a QoS policy from an RSE.

Arguments:

rse_id: The id of the RSE.

qos_policy: The QoS policy to delete.

session: The database session in use.

Returns:

True if successful, silent failure if QoS policy does not exist.

list_qos_policies

List all QoS policies of an RSE.

Arguments:

rse_id: The id of the RSE.

session: The database session in use.

Returns:

List containing all QoS policies.

set_rse_usage

Set RSE usage information.

Arguments:

rse: the RSE name.

source: the information source, e.g. srm.

used: the used space in bytes.

free: the free in bytes.

files: the number of files

Returns:

True if successful, otherwise false.

get_rse_usage

Get RSE usage information.

Arguments:

rse: the RSE name.

filters: dictionary of attributes by which the results should be filtered

Returns:

True if successful, otherwise false.

list_rse_usage_history

List RSE usage history information.

Arguments:

rse: The RSE name.

filters: dictionary of attributes by which the results should be filtered.

Returns:

list of dictionnaries.

set_rse_limits

Set RSE limit information.

Arguments:

rse: The RSE name.

name: The name of the limit.

value: The feature value.

Returns:

True if successful, otherwise false.

get_rse_limits

Get RSE limits.

Arguments:

rse: The RSE name.

Returns:

True if successful, otherwise false.

delete_rse_limits

Delete RSE limit information.

Arguments:

rse: The RSE name.

name: The name of the limit.

Returns:

True if successful, otherwise false.

add_distance

Add a src-dest distance.

Arguments:

source: The source.

destination: The destination.

parameters: A dictionnary with property.

update_distance

Update distances with the given RSE ids.

Arguments:

source: The source.

destination: The destination.

parameters: A dictionnary with property.

get_distance

Get distances between rses.

Arguments:

source: The source RSE.

destination: The destination RSE.

Returns:

distance: List of dictionaries.

delete_distance

Delete distances with the given RSE ids.

Arguments:

source: The source.

destination: The destination.