Skip to content

Rseclient

Classes

RSEClient

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

RSE client class for working with rucio RSEs

Methods:

get_rse
get_rse(rse)

Returns details about an RSE.

PARAMETER DESCRIPTION
rse

Name of the RSE

TYPE: str

RETURNS DESCRIPTION
Dictionary of settings and protocol attributes.
Additional attributes can be added beyond the ones listed below by using "RSEClient.add_rse_attribute"
and read with "RSEClient.list_rse_attributes".

availability: int: [Deprecated]

availability_delete: bool: Can the replicas on the RSE be deleted?

availability_read: bool: Can replicas on the RSE be read?

availability_write: bool: Can the RSE be written to?

credentials: Optional[str]: Crediental for an attached protocol (if any)

deterministic: bool: Are the PFNs on the RSE set deteriminstically?

domain: dict|list: Domains (lan/wan) the RSE can act on (and premissions, if dictionary). Form of {"wan": {"read"...}, "lan": {...}} if dictionary, else ["wan", "lan"].

id: str: ID of the RSE

lfn2pfn_algorithm: Optional[str]: Algorithm for LFN to PFNs

protocols: list[dict]: Describing the protocols used by the RSE for storage

qos_class: Optional[str]: QoS Policy

rse: str: Name of the RSE

rse_type: str: Storage type of RSE, typically "DISK" or "TAPE"

sign_url: Optional[str]: Signing service configuration, if configured.

staging_area: bool: Whether the RSE is a staging area.

verify_checksum: bool: Whether checksums are verified.

volatile: bool: Whether the RSE is volatile.

RAISES DESCRIPTION
RSENotFound:

if the referred RSE was not found in the database.

Examples:

Example

Query an RSE via an RSE Expression and get it attributes of all RSEs that match

from rucio.client.client import Client

rse_client = Client()
rse_expression="rse_type=DISK"
possible_rses = [rse['rse'] for rse in rse_client.list_rses(rse_expression)]
for rse in possible_rses:
    print(rse_client.get_rse(rse))
See Also

rucio.client.rseclient.RSEClient.add_rse_attribute rucio.client.rseclient.RSEClient.update_rse rucio.client.rseclient.RSEClient.list_rses rucio.client.rseclient.RSEClient.list_rse_attributes

add_rse
add_rse(rse, **kwargs)

Create a new RSE

PARAMETER DESCRIPTION
rse

The name of the RSE.

TYPE: str

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

[Deprecated] integer availability bitmask.

availability_read

Whether replicas on the RSE can be read.

availability_write

Whether replicas can be written to the RSE.

availability_delete

Whether replicas on the RSE can be deleted.

RETURNS DESCRIPTION
True if RSE was created successfully created.
RAISES DESCRIPTION
Duplicate

If RSE already exists.

InvalidObject

If the RSE name does not match the given schema.

AccessDenied

If the issuer cannot create the RSE.

Examples:

Example

Create a new disk RSE and add an attribute

from rucio.client.client import Client

rse_client = Client()
rse_name="MyNewRSE"
rse_client.add_rse(rse_name, rse_type="DISK")

rse_client.add_rse_attribute(rse_name, key="TIER", value="3")  # Custom organizational attribute
See Also

rucio.client.rseclient.RSEClient.delete_rse rucio.client.rseclient.RSEClient.update_rse rucio.client.rseclient.RSEClient.add_protocol rucio.client.rseclient.RSEClient.list_rses

update_rse
update_rse(rse, parameters)

Update RSE properties like availability or name.

PARAMETER DESCRIPTION
rse

The name of the RSE.

TYPE: str

parameters

Dictionary of properties to update. Format as {"name": "updated_value"}. Parameters are described in rucio.client.rseclient.RSEClient.add_rse.

TYPE: dict[str, Any]

RETURNS DESCRIPTION
True if RSE was updated successfully.
RAISES DESCRIPTION
AccessDenied

If the issuer cannot update the RSE.

