Uploadtos3¶
flowtask.components.UploadToS3
¶
UploadToS3
¶
Bases: Boto3Client, UploadToBase
UploadToS3
Overview
The `UploadToS3` class is a specialized component that facilitates the uploading of files to an Amazon S3 bucket.
This class extends both the `Boto3Client` and `UploadToBase` classes, providing integration with AWS S3 for file
storage operations. The component supports the upload of individual files, multiple files, or entire directories.
.. table:: Properties :widths: auto
+-------------------------+----------+-----------+--------------------------------------------------------------------------+
| Name | Required | Description |
+-------------------------+----------+-----------+--------------------------------------------------------------------------+
| bucket | Yes | The name of the S3 bucket to which files will be uploaded. |
+-------------------------+----------+-----------+--------------------------------------------------------------------------+
| directory | Yes | The S3 directory path where files will be uploaded. |
+-------------------------+----------+-----------+--------------------------------------------------------------------------+
| source_dir | Yes | The local directory containing the files to be uploaded. |
+-------------------------+----------+-----------+--------------------------------------------------------------------------+
| _filenames | Yes | A list of filenames to be uploaded. |
+-------------------------+----------+-----------+--------------------------------------------------------------------------+
| whole_dir | No | A flag indicating whether to upload all files in the source directory. |
+-------------------------+----------+-----------+--------------------------------------------------------------------------+
| ContentType | No | The MIME type of the files to be uploaded. Defaults to "binary/octet-stream".|
+-------------------------+----------+-----------+--------------------------------------------------------------------------+
| credentials | Yes | A dictionary containing the credentials necessary for AWS authentication. |
+-------------------------+----------+-----------+--------------------------------------------------------------------------+
Return
The `run` method uploads files to the specified S3 bucket, returning a dictionary containing the list of successfully
uploaded files and any errors encountered during the upload process.