我正在使用Openstack "ice-house“和"admin”用户。我的openstack4j版本是2.0.3。
使用身份管理客户端,我只能将作为租户列表的一部分。
更糟糕的是,当我试图列出“用户”、“角色”和“服务”时,它会返回一个空列表或NULL。
下面是我的代码示例:
OSClient os = OSFactory.builder()
.endpoint("http://localhost:5000/v2.0/")
.credentials("admin", "secret")
.tenantName("admin")
.authenticate();
System.out.println(os.identity().tenants().list()); // Get Only A Part of my tenant list
System.out.println(os.identity().users().list()); // Get Empty List
System.out.println(os.identity().services().list()); // Also Get Empty List我在网上尝试了一些解决方案。例如:
OSClient os = OSFactory.builder()
.endpoint("http://localhost:5000/v2.0/")
.credentials("admin", "secret")
.tenantName("admin")
.perspective(Facing.ADMIN)
.authenticate();我发现连接失败(超时)错误。然后我尝试了.perspective(Facing.PUBLIC),没有错误,但是,我仍然得到空列表或NULL。
有人能帮我解决这个问题吗?
发布于 2016-03-30 16:07:20
我解决了:OSFactory.enableLegacyEndpointHandling(真);
https://stackoverflow.com/questions/30072069
复制相似问题