upload_files_to_r2

Documentation for eth_defi.vault.data_file_export.upload_files_to_r2 function.

upload_files_to_r2(file_paths, bucket_name, endpoint_url, access_key_id, secret_access_key, key_prefix='', public_url='')

Upload a list of files to R2 bucket, excluding tmp* files.

Parameters
  • file_paths (list[pathlib.Path]) – List of file paths to upload.

  • bucket_name (str) – R2 bucket name.

  • endpoint_url (str) – R2 API endpoint URL.

  • access_key_id (str) – R2 access key ID.

  • secret_access_key (str) – R2 secret access key.

  • key_prefix (str) – Prefix for S3 keys, e.g. test- for test uploads.

  • public_url (str) – Public base URL for logging final download URLs.

Returns

Number of files uploaded.

Return type

int