biodm.managers.s3manager module

class S3Manager(app: Api, endpoint_url: str, bucket_name: str, access_key_id: str, secret_access_key: str, url_expiration: int, pending_expiration: int, region_name: str, file_size_limit: int)

Bases: ApiManager

Manages requests with an S3 storage instance.

abort_multipart_upload(object_name, upload_id)
complete_multipart_upload(object_name, upload_id, parts)
create_multipart_upload(object_name) List[Any]

_summary_

Parameters:

object_name (_type_) – _description_

Raises:

e – _description_

Returns:

_description_

Return type:

List[Any]

create_presigned_download_url(object_name: str) Any

Generate a presigned URL to share an S3 object

Parameters:

object_name (String) – Object Key

Returns:

Presigned URL as string.

create_presigned_post(object_name, file_size, callback) Any

Generates a presigned url + form fiels to upload a given file on s3 bucket.

Relevant links: - https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-presigned-urls.html - https://github.com/minio/minio/issues/19811#issue-2317920163

create_upload_part(object_name, upload_id, part_number)
property endpoint: str

External service endpoint.