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
Functions¶
get_rse ¶
get_rse(rse)
Returns details about the referred RSE.
PARAMETER | DESCRIPTION |
---|---|
rse
|
Name of the referred RSE
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
A dict containing all attributes of the referred RSE |
RAISES | DESCRIPTION |
---|---|
RSENotFound
|
if the referred RSE was not found in the database |
add_rse ¶
add_rse(rse, **kwargs)
Sends the request to 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
|
Availability.
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if location was created successfully else False. |
RAISES | DESCRIPTION |
---|---|
Duplicate
|
if rse already exists. |
update_rse ¶
update_rse(rse, parameters)
Update RSE properties like availability or name.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the name of the new rse.
TYPE:
|
parameters
|
A dictionary with property (name, read, write, delete as keys).
|
delete_rse ¶
delete_rse(rse)
Sends the request to delete a rse.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the name of the rse.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if location was created successfully else False. |
list_rses ¶
list_rses(rse_expression=None)
Sends the request to list all rucio locations(RSEs).
:rse_expression: RSE Expression to use as filter.
RETURNS | DESCRIPTION |
---|---|
Iterator[dict[str, Any]]
|
a list containing the names of all rucio locations. |
add_rse_attribute ¶
add_rse_attribute(rse, key, value)
Sends the request to add a RSE attribute.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the name of the rse.
TYPE:
|
key
|
the attribute key.
TYPE:
|
value
|
the attribute value.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if RSE attribute was created successfully else False. |
RAISES | DESCRIPTION |
---|---|
Duplicate
|
if RSE attribute already exists. |
delete_rse_attribute ¶
delete_rse_attribute(rse, key)
Sends the request to delete a RSE attribute.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the RSE name.
TYPE:
|
key
|
the attribute key.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if RSE attribute was deleted successfully else False. |
list_rse_attributes ¶
list_rse_attributes(rse)
Sends the request to get RSE attributes.
PARAMETER | DESCRIPTION |
---|---|
rse
|
The RSE name.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
A |
add_protocol ¶
add_protocol(rse, params)
Sends the request to create a new protocol for the given RSE.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the name of the rse.
TYPE:
|
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)
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if protocol was created successfully else False. |
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. |
KeyNotFound
|
if params is missing manadtory attributes to create the protocol. |
AccessDenied
|
if not authorized. |
get_protocols ¶
get_protocols(
rse,
protocol_domain="ALL",
operation=None,
default=False,
scheme=None,
)
Returns protocol information. Parameter combinations are: (operation OR default) XOR protocol.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the RSE name.
TYPE:
|
protocol_domain
|
The scope of the protocol. Supported are 'LAN', 'WAN', and 'ALL' (as default).
TYPE:
|
operation
|
The name of the requested operation (read, write, or delete). If None, all operations are queried.
TYPE:
|
default
|
Indicates if only the default operations should be returned.
TYPE:
|
scheme
|
The identifier of the requested protocol.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Any
|
A dict with details about each matching protocol. |
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. |
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.
TYPE:
|
protocol_domain
|
The scope of the protocol. Supported are 'LAN', 'WAN', and 'ALL' (as default).
TYPE:
|
operation
|
The name of the requested operation (read, write, or delete). If None, all operations are queried.
TYPE:
|
scheme
|
The identifier of the requested protocol (gsiftp, https, davs, etc).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, str]
|
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. |
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.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the RSE name.
TYPE:
|
scheme
|
identifier of the protocol.
TYPE:
|
hostname
|
hostname of the protocol.
TYPE:
|
port
|
port of the protocol.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
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. |
update_protocols ¶
update_protocols(
rse, scheme, data, hostname=None, port=None
)
Updates matching protocols from RSE. Protocol using the same identifier can be distinguished by hostname and port.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the RSE name.
TYPE:
|
scheme
|
identifier of the protocol.
TYPE:
|
data
|
A dict providing the new values of the protocol attributes. Keys must match column names in database.
TYPE:
|
hostname
|
hostname of the protocol.
TYPE:
|
port
|
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. |
KeyNotFound
|
if invalid data was provided for update. |
AccessDenied
|
if not authorized. |
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 i.e. wan or lan.
TYPE:
|
operation
|
the operation that should be swapped i.e. read, write, or delete.
TYPE:
|
scheme_a
|
the scheme of one of the two protocols to be swapped, e.g. srm.
TYPE:
|
scheme_b
|
the scheme of the other of the two protocols to be swapped, e.g. http.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
True if success. |
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 from an RSE.
PARAMETER | DESCRIPTION |
---|---|
rse_id
|
The id of the RSE.
|
qos_policy
|
The QoS policy to add.
TYPE:
|
session
|
The database session in use.
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if successful, except otherwise. |
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_id
|
The id of the RSE.
|
qos_policy
|
The QoS policy to delete.
TYPE:
|
session
|
The database session in use.
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if successful, silent failure if QoS policy does not exist. |
list_qos_policies ¶
list_qos_policies(rse)
List all QoS policies of an RSE.
PARAMETER | DESCRIPTION |
---|---|
rse_id
|
The id of the RSE.
|
session
|
The database session in use.
|
RETURNS | DESCRIPTION |
---|---|
list[str]
|
List containing all QoS policies. |
set_rse_usage ¶
set_rse_usage(rse, source, used, free, files=None)
Set RSE usage information.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the RSE name.
TYPE:
|
source
|
the information source, e.g. srm.
TYPE:
|
used
|
the used space in bytes.
TYPE:
|
free
|
the free in bytes.
TYPE:
|
files
|
the number of files
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if successful |
get_rse_usage ¶
get_rse_usage(rse, filters=None)
Get RSE usage information.
PARAMETER | DESCRIPTION |
---|---|
rse
|
the RSE name.
TYPE:
|
filters
|
dictionary of attributes by which the results should be filtered
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Iterator[dict[str, Any]]
|
True if successful, otherwise false. |
list_rse_usage_history ¶
list_rse_usage_history(rse, filters=None)
List RSE usage history information.
PARAMETER | DESCRIPTION |
---|---|
rse
|
The RSE name.
TYPE:
|
filters
|
dictionary of attributes by which the results should be filtered.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Iterator[dict[str, Any]]
|
list of dictionaries. |
set_rse_limits ¶
set_rse_limits(rse, name, value)
Set RSE limit information.
PARAMETER | DESCRIPTION |
---|---|
rse
|
The RSE name.
TYPE:
|
name
|
The name of the limit.
TYPE:
|
value
|
The feature value.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if successful |
get_rse_limits ¶
get_rse_limits(rse)
Get RSE limits.
PARAMETER | DESCRIPTION |
---|---|
rse
|
The RSE name.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Iterator[dict[str, Union[str, int]]]
|
An iterator of RSE limits as dicts with 'name' and 'value' as keys. |
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.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Literal[True]
|
True if successful |
add_distance ¶
add_distance(source, destination, parameters)
Add a src-dest distance.
PARAMETER | DESCRIPTION |
---|---|
source
|
The source.
TYPE:
|
destination
|
The destination.
TYPE:
|
parameters
|
A dictionary with property.
TYPE:
|
update_distance ¶
update_distance(source, destination, parameters)
Update distances with the given RSE ids.
PARAMETER | DESCRIPTION |
---|---|
source
|
The source.
TYPE:
|
destination
|
The destination.
TYPE:
|
parameters
|
A dictionary with property.
TYPE:
|
get_distance ¶
get_distance(source, destination)
Get distances between rses.
PARAMETER | DESCRIPTION |
---|---|
source
|
The source RSE.
TYPE:
|
destination
|
The destination RSE.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[dict[str, Union[str, int]]]
|
List of dictionaries. |
delete_distance ¶
delete_distance(source, destination)
Delete distances with the given RSE ids.
PARAMETER | DESCRIPTION |
---|---|
source
|
The source.
TYPE:
|
destination
|
The destination.
TYPE:
|