Webdav
Classes¶
TLSHTTPAdapter ¶
Class to force the SSL protocol to latest TLS
_PropfindFile
dataclass
¶
_PropfindFile(href, size)
_PropfindResponse
dataclass
¶
_PropfindResponse(files)
Contains all the files from a PROPFIND response.
Functions¶
parse
classmethod
¶
parse(document)
Parses the XML document of a WebDAV PROPFIND response.
The PROPFIND response is described in RFC 4918.
This method expects the document root to be a node with tag {DAV:}multistatus
.
PARAMETER | DESCRIPTION |
---|---|
document
|
XML document to parse.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
The parsed response. |
RAISES | DESCRIPTION |
---|---|
ValueError
|
if the XML document couldn't be parsed. |
Default ¶
Default(protocol_attr, rse_settings, logger=logging.log)
Implementing access to RSEs using the webDAV protocol.
Functions¶
connect ¶
connect(credentials=None)
Establishes the actual connection to the referred RSE.
PARAMETER | DESCRIPTION |
---|---|
credentials
|
Provides information to establish a connection to the referred storage system. For WebDAV connections these are ca_cert, cert, auth_type, timeout
TYPE:
|
path2pfn ¶
path2pfn(path)
Returns a fully qualified PFN for the file referred by path.
PARAMETER | DESCRIPTION |
---|---|
path
|
The path to the file.
|
RETURNS | DESCRIPTION |
---|---|
Fully qualified PFN. |
exists ¶
exists(pfn)
Checks if the requested file is known by the referred RSE.
PARAMETER | DESCRIPTION |
---|---|
pfn
|
Physical file name
|
RETURNS | DESCRIPTION |
---|---|
True if the file exists, False if it doesn't |
get ¶
get(pfn, dest='.', transfer_timeout=None)
Provides access to files stored inside connected the RSE.
PARAMETER | DESCRIPTION |
---|---|
pfn
|
Physical file name of requested file
|
dest
|
Name and path of the files when stored at the client
DEFAULT:
|
transfer_timeout
|
Transfer timeout (in seconds)
DEFAULT:
|
put ¶
put(
source,
target,
source_dir=None,
transfer_timeout=None,
progressbar=False,
)
Allows to store files inside the referred RSE.
PARAMETER | DESCRIPTION |
---|---|
source
|
Physical file name
|
target
|
Name of the file on the storage system e.g. with prefixed scope
|
rename ¶
rename(pfn, new_pfn)
Allows to rename a file stored inside the connected RSE.
PARAMETER | DESCRIPTION |
---|---|
pfn
|
Current physical file name
|
delete ¶
delete(pfn)
Deletes a file from the connected RSE.
PARAMETER | DESCRIPTION |
---|---|
pfn
|
Physical file name
|
mkdir ¶
mkdir(directory)
Internal method to create directories
PARAMETER | DESCRIPTION |
---|---|
directory
|
Name of the directory that needs to be created
|
ls ¶
ls(filename)
Internal method to list files/directories
PARAMETER | DESCRIPTION |
---|---|
filename
|
Name of the directory that needs to be created
|
stat ¶
stat(path)
Returns the stats of a file.
PARAMETER | DESCRIPTION |
---|---|
path
|
path to file
|
RETURNS | DESCRIPTION |
---|---|
a dict with filesize of the file provided in path as a key. |
RAISES | DESCRIPTION |
---|---|
ServiceUnavailable
|
if some generic error occurred in the library. |
SourceNotFound
|
if the source file was not found on the referred storage. |
RSEAccessDenied
|
in case of permission issue. |
get_space_usage ¶
get_space_usage()
Get RSE space usage information.
RETURNS | DESCRIPTION |
---|---|
a list with dict containing 'totalsize' and 'unusedsize' |
RAISES | DESCRIPTION |
---|---|
ServiceUnavailable
|
if some generic error occurred in the library. |
NoRename ¶
NoRename(protocol_attr, rse_settings, logger=logging.log)
Implementing access to RSEs using the WebDAV protocol but without renaming files on upload/download. Necessary for some storage endpoints.
Initializes the object with information about the referred RSE.
PARAMETER | DESCRIPTION |
---|---|
protocol_attr
|
Properties of the requested protocol.
|
rse_settings
|
The RSE settings.
|
logger
|
Optional decorated logger that can be passed from the calling daemons or servers.
DEFAULT:
|