RSENotFound

If the RSE does not exist.

Examples:

Example

Correct the RSE type after an RSE has been made.

from rucio.client.client import Client

rse_client = Client()
rse_name="MyNewRSE"
rse_client.add_rse(rse_name, rse_type="DISK")
rse_client.update_rse(rse_name, rse_type="TAPE")
See Also

rucio.client.rseclient.RSEClient.delete_rse rucio.client.rseclient.RSEClient.add_rse rucio.client.rseclient.RSEClient.add_protocol

delete_rse
delete_rse(rse)

Sends the request to delete a rse.

PARAMETER DESCRIPTION
rse

The name of the RSE.

TYPE: str

RETURNS DESCRIPTION
True if RSE was deleted successfully.
RAISES DESCRIPTION
RSENotFound

If the RSE was not found.

RSEOperationNotSupported

If the RSE is not empty.

See Also

rucio.client.rseclient.RSEClient.add_rse rucio.client.rseclient.RSEClient.update_rse

list_rses
list_rses(rse_expression=None)

List all RSEs that match the given RSE Expression. RSE Expressions are constructed using attributes, settings, and the name of the RSE, using logical operators and wildcards.

PARAMETER DESCRIPTION
rse_expression

RSE expression to use as filter.

TYPE: Optional[str] DEFAULT: None

RETURNS DESCRIPTION
All RSE names matching the RSE expression, if given, otherwise all RSEs with their settings.

Examples:

Example

Print RSEs, either all on the instance or filtered by expression.

from rucio.client.client import Client
rse_client = Client()

for rse in rse_client.list_rses():
    print(rse)  # Print all RSEs with settings

for rse in rse_client.list_rses("rse_type=TAPE"):
    print(rse) # Print all RSEs of type "TAPE".
    # Prints with {"rse": <RSE_NAME>}

for rse in rse_client.list_rses("RSE_*"):
    print(rse) # Print all RSEs that have names starting with "RSE_"

for rse in rse_client.list_rses("rse_type=DISK&availability_read=True"):
    print(rse) # Print all RSEs that are of type "DISK" and have read availability set to True
See Also

rucio.client.rseclient.RSEClient.get_rse

add_rse_attribute
add_rse_attribute(rse, key, value)

Add an RSE attribute. Attributes are key/value pairs that can be used in policies, constructing RSE expressions, or defining custom properties (such as LFN2PFN algorithms.)

Parameters

rse: The name of the RSE. key: The attribute key. value: The attribute value.

Returns

True if RSE attribute was created successfully.

Raises

Duplicate If RSE attribute already exists.

Examples

??? Example

 Add an attribute

 ```python
 from rucio.client.client import Client

 rse_client = Client()
 rse_name="MyRSE"
 rse_client.add_rse_attribute(rse_name, key="TIER", value="3")  # Custom organizational attribute

 ```
See Also

rucio.client.rseclient.RSEClient.delete_rse_attribute rucio.client.rseclient.RSEClient.get_rse rucio.client.rseclient.RSEClient.update_rse

delete_rse_attribute
delete_rse_attribute(rse, key)

Delete an RSE attribute.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

key

The attribute key.

TYPE: str

RETURNS DESCRIPTION
True if RSE attribute was deleted successfully.
RAISES DESCRIPTION
RSEAttributeNotFound

If the attribute to delete was not found for the given RSE.

Examples:

Example

Remove an attribute

from rucio.client.client import Client

rse_client = Client()
rse_name="MyRSE"
rse_client.delete_rse_attribute(rse_name, key="TIER")
See Also

rucio.client.rseclient.RSEClient.add_rse_attribute rucio.client.rseclient.RSEClient.list_rse_attributes rucio.client.rseclient.RSEClient.update_rse

list_rse_attributes
list_rse_attributes(rse)

List all RSE attributes.

Parameters

rse The RSE name.

Returns

