You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2021/12/01 07:58:33 UTC

[GitHub] [libcloud] Asiwaju887 commented on issue #1581: How can I define region for us-east-1

Asiwaju887 commented on issue #1581:
URL: https://github.com/apache/libcloud/issues/1581#issuecomment-983381902


   I do not really get what you mean by store data Bucket, but if you want to upload and download an object to a bucket in s3 in your region use can use this code below
   
   `client = get_driver(Provider.S3_AP_NORTHEAST)
       s3 = client(aws_id, aws_secret)
   
   
       container = s3.get_container(container_name=container_name)
       # This method blocks until all the parts have been uploaded.
       extra = {'content_type': 'application/octet-stream'}
   
       with open(FILE_PATH, 'rb') as iterator:
           obj = s3.upload_object_via_stream(iterator=iterator,
                                               container=container,
                                               object_name='create.txt',
                                               extra=extra)`
   
   
   Let me know if this work.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org