IBM Cloud COS: Using S3 API get-bucket-location re

2019-08-28 06:28发布

I'm using the S3 API for IBM Cloud COS and am getting unexpected bucket not found errors from get-bucket-location.

My bucket exists in the us-south region and shows up the s3 ls command, but getting the region is failing. I'm using the java AWS api, but can reproduce it with the aws cli.

[08:07] jwilliams:~ $ aws --profile ibm --endpoint-url https://s3-api.us-geo.objectstorage.softlayer.net s3api get-bucket-location --bucket s3-wzd-dv-integrationtest-so-1

An error occurred (NoSuchBucket) when calling the GetBucketLocation operation: The specified bucket does not exist.

[08:07] jwilliams:~ $ aws  --profile ibm --endpoint-url https://s3-api.us-geo.objectstorage.softlayer.net s3 ls
2018-12-05 10:06:00 s3-wzd-dv-integrationtest-ea-1
2018-12-05 10:04:51 s3-wzd-dv-integrationtest-so-1
2018-11-29 15:59:19 wzd-jw-bucket-1
2018-11-29 16:14:55 wzd-jw-bucket-2

1条回答
淡お忘
2楼-- · 2019-08-28 07:08

This type of error occurs when you have created "Regional" bucket instead of "Cross-Region". You can verify the location of the bucket from the IBM Cloud console. Bucket -> Configuration would also provide you with the public URL you can use.

Depending on the region, try these:

aws  --profile ibm --endpoint-url https://s3.us-east.objectstorage.softlayer.net s3 ls

aws  --profile ibm --endpoint-url https://s3.us-south.objectstorage.softlayer.net s3 ls
查看更多
登录 后发表回答