Browse Source

First upload with hardcoded instruction

DricomDragon 4 years ago
parent
commit
62211d5d19
1 changed files with 7 additions and 4 deletions
  1. 7 4
      boto-updater.py

+ 7 - 4
boto-updater.py

@@ -1,8 +1,11 @@
 import boto3
 
+# Arguments
+folder_to_sync = './test/data'
+bucket_target = 'my-bucket'
+
 # Main
-s3 = boto3.resource('s3', use_ssl=False, endpoint_url="http://172.17.0.2:9000", aws_access_key_id="minio", aws_secret_access_key="miniokey")
+s3 = boto3.client('s3', use_ssl=False, endpoint_url="http://172.17.0.2:9000", aws_access_key_id="minio", aws_secret_access_key="miniokey")
 
-# Print out bucket names
-for bucket in s3.buckets.all():
-    print(bucket.name)
+# Upload
+res = s3.upload_file('./test/data/hello.txt', bucket_target, 'coucou.txt')