A dict with the RSE attribute name/value pairs. Attributes returned can be any attribute previously added to the RSE via rucio.client.rseclient.RSEClient.add_rse_attribute.

Raises

RSENotFound RSE does not exist.

Examples

??? Example List all attributes of an RSE

from rucio.client.client import Client
rse_client = Client()
rse_name="MyRSE"
attributes = rse_client.list_rse_attributes(rse_name)
for key, value in attributes.items():
    print(f"{key}: {value}")

> TIER: 3
> TEST: True

See Also

rucio.client.rseclient.RSEClient.add_rse_attribute rucio.client.rseclient.RSEClient.delete_rse_attribute

add_protocol
add_protocol(rse, params)

Add a new protocol for an RSE. This is required to read/write data onto the RSE.

Multiple protocols can be added to the same RSE, but they cannot have the same scheme, hostname, and port.

PARAMETER DESCRIPTION
rse

The name of the RSE.

TYPE: str

params

Attributes of the protocol. Supported are:

  • scheme: identifier of this protocol
  • hostname: hostname for this protocol (default = localhost)
  • port: port for this protocol (default = 0)
  • prefix: string used as a prefix for this protocol when generating the PFN (default = None)
  • impl: qualified name of the implementation class for this protocol (mandatory)
  • domain: dict[Literal["lan", "wan"], dict] with the keys:
    • read: integer representing the priority of this protocol for read operations (default = -1)
    • write: integer representing the priority of this protocol for write operations (default = -1)
    • delete: integer representing the priority of this protocol for delete operations (default = -1)
    • third_party_copy_read
    • third_party_copy_write
  • extended_attributes: miscellaneous protocol specific information

Extended attributes required for each protocol can be seen listed in the documentation for each protocol implementation (e.g. rucio.rse.protocols.posix.Default for the POSIX protocol).

TYPE: dict[str, Any]

RETURNS DESCRIPTION
True if protocol was created successfully.
RAISES DESCRIPTION
Duplicate

If protocol with same hostname, port and protocol identifier already exists for the given RSE.

RSENotFound

If the RSE doesn't exist.

InvalidObject

If params is missing mandatory attributes to create the protocol.

AccessDenied

If not authorized.

Examples:

Example

Adding a POSIX protocol to an RSE, suitable for testing

from rucio.client.client import Client

rse_client = Client()
rse_name="MyRSE"
protocol_params = {
    'scheme': 'file',
    'hostname': 'localhost',
    'port': 0,
    'prefix': '/path/posix_rse',
    'impl': 'rucio.rse.protocols.posix.Default',
    'domains': {
        'lan': {'read': 1, 'write': 1, 'delete': 1},
        'wan': {'read': 1, 'write': 1, 'delete': 1,
                'third_party_copy_read': 1, 'third_party_copy_write': 1}
    },
}
rse_client.add_protocol(rse_name, protocol_params)
See Also

rucio.client.rseclient.RSEClient.get_rse rucio.client.rseclient.RSEClient.get_protocols rucio.client.rseclient.RSEClient.delete_protocols

get_protocols
get_protocols(
    rse,
    protocol_domain="ALL",
    operation=None,
    default=False,
    scheme=None,
)

Get protocol information for an RSE

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

protocol_domain

The scope of the protocol.

TYPE: RSE_SUPPORTED_PROTOCOL_DOMAINS_LITERAL DEFAULT: 'ALL'

operation

The name of the requested operation. If None, all operations are queried.

TYPE: Optional[RSE_ALL_SUPPORTED_PROTOCOL_OPERATIONS_LITERAL] DEFAULT: None

default

Only return the default protocol

TYPE: bool DEFAULT: False

scheme

The identifier of the requested protocol.

TYPE: Optional[SUPPORTED_PROTOCOLS_LITERAL] DEFAULT: None

RETURNS DESCRIPTION
A list of dicts with details about each matching protocol.

