roboto.storage.file_service
Module Contents
FileService
Application service for performing upload and download to the Roboto Platform.
Agnostic to object store provider.
Parameters
roboto_client Optional[roboto.object_store_registry Optional[roboto.FileService.download()
Download files from the Roboto Platform.
Parameters
files collections.Sequence of files to download, each with source_uri and destination_path.
association roboto.Association of the files to download.
caller_org_id Optional[str]Optional organization ID for cross-org access.
on_progress Optional[roboto.Optional callback to be periodically called with the number of bytes downloaded.
Return type
FileService.upload()
Upload the given files and return which file record each one created.
Parameters
files collections.association roboto.destination_paths collections.batch_size intdevice_id Optional[str]caller_org_id Optional[str]on_progress Optional[roboto.Returns
Mapping from each uploaded local path to the ID of the file record it created.
Raises
ValueErrorIf two of the given files resolve to the same destination path: their uploads would overwrite each other and only one could appear in the returned mapping. Files without a destination_paths entry are destined for their own basename, so two like-named files from different directories collide unless given distinct destinations.
OSErrorIf a given file cannot be read.