This small example project shows how to use OOS using standard boto3 library.
Running this example will:
- Create a Bucket with a random name
- Put a string inside an object inside the bucket
- Read back that object
- Delete the object
- Delete the bucket
You will need:
- python3 and preferably virtualenv installed
- An Access Key and Secret Key
- (optional) Setup your virtual env:
virtualenv -p python3 .venv
source .venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Setup your credentials and region:
export OSC_REGION="eu-west-2"
export OSC_ACCESS_KEY="MyAccessKey"
export OSC_SECRET_KEY="MySecretKey"
- Run the example:
> python src/main.py
You should have a similar output:
> python src/main.py
creating private bucket named bucket-test-voxa...
bucket bucket-test-voxa created
writing 'Hello World' to public my-data object...
writed to bucket-test-voxa object
reading my-data object...
read object ok: b'Hello World'
deleting my-data object...
deleted my-data object
deleting bucket named bucket-test-voxa...
bucket bucket-test-voxa delete
Check main.py to see how it is done.
Feel free to open an issue for discussion or bug report.
Copyright Outscale SAS
BSD-3-Clause