Skip to content

Rclone

Default(protocol_attr, rse_settings, logger=logging.log)

Implementing access to RSEs using the rclone protocol.

Initializes the object with information about the referred RSE.

Parameters:

Name Type Description Default
props

Properties derived from the RSE Repository

required

setuphostname(protocols)

Initializes the rclone object with information about protocols in the referred RSE.

Parameters:

Name Type Description Default
protocols

Protocols in the RSE

required

path2pfn(path)

Returns a fully qualified PFN for the file referred by path.

Parameters:

Name Type Description Default
path

The path to the file.

required

Returns:

Type Description

Fully qualified PFN.

exists(pfn)

Checks if the requested file is known by the referred RSE.

Parameters:

Name Type Description Default
pfn

Physical file name

required

Returns:

Type Description

True if the file exists, False if it doesn't

stat(path)

Returns the stats of a file.

Parameters:

Name Type Description Default
path

path to file

required

Returns:

Type Description

a dict with two keys, filesize and an element of GLOBALLY_SUPPORTED_CHECKSUMS.

Raises:

Type Description
ServiceUnavailable

if some generic error occurred in the library.

pfn2path(pfn)

Returns the path of a file given the pfn, i.e. scheme, user and hostname are subtracted from the pfn.

Parameters:

Name Type Description Default
path

pfn of a file

required

Returns:

Type Description

path.

lfns2pfns(lfns)

Returns a fully qualified PFN for the file referred by path.

Parameters:

Name Type Description Default
path

The path to the file.

required

Returns:

Type Description

Fully qualified PFN.

connect()

Establishes the actual connection to the referred RSE.

close()

Closes the connection to RSE.

get(pfn, dest, transfer_timeout=None)

Provides access to files stored inside connected the RSE.

Parameters:

Name Type Description Default
pfn

Physical file name of requested file

required
dest

Name and path of the files when stored at the client

required
transfer_timeout

Transfer timeout (in seconds) - dummy

None

put(filename, target, source_dir, transfer_timeout=None)

Allows to store files inside the referred RSE.

Parameters:

Name Type Description Default
source

path to the source file on the client file system

required
target

path to the destination file on the storage

required
source_dir

Path where the to be transferred files are stored in the local file system

required
transfer_timeout

Transfer timeout (in seconds) - dummy

None

Raises:

Type Description
DestinationNotAccessible

if the destination storage was not accessible.

ServiceUnavailable

if some generic error occurred in the library.

SourceNotFound

if the source file was not found on the referred storage.

delete(pfn)

Deletes a file from the connected RSE.

Parameters:

Name Type Description Default
pfn

Physical file name

required

Raises:

Type Description
ServiceUnavailable

if some generic error occurred in the library.

SourceNotFound

if the source file was not found on the referred storage.

rename(pfn, new_pfn)

Allows to rename a file stored inside the connected RSE.

Parameters:

Name Type Description Default
pfn

Current physical file name

required

Raises:

Type Description
DestinationNotAccessible

if the destination storage was not accessible.

ServiceUnavailable

if some generic error occurred in the library.

SourceNotFound

if the source file was not found on the referred storage.