Each protocol contains the following keys: - scheme [str]: identifier - hostname [str]: hostname - port [int]: port - prefix [str]: string used as a prefix for this protocol when generating the PFN - impl [str]: qualified name of the implementation class for this protocol - domains [dict]: dictionary with domain (lan/wan) as keys and permissions for operations as values - extended_attributes [Optional[dict]]: miscellaneous protocol specific information

If only one protocol matches the query, a single dict is returned instead of a list.

RAISES DESCRIPTION
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.

Examples:

Example

Query different protocols that exist for MyRSE

from rucio.client.client import Client

rse_client = Client()
rse_name="MyRSE"
rse_client.get_protocols(rse_name)  # Get all protocols
rse_client.get_protocols(rse_name, default=True) # Get default protocol
# Get protocols that can be used for read operations on wan domain
rse_client.get_protocols(rse_name, protocol_domain='wan', operation='read')
rse_client.get_protocols(rse_name, scheme='file') # Get protocol with file scheme
See Also

rucio.client.rseclient.RSEClient.get_rse rucio.client.rseclient.RSEClient.add_protocol rucio.client.rseclient.RSEClient.delete_protocols

lfns2pfns
lfns2pfns(
    rse,
    lfns,
    protocol_domain="ALL",
    operation=None,
    scheme=None,
)

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.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

lfns

A list of LFN strings to translate to PFNs. LFNs are typically written as "scope:name", though the exact format can vary depending on the Rucio instance's implementation of ScopeExtraction. Contact your Rucio administrator if you are unsure about the expected format of LFNs for your instance.

TYPE: Iterable[str]

protocol_domain

The scope of the protocol. (e.g., 'wan' or 'lan').

TYPE: RSE_SUPPORTED_PROTOCOL_DOMAINS_LITERAL DEFAULT: 'ALL'

operation

The name of the requested operation (read, write, or delete). If None, 'write' is used by default.

TYPE: Optional[RSE_ALL_SUPPORTED_PROTOCOL_OPERATIONS_LITERAL] DEFAULT: None

scheme

The identifier of the requested protocol (https, davs, etc), by default None.

TYPE: Optional[SUPPORTED_PROTOCOLS_LITERAL] DEFAULT: None

RETURNS DESCRIPTION
A dictionary of LFN / PFN pairs.
RAISES DESCRIPTION
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.

Examples:

Example
    from rucio.client.client import Client
    rse_client = Client()
    rse_name="MyRSE"
    lfns = ["scope1:name1", "scope2:name2"] # Exact format depends on ScopeExtraction implimentation for your rucio instance
    pfns = rse_client.lfns2pfns(rse_name, lfns)  # Get PFNs for the LFNs on MyRSE
    > {"scope1:name1": "protocol://host:port/prefix/scope1/name1",
    >  "scope2:name2": "protocol://host:port/prefix/scope2/name2"}
delete_protocols
delete_protocols(rse, scheme, hostname=None, port=None)

Deletes matching protocols from RSE. Protocols using the same identifier can be distinguished by hostname and port. If not hostname and port and not provided, all protocols with the same scheme will be deleted.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

scheme

The identifier of the protocol.

TYPE: SUPPORTED_PROTOCOLS_LITERAL

hostname

The hostname of the protocol.

TYPE: Optional[str] DEFAULT: None

port

The port of the protocol.

TYPE: Optional[int] DEFAULT: None

RETURNS DESCRIPTION
True if success.
RAISES DESCRIPTION
RSEProtocolNotSupported

If no matching protocol entry could be found.

RSENotFound

If the RSE doesn't exist.

AccessDenied

If not authorized.

Examples:

Example

Delete a specific protocol by providing scheme, hostname, and port

from rucio.client.client import Client

rse_client = Client()
rse_name="MyRSE"
# Only removes the protocol on host1:8443
rse_client.delete_protocols(rse_name, scheme='srm', hostname='host1', port=8443)

Delete all protocols with a specific scheme by providing only the scheme

from rucio.client.client import Client

