This guide is designed to familiarize you with the management of your containers/objects. The list of commands presented in this guide is intended to familiarize you with the AWS CLI tool. For more in-depth instructions on AWS CLI, please check out the guides here.
Requirements
- a Public Cloud project in your OVHcloud account
- access to the OVHcloud Control Panel
- an S3 user already created
- Python 3.6 or later (installation instructions)
Instructions
Using AWS CLI
Installation
Enter the following command:
- awscli-plugin-endpoint is optional
- Install the groff package if you want to use command line help.
Collect Credentials
- To access your S3 resources, you will need your user's Access key and Secret key. You can retrieve this information from the OVHcloud Control Panel under Public Cloud > Object Storage > S3 users.
- You will also need your url_endpoint and the region. If you have already created your container, you can access this information from the
My containers
tab in the details of your container. Otherwise, follow this guide.
Configuration
aws --configure
The configuration file format in the aws client is as follows:
Here are the configuration values that you can specifically set:
Variable | Type | Value | Definition |
max_competitor_requests | Integer | Default: 10 | The maximum number of simultaneous requests. |
max_queue_size | Integer | Default: 1000 | The maximum number of tasks in the task queue. |
multipart_threshold | Integer String |
Default: 8MB | The size threshold that the CLI uses for multipart transfers of individual files. |
multipart_chunksize | Integer String |
Default: 8MB Minimum for uploads: 5MB |
When using multipart transfers, this is the bit size that the CLI uses for multipart transfers of individual files. |
max_bandwidth | Integer | Default: None | The maximum bandwidth that will be used to load and download data to and from your buckets. |
verify_ssl | Boolean | Default: true | Enable / Disable SSL certificate verification |
For a list of endpoints by region and storage class, refer to this page.
Usage
awscli-plugin-endpoint
, you must add --endpoint-url https://s3.<region_in_lowercase>.io.cloud.ovh.us
to the command line.--profile <profile>
to the command line.Creating a bucket
Listing your buckets
Uploading your files as objects in your bucket
aws s3 cp
command will use STANDARD as default storage class for uploading objects. To store objects in the High Performance tier, use the aws s3api put-object
command instead, as aws s3 cp
does not support the EXPRESS_ONEZONE storage class which is used to map the High Performance storage tier. To learn more about the storage class mapping between OVHcloud storage tiers and AWS storage classes, you can check our documentation here.
By default, objects are named after files, but can be renamed
Downloading an object from a bucket
Uploading an object from one bucket to another bucket
Downloading or uploading an entire bucket to the host/bucket
Synchronizing buckets
Deleting objects and buckets
To delete an object:
To remove all objects from a bucket:
To delete a bucket, it must be empty:
If the bucket is not removed, you can use the same command with the --force
option. This deletes all objects from the bucket, and then deletes the bucket.
Deleting objects and buckets with versioning enabled
If versioning is enabled, a simple delete operation on your objects will not permanently remove them.
In order to permanently delete an object, you must specify a version id:
To list all objects and all version ID, you can use the following command:
With the previous delete-object command, you will have to iterate over all your object versions. Alternatively, you can use the following one-liner to empty your bucket:
--bypass-governance-retention
option to your delete commands.
Setting tags on a bucket
Deleting tags on a bucket
Setting tags on an object
Deleting tags on an object
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.