The code is:
I only changed the config file path and the region since we are using us-ashburn-1.
This is the screenshot:
Thanks. Looks like you are looking in the UX console at buckets in a compartment other than the root / tenancy compartment. The examples you reference above output any buckets in the root compartment:
Builder listBucketsBuilder =
If you want the example code to output the buckets in the "uat" compartment instead, you'll need to pass the id of the "uat" compartment instead of provider.getTenantId() in the above snippet.
I corrected compartmentId using the ocid of uat compartment. This time, it cannot get any bucket. I verified that cli can get the buckets in uat compartment correctly by using the same namespace and compartment id.
You are right that I do have a bucket which has the same name as the root compartment and the example got it correctly. But why it cannot do the same for the non-root compartment? I am an admin of this tenent already. Thanks.
When you say "it cannot get any bucket" for the uat compartment -- are you getting an error, or just 0 buckets returned? Do other, non-root compartments work if you try those from the Java example?
Thanks Joe. It worked now. My mistake caused this.