gpt4 book ai didi

java - 对象存储 - 无法访问区域 "London"中的容器

转载 作者:行者123 更新时间:2023-11-30 02:42:04 24 4
gpt4 key购买 nike

我在“伦敦”区域创建了一个包含的直通仪表板。但是当我尝试访问它时,程序显然会检查默认区域,如也所述 here - 仅“达拉斯”地区,尽管我的凭证中的地区是“伦敦”。我尝试通过我的程序创建一个容器,该容器是在“达拉斯”区域创建的。

如何让我的程序访问“伦敦”区域的容器?任何有关如何指定区域的建议将不胜感激。

我列出容器的代码如下所示;

final private OSClient os;

public ObjectStorageDAO(String url, String userId, String password, String project, String domainName)
throws Exception {

Identifier domainIdentifier = Identifier.byName(domainName);
Identifier projectIdentifier = Identifier.byName(project);

os = OSFactory.builderV3().endpoint(url).credentials(userId, password)
.scopeToProject(projectIdentifier, domainIdentifier).authenticate();
}

/**
* Returns the list of containers under the account
*/
public List containers() {
return os.objectStorage().containers().list();
}

最佳答案

启动os对象后,可以尝试强制区域吗?

final private OSClient os;

public ObjectStorageDAO(String url, String userId, String password, String project, String domainName)
throws Exception {

Identifier domainIdentifier = Identifier.byName(domainName);
Identifier projectIdentifier = Identifier.byName(project);

os = OSFactory.builderV3().endpoint(url).credentials(userId, password)
.scopeToProject(projectIdentifier, domainIdentifier).authenticate();

/////////////////////////
// force london region //
/////////////////////////

os.useRegion('london')
}

/**
* Returns the list of containers under the account
*/
public List containers() {
return os.objectStorage().containers().list();
}

有关更多信息,请参见此处:http://www.openstack4j.com/learn/identity/identity-v3

关于java - 对象存储 - 无法访问区域 "London"中的容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41369536/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com