flowserv.service.files.base module
Interface for the workflow user group files API component that defines methods to access, delete, and upload files for workflow groups.
- class flowserv.service.files.base.UploadFileService
Bases:
objectAPI component that provides methods to access, delete and upload files for workflow user groups.
- abstract 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
- abstract 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
- abstract 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
- abstract 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