Upload API Client¶
- class dbrepo.UploadClient.UploadClient(endpoint: str = 'http://gateway-service/api/upload/files')
The UploadClient class for communicating with the DBRepo REST API. All parameters can be set also via environment variables, e.g. set endpoint with DBREPO_ENDPOINT, username with DBREPO_USERNAME, etc. You can override the constructor parameters with the environment variables.
- Parameters:
endpoint – The REST API endpoint. Optional. Default: “http://gateway-service/api/upload/files”
- upload(file_path: str) str
Imports a file through the Upload Service into the Storage Service.
- Parameters:
file_path – The file path on the local machine.
- Returns:
Filename on the Storage Service, if successful.