Object Storage Swift - Iniziare a utilizzare l'API Swift S3
Informazioni sulla traduzione
Questa traduzione è stata generata automaticamente dal nostro partner SYSTRAN. I contenuti potrebbero presentare imprecisioni, ad esempio la nomenclatura dei pulsanti o alcuni dettagli tecnici. In caso di dubbi consigliamo di fare riferimento alla versione inglese o francese della guida. Per aiutarci a migliorare questa traduzione, utilizza il pulsante "Contribuisci" di questa pagina.
Objective
The Swift s3api middleware providing S3 API compatibility has been enabled on all Public Cloud regions.
This guide will help you access objects in Swift using a software designed to interact with S3-compatible endpoints.
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
You can either use the CLI method or create AWS configuration files manually. Install the AWS client and configure it as follows:
Then, follow the steps and enter your AWS credentials generated by the commands above.
Virtual hosted-style and path-style access are supported in all regions, but we recommend to use virtual hosted-style since path-style access will be deprecated after September 30, 2020.
Use AWS client
List buckets (containers):
If you have more than one profile, add --profile <profile> to the command line.
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
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for assisting you on your specific use case of your project.
Join our community of users.