Is Swift Object Storage compatible with the "standard" aws sdk (v. 2.0) ?
Here my code to create a S3Client:
AwsBasicCredentials awsCreds = AwsBasicCredentials.create(
"accessKeyId",
"secretAccessKey");
client = S3Client.builder()
.credentialsProvider(StaticCredentialsProvider.create(awsCreds))
.region(????)
.build();
I found my accessKeyId and secretAccessKey, but I can't set a proper vaue for "region", because it is NOT a string, but an instance of software.amazon.awssdk.regions.Region class, that has a predefined values only (I think I should pass "gra").
Does that mean I cannot use this sdk? Do I have to use the REST API?
Storage and Backup - Using aws sdk (java 2.x) to access S3/Swift Object Storage
Related questions
- Error while Using Restic to Backup - TooManyRequests
12023
10.05.2022 08:27
- CloudFlare and Public Storage configuration
5910
21.06.2018 10:03
- HA-NAS and Active Directory
5222
30.12.2024 19:44
- Cloud Archive + Rsync
5066
30.03.2018 15:17
- Hubic - backups fail from synology nas
4979
13.04.2018 12:54
- Can't connect to hubic
4414
08.02.2018 18:39
- Hubic on line storage - files download problems
4083
12.02.2018 12:46
- Duplicity S3: Error when calling the HeadBucket operation
3769
09.05.2023 09:20
- Configuring S3 Object Storage with Plesk
3638
07.01.2025 16:32
Hi, solved by myself!
Use this code:
Region gra = Region.of("gra");
client = S3Client.builder()
.region(gra)
.endpointOverride(URI.create("https://s3.gra.cloud.ovh.net"))
.credentialsProvider(StaticCredentialsProvider.create(awsCreds))
.build();
Yes, you can use the AWS SDK for Java (2.x) with OVHcloud Object Storage, but only if you use the S3-compatible endpoint, not pure Swift.
OVHcloud provides S3-compatible APIs for Object Storage, so standard tools and SDKs (like AWS SDK) will work — but you must configure them correctly.
👉 The key points:
Use the S3 endpoint format:
gra, you still need to map it properly in the SDK).💡 Also note: