Mock
Default(protocol_attr, rse_settings, logger=None)
¶
Implementing access to RSEs using the local filesystem.
Initializes the object with information about the referred RSE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
props
|
Properties derived from the RSE Repository |
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 |
connect()
¶
Establishes the actual connection to the referred RSE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
credentials
|
Provide all necessary information to establish a connection to the referred storage system. Some is loaded from the repository inside the RSE class and some must be provided specific for the SFTP protocol like username, password, private_key, private_key_pass, port. For details about possible additional parameters and details about their usage see the pysftp.Connection() documentation. NOTE: the host parametrer is overwritten with the value provided by the repository |
required |
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 |
put(source, target, source_dir=None, transfer_timeout=None)
¶
Allows to store files inside the referred RSE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
Physical file name |
required | |
target
|
Name of the file on the storage system e.g. with prefixed scope |
required |
delete(pfn)
¶
Deletes a file from the connected RSE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pfn
|
Physical file name |
required |
bulk_delete(pfns)
¶
Submits an async task to bulk delete files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pfns
|
list of pfns to delete |
required |
Raises:
Type | Description |
---|---|
TransferAPIError
|
if unexpected response from the service. |
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 |