rse_client = Client()
rse_name="MyRSE"
# Removes all SRM protocols, regardless of hostname and port
rse_client.delete_protocols(rse_name, scheme='srm')
See Also

rucio.client.rseclient.RSEClient.get_protocols rucio.client.rseclient.RSEClient.add_protocol

update_protocols
update_protocols(
    rse, scheme, data, hostname=None, port=None
)

Updates matching protocols from RSE. Protocols are uniquely defined by a combination of identifier, hostname, and port. If hostname and port are not provided, there must be a scheme without hostname and port.

** Note ** - You cannot change the hostname and port of a protocol. To change this, the protocol must be deleted and re-made with the new hostname and port.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

scheme

The identifier of the protocol.

TYPE: SUPPORTED_PROTOCOLS_LITERAL

data

A dict providing the new values of the protocol attributes. Keys must match column names in database. ** domains : Dict with domain (lan/wan) as keys and permissions for operations as values. Example: {"lan": {"read": 1, "write": 1, "delete": 1}, "wan": {"read": 1, "write": 1, "delete": 1}} ** prefix : String used as a prefix for this protocol when generating the PFN. ** impl : Qualified name of the implementation class for this protocol. ** extended_attributes : Dict with protocol specific information

TYPE: dict[str, Any]

hostname

The hostname of the protocol.

TYPE: Optional[str] DEFAULT: None

port

The port of the protocol.

TYPE: Optional[int] DEFAULT: None

RETURNS DESCRIPTION
True if success.
RAISES DESCRIPTION
RSEProtocolNotSupported

If no matching protocol entry could be found.

RSENotFound

If the RSE doesn't exist.

AccessDenied

If not authorized.

Examples:

Example

Update the prefix attribute of a protocol

from rucio.client.client import Client
rse_client = Client()
rse_name="MyRSE"

rse_client.get_protocols(rse_name, scheme='srm')
> [{'scheme': 'srm', 'hostname': 'host1', 'port': 8443, 'prefix': '/old/prefix', ...},
>  {'scheme': 'srm', 'hostname': 'host2', 'port': 8443, 'prefix': '/old/prefix', ...}]

# The hostname and ports must be supplied
rse_client.update_protocols(rse_name, scheme='srm', data={'prefix': '/new/prefix'})
> rucio.common.exception.RSEProtocolNotSupported: RSE does not support requested protocol.
> Details: RSE 'MyRse' does not support protocol 'srm' for hostname 'None' on port 'None'

# Supply hostname and port to correctly update protocols
rse_client.update_protocols(rse_name, scheme='srm', hostname="host1", port=8443,  data={'prefix': '/new/prefix'})
See Also

rucio.client.rseclient.RSEClient.get_protocols rucio.client.rseclient.RSEClient.add_protocol

swap_protocols
swap_protocols(rse, domain, operation, scheme_a, scheme_b)

Swaps the priorities of the provided operation.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

domain

The domain in which priorities should be swapped (e.g., 'wan' or 'lan').

TYPE: RSE_SUPPORTED_PROTOCOL_DOMAINS_LITERAL

operation

The operation for which priorities should be swapped (e.g., 'read', 'write', or 'delete').

TYPE: RSE_ALL_SUPPORTED_PROTOCOL_OPERATIONS_LITERAL

scheme_a

The scheme of one of the two protocols to be swapped (e.g., 'http').

TYPE: SUPPORTED_PROTOCOLS_LITERAL

scheme_b

The scheme of the other protocol to be swapped (e.g., 'http').

TYPE: SUPPORTED_PROTOCOLS_LITERAL

RETURNS DESCRIPTION
True if successful, False if there are not protocols cannot be cleanly swapped
RAISES DESCRIPTION
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.

add_qos_policy
add_qos_policy(rse, qos_policy)

Add a QoS policy to an RSE.

PARAMETER DESCRIPTION
rse

The name of the RSE.

TYPE: str

qos_policy

The QoS policy to add.

TYPE: str

