Skip to content

Uploadclient

Classes

UploadClient

UploadClient(_client=None, logger=None, tracing=True)

Initialises the basic settings for an UploadClient object

PARAMETER DESCRIPTION
_client
  • Optional: rucio.client.client.Client object. If None, a new object will be created.

TYPE: Optional[Client] DEFAULT: None

logger
  • Optional: logging.Logger object. If None, default logger will be used.

TYPE: Optional[LoggerFunction] DEFAULT: None

Functions

upload
upload(
    items,
    summary_file_path=None,
    traces_copy_out=None,
    ignore_availability=False,
    activity=None,
)
PARAMETER DESCRIPTION
items

List of dictionaries. Each dictionary describing a file to upload. Keys: path - path of the file that will be uploaded rse - rse expression/name (e.g. 'CERN-PROD_DATADISK') where to upload the file did_scope - Optional: custom did scope (Default: user.) did_name - Optional: custom did name (Default: name of the file) dataset_scope - Optional: custom dataset scope dataset_name - Optional: custom dataset name dataset_meta - Optional: custom metadata for dataset impl - Optional: name of the protocol implementation to be used to upload this item. force_scheme - Optional: force a specific scheme (if PFN upload this will be overwritten) (Default: None) pfn - Optional: use a given PFN (this sets no_register to True, and no_register becomes mandatory) no_register - Optional: if True, the file will not be registered in the rucio catalogue register_after_upload - Optional: if True, the file will be registered after successful upload lifetime - Optional: the lifetime of the file after it was uploaded transfer_timeout - Optional: time after the upload will be aborted guid - Optional: guid of the file recursive - Optional: if set, parses the folder structure recursively into collections

TYPE: Iterable[FileToUploadDict]

summary_file_path

Optional: a path where a summary in form of a json file will be stored

TYPE: Optional[str] DEFAULT: None

traces_copy_out

reference to an external list, where the traces should be uploaded

TYPE: Optional[list[TraceBaseDict]] DEFAULT: None

ignore_availability

ignore the availability of a RSE

TYPE: bool DEFAULT: False

activity

the activity set to the rule if no dataset is specified

TYPE: Optional[str] DEFAULT: None

RETURNS DESCRIPTION
int

0 on success

RAISES DESCRIPTION
InputValidationError

if any input arguments are in a wrong format

RSEWriteBlocked

if a given RSE is not available for writing

NoFilesUploaded

if no files were successfully uploaded

NotAllFilesUploaded

if not all files were successfully uploaded

preferred_impl
preferred_impl(rse_settings, domain)

Finds the optimum protocol impl preferred by the client and supported by the remote RSE.

PARAMETER DESCRIPTION
rse_settings

dictionary containing the RSE settings

TYPE: RSESettingsDict

domain

The network domain, either 'wan' (default) or 'lan'

TYPE: str

RAISES DESCRIPTION
RucioException(msg)

general exception with msg for more details.

Functions