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:
|
| 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".
|
|
| 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:
|
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:
|
parameters
|
Dictionary of properties to update. Format as
{"name": "updated_value"}.
Parameters are described in
TYPE:
|
| 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:
|
| 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:
|
| 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:
|
key
|
The attribute key.
TYPE:
|
| 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:
|
params
|
Attributes of the protocol. Supported are:
Extended attributes required for each protocol can be seen listed in the documentation for each protocol implementation
(e.g.
TYPE:
|
| 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:
|
protocol_domain
|
The scope of the protocol.
TYPE:
|
operation
|
The name of the requested operation. If None, all operations are queried.
TYPE:
|
default
|
Only return the default protocol
TYPE:
|
scheme
|
The identifier of the requested protocol.
TYPE:
|
| 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:
|
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:
|
protocol_domain
|
The scope of the protocol. (e.g., 'wan' or 'lan').
TYPE:
|
operation
|
The name of the requested operation (read, write, or delete). If None, 'write' is used by default.
TYPE:
|
scheme
|
The identifier of the requested protocol (https, davs, etc), by default None.
TYPE:
|
| 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:
|
scheme
|
The identifier of the protocol.
TYPE:
|
hostname
|
The hostname of the protocol.
TYPE:
|
port
|
The port of the protocol.
TYPE:
|
| 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:
|
scheme
|
The identifier of the protocol.
TYPE:
|
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:
|
hostname
|
The hostname of the protocol.
TYPE:
|
port
|
The port of the protocol.
TYPE:
|
| 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:
|
domain
|
The domain in which priorities should be swapped (e.g., 'wan' or 'lan').
TYPE:
|
operation
|
The operation for which priorities should be swapped (e.g., 'read', 'write', or 'delete').
TYPE:
|
scheme_a
|
The scheme of one of the two protocols to be swapped (e.g., 'http').
TYPE:
|
scheme_b
|
The scheme of the other protocol to be swapped (e.g., 'http').
TYPE:
|
| 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:
|
qos_policy
|
The QoS policy to add.
TYPE:
|
| 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:
|
qos_policy
|
The QoS policy to delete.
TYPE:
|
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:
|
source
|
The information source, any string used for accounting and documenting source of usage inforrmation.
TYPE:
|
used
|
The used space in bytes
TYPE:
|
free
|
The free space in bytes
TYPE:
|
files
|
The number of files, optional.
TYPE:
|
| 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:
|
filters
|
Optional filters to apply. ** source ** [str]: Source of usage ** per_account ** [bool]: Calculate usage by account
TYPE:
|
| 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:
|
filters
|
Optional filters to apply. ** source ** [str]: Source of usage
TYPE:
|
| 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:
|
name
|
The name of the limit.
TYPE:
|
value
|
Limit given in bytes.
TYPE:
|
| 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:
|
| 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:
|
name
|
The name of the limit, can be any limit made with
TYPE:
|
| 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:
|
destination
|
The destination RSE name.
TYPE:
|
parameters
|
Dicionary in the format {"distance": int}.
TYPE:
|
bidirectional
|
If True, also adds the distance from dest to src.
TYPE:
|
| 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:
|
destination
|
The destination RSE.
TYPE:
|
parameters
|
Updated distance in the form {"distance": int}.
TYPE:
|
bidirectional
|
If True, also updates the distance from dest to src.
TYPE:
|
| 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:
|
destination
|
The destination
TYPE:
|
bidirectional
|
If True, also deletes the distance from dest to src.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
True if successful.
|
|
| RAISES | DESCRIPTION |
|---|---|
RSENotFound
|
If either of the RSEs doesn't exist. |