RETURNS DESCRIPTION
True if successful.
RAISES DESCRIPTION
Duplicate

If the QoS policy already exists.

delete_qos_policy
delete_qos_policy(rse, qos_policy)

Delete a QoS policy from an RSE.

PARAMETER DESCRIPTION
rse

The name of the RSE.

TYPE: str

qos_policy

The QoS policy to delete.

TYPE: str

session

The database session in use.

RETURNS DESCRIPTION
True if successful.
RAISES DESCRIPTION
RSENotFound

If the RSE doesn't exist.

QoSPolicyNotFound

If the QoS policy doesn't exist.

list_qos_policies
list_qos_policies(rse)

List all QoS policies of an RSE.

:param rse_id: The id of the RSE. :param session: The database session in use.

:returns: List containing all QoS policies.

set_rse_usage
set_rse_usage(rse, source, used, free, files=None)

Set RSE usage information. Added to the history of the RSE usage, for monitoring and accounting.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

source

The information source, any string used for accounting and documenting source of usage inforrmation.

TYPE: str

used

The used space in bytes

TYPE: int

free

The free space in bytes

TYPE: int

files

The number of files, optional.

TYPE: Optional[int] DEFAULT: None

RETURNS DESCRIPTION
True if successful

Examples:

Example

Set RSE usage information

from rucio.client.client import Client
Client().set_rse_usage("MyRse", source="automated_script", used=1000000000, free=500000000)
See Also

rucio.client.rseclient.RSEClient.get_rse_usage rucio.client.rseclient.RSEClient.list_rse_usage_history

get_rse_usage
get_rse_usage(rse, filters=None)

Get RSE usage information as set by RSEClient.set_rse_usage. Will only show the most recent usage of a source.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

filters

Optional filters to apply. ** source ** [str]: Source of usage ** per_account ** [bool]: Calculate usage by account

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

RETURNS DESCRIPTION
List of dictionaries, containing the following:

** rse_id ** [str]: The RSE id ** source ** [str]: Source of usage ** used ** [int]: Used space in bytes ** free ** [int]: Free space in bytes ** files ** [int|None]: Number of files ** updated_at ** [datetime.datetime]: Timestamp of the usage information

See Also

rucio.client.rseclient.RSEClient.set_rse_usage rucio.client.rseclient.RSEClient.list_rse_usage_history

list_rse_usage_history
list_rse_usage_history(rse, filters=None)

List RSE usage history information.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

filters

Optional filters to apply. ** source ** [str]: Source of usage

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

RETURNS DESCRIPTION
List of dictionaries, containing the following:

** rse_id ** [str]: The RSE id ** source ** [str]: Source of usage ** used ** [int]: Used space in bytes ** free ** [int]: Free space in bytes ** files ** [int|None]: Number of files ** updated_at ** [datetime.datetime]: Timestamp of the usage information

Will show all historical usage information for the RSE, including the current usage information as set by `RSEClient.set_rse_usage`
See Also

rucio.client.rseclient.RSEClient.set_rse_usage rucio.client.rseclient.RSEClient.list_rse_usage_history

set_rse_limits
set_rse_limits(rse, name, value)

Set the limit for the amount of data that can be stored on the RSE. If an RSE limit with the same name already exists, it will be overwritten.

The name "MaxSpaceAvailable" will be used to when selecting RSEs create replicas if multiple RSEs match rule requirements and have the avaiable quotas.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

name

The name of the limit.

TYPE: str

value

Limit given in bytes.

TYPE: int

RETURNS DESCRIPTION
True if successful.

Examples:

Example

Set a limit for the amount of data that can be stored on an RSE

from rucio.client.client import Client
rse_client = Client()
rse_name="MyRSE"
rse_client.set_rse_limits(rse_name, name="MaxSpaceAvailable", value=1000000000000)  # Set a limit of 1TB for the RSE

See Also

rucio.client.rseclient.RSEClient.get_rse_limits rucio.client.rseclient.RSEClient.delete_rse_limits

