Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListBucket返回值中Location为空,只能通过bucketLocation来回去桶的位置,不能通过ListBucket直接获取吗 #23

Open
songant opened this issue Aug 23, 2023 · 1 comment

Comments

@songant
Copy link

songant commented Aug 23, 2023

ListBucket返回值中Location为空,只能通过bucketLocation来回去桶的位置,不能通过ListBucket直接获取吗

@noaccident
Copy link
Collaborator

经验证,需要在请求前将QueryLocation设置成true

input := &obs.ListBucketsInput{}
// 指定桶列表中是否存在Location字段,此处以true为例,默认是false
input.QueryLocation = true
// 指定桶类型,此处以为obs.OBJECT为例,即获取所有桶列表,默认不设置则获取所有桶和并行文件系统列表
input.BucketType = obs.OBJECT
// 列举桶列表
output, err := obsClient.ListBuckets(input)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants