Last active
May 6, 2021 03:16
-
-
Save shadabshaukat/2571e4aa5b3eea997f2ec67b3fee6eac to your computer and use it in GitHub Desktop.
OCI S3 Compatible API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| s3 = boto3.resource( | |
| 's3', | |
| region_name="ap-sydney-1", | |
| aws_secret_access_key="**************", | |
| aws_access_key_id="****************************************", | |
| endpoint_url="https://ocicpm.compat.objectstorage.ap-sydney-1.oraclecloud.com" | |
| ) | |
| # Print out bucket names | |
| for bucket in s3.buckets.all(): | |
| print(bucket.name) | |
| # Upload a File to you OCI Bucket, 2nd value is your bucket name | |
| s3.meta.client.upload_file('/tmp/hello.txt', 'Shadab-DB-Migrate', 'hello.txt') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment