4

So, I have a bucket on IBM's Cloud Object Storage. In this bucket I have an file named 'test.png'.

What I need is an URL i can use to access this file directly. An URL that I can just write on browser and the image will open on my browser.

I've searched everywhere and could not find anything except for a "ObjectSQL URL" in this format:

cos://{Region}/{Bucket}/{File}

Bruno Lira
  • 177
  • 3
  • 13

2 Answers2

11

Presuming that the bucket has public access enabled, the URL is just https://{endpoint}/{bucket}/{object} (or https://{bucket}.{endpoint}/{object}. So if your image is in a US Cross-Region bucket called 'images', the URL would be https://s3.us.cloud-object-storage.appdomain.cloud/images/test.png (or https://images.s3.us.cloud-object-storage.appdomain.cloud/test.png) and it would render in a browser (most of the time, different browsers have different behaviors).

Now, that assumes a public access bucket, where all data in the bucket is publicly accessible. If you want to just make a single object accessible for a limited time, you'd need to create a presigned URL using HMAC credentials.

Nick Lange
  • 857
  • 6
  • 8
  • Oh my! I spent hours on this! haha Turns out I could not see the option to change Access Policies because I did not have permission to! Got permission and now it works fine! Thank you, you're awesome! :D – Bruno Lira Oct 30 '19 at 12:32
  • Nick, do you know a good link for COS endpoints? The one I was using now 404s: https://cloud.ibm.com/docs/services/cloud-object-storage/basics/endpoints.html – John Hanley Oct 30 '19 at 14:56
  • John - that link works for me? But it’s also always possible to get the complete list of endpoints via API: https://control.cloud-object-storage.test.cloud.ibm.com/v2/endpoints – Nick Lange Oct 31 '19 at 13:46
1

I know this is an old question, but I keep coming back to it for reference and have to find out the rest of the link.

The structure of the URL is:

https://s3.{region}.cloud-object-storage.appdomain.cloud/{bucket-name}/{filename-with-extension}

The region can be found in the details of an object, inside the Object SQL URL, as you mentioned, or in the list below:

regions:

cross-regional: [ap,eu,us]

regional: [au-syd, br-sao, ca-tor, eu-de, eu-gb, jp-osa, jp-tok, us-east, us-south]

single-site: [ams03, hkg02, sng01, mil01, sjc04, sao01, seo01, tor01]

Reference: https://www.ibm.com/docs/en/aspera-on-cloud?topic=basics-cloud-platforms-regions-supported

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103