Learn how to access objects in Swift using software designed to interact with S3-compatible endpoints.
The Swift s3api middleware providing S3 API compatibility has been enabled on all Public Cloud regions.
Requirements
Instructions
Set the OpenStack environment variables
Install OpenStack client if needed
OpenStack client command reference here.
Create EC2 credentials
S3 tokens are different, you need 2 parameters (access and secret) to generate a S3 token. These credentials will be safely stored in Keystone. To generate it:
With python-openstack client:
With curl:
Configure AWS client
Install the AWS client and configure it as follows:
Replace <region>
with us-east-va
for Vint Hill or us-west-or
for Hillsboro.
Virtual hosted-style and path-style access are supported in all regions, but we recommend using virtual hosted-style since path-style access has been deprecated since September 30, 2020.
Use AWS client
List buckets (containers):
Create a new bucket:
S3 Buckets can only be created on PCS policy (Object Storage).
The container name must respect the following rules.
- The bucket name can be between 3 and 63 characters long, and can contain only lower-case characters, numbers, periods, and dashes.
- Each bucket name must start with a lowercase letter or number.
- The bucket name cannot contain underscores, end with a dash, have consecutive periods, or use dashes adjacent to periods.
- The bucket name cannot be formatted as an IP address (198.51.100.24).
Upload a local file to Swift:
Download an object from Swift:
Delete a Swift object:
Delete a bucket:
Go further
For more information and tutorials, please see our other Object Storage support guides or explore the guides for other OVHcloud products and services.