get_rse_limits
get_rse_limits(rse)

Get RSE limits.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

RETURNS DESCRIPTION
Dictionaries with the name and value of each limit for the RSE.

Examples:

Example

Get RSE limits ```python from rucio.client.client import Client rse_client = Client() rse_name="MyRSE" rse_client.get_rse_limits(rse_name)

{"MaxSpaceAvailable": 1000000000000, "AnotherLimit": 500000000000}

See Also

rucio.client.rseclient.RSEClient.set_rse_limits rucio.client.rseclient.RSEClient.delete_rse_limits

delete_rse_limits
delete_rse_limits(rse, name)

Delete RSE limit information.

PARAMETER DESCRIPTION
rse

The RSE name.

TYPE: str

name

The name of the limit, can be any limit made with set_rse_limits.

TYPE: str

RETURNS DESCRIPTION
True if successful, will not fail if the limit did not exist.
RAISES DESCRIPTION
RSENotFound

If the RSE doesn't exist.

See Also

rucio.client.rseclient.RSEClient.set_rse_limits rucio.client.rseclient.RSEClient.get_rse_limits

add_distance
add_distance(
    source, destination, parameters, bidirectional=False
)

Add a distance between two RSEs. Distances are used to deterimine paths between RSEs during transfers, a lower distance will be preferred over a higher one.

RSEs must have distances between them for them to be used in multi-hop transfers.

PARAMETER DESCRIPTION
source

The source RSE name.

TYPE: str

destination

The destination RSE name.

TYPE: str

parameters

Dicionary in the format {"distance": int}.

TYPE: dict[str, int]

bidirectional

If True, also adds the distance from dest to src.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
True if successful.
RAISES DESCRIPTION
Duplicate

If a distance between the RSEs already exists.

RSENotFound

If either of the RSEs doesn't exist.

Examples:

Example

Add a distance between two RSEs

from rucio.client.client import Client
rse_client = Client()
rse_client.add_distance(source="RSE1", destination="RSE2", parameters={"distance": 10})

update_distance
update_distance(
    source, destination, parameters, bidirectional=False
)

Update distances between RSEs.

If the distance does not exist, it will not be created.

PARAMETER DESCRIPTION
source

The source RSE.

TYPE: str

destination

The destination RSE.

TYPE: str

parameters

Updated distance in the form {"distance": int}.

TYPE: dict[str, int]

bidirectional

If True, also updates the distance from dest to src.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
True if successful.

Examples:

Example

Add a distance between two RSEs

from rucio.client.client import Client
rse_client = Client()
rse_client.add_distance(source="RSE1", destination="RSE2", parameters={"distance": 10})
rse_client.update_distance(source="RSE1", destination="RSE2", parameters={"distance": 20})  # Update the distance to 20

See Also

rucio.client.rseclient.RSEClient.add_distance

get_distance
get_distance(source, destination)

Get distances between rses.

Param

source : The source RSE. destination : The destination RSE.

RETURNS DESCRIPTION
A list of dictionaries with the distance information.

Each dictionary contains the following keys: ** created_at ** [datetime.datetime]: Datetime when the distance was created. ** updated_at ** [datetime.datetime]: Datetime when the distance was last updated. ** src_rse_id ** [str]: ID of the source RSE. ** src_rse ** [str]: Name of source RSE. ** dest_rse_id ** [str]: ID of the destination RSE. ** dest_rse ** [str]: Name of destination RSE. ** distance ** [int]: Value of distance between RSEs. ** ranking ** [int]: Legacy name for distance, same value as distance.

delete_distance
delete_distance(source, destination, bidirectional=False)

Delete distances with the given RSE ids.

PARAMETER DESCRIPTION
source

The source

TYPE: str

destination

The destination

TYPE: str

bidirectional

If True, also deletes the distance from dest to src.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
True if successful.
RAISES DESCRIPTION
RSENotFound

If either of the RSEs doesn't exist.

Functions: