flowserv.service.files.remote module
API service component that provides functionality to access, delete, and upload files at a remote RESTful API.
- class flowserv.service.files.remote.RemoteUploadFileService(descriptor: flowserv.service.descriptor.ServiceDescriptor)
Bases:
flowserv.service.files.base.UploadFileServiceAPI component that provides methods to access, delete and upload files for workflow user groups at a remote RESTful API.
- delete_file(group_id: str, file_id: str)
Delete file with given identifier that was previously uploaded.
Raises errors if the file or the workflow group does not exist or if the user is not authorized to delete the file.
- Parameters
group_id (string) – Unique workflow group identifier
file_id (string) – Unique file identifier
- Raises
- get_uploaded_file(group_id: str, file_id: str) IO
Get handle for file with given identifier that was uploaded to the workflow group.
Currently we do allow downloads for non-submission members (i.e., the user identifier is optional).
- Parameters
group_id (string) – Unique workflow group identifier
file_id (string) – Unique file identifier
- Return type
io.BytesIO
- Raises
- list_uploaded_files(group_id: str) Dict
Get a listing of all files that have been uploaded for the given workflow group.
- Parameters
group_id (string) – Unique workflow group identifier
- Return type
dict
- Raises
- upload_file(group_id: str, file: flowserv.volume.base.IOHandle, name: str) Dict
Create a file for a given workflow group.
- Parameters
group_id (string) – Unique workflow group identifier
file (flowserv.volume.base.IOHandle) – File object (e.g., uploaded via HTTP request)
name (string) – Name of the file
- Return type
dict
- Raises