libcloud
libcloud copied to clipboard
How can I define region for us-east-1
Hi Team,
I was trying to store Cassandra backup using medusa. But it's not happening as there is no mapping of s3 storage provider for region us-east-1.
can you please help me with how I can store the data Bucket created in us-east-1 region.
Hello @sandeep-netomi, just my 2 cents here if not too late, for us-east-1 I think it is supposed to be just s3 (see https://github.com/apache/libcloud/blob/trunk/libcloud/storage/types.py#L53)
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.
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically marking is as stale. If this issue is not relevant or applicable anymore (problem has been fixed in a new version or similar), please close the issue or let us know so we can close it. On the contrary, if the issue is still relevant, there is nothing you need to do, but if you have any additional details or context which would help us when working on this issue, please include it as a comment to this issue.