Open rafael-bertoli opened 7 years ago
The cinder v3 call is going to http://192.168.55.34:5000/v3/volumes/detail
, which is the keystone port. It's not getting the correct endpoint from the service catalog, which should be
{
"endpoints": [{
"region_id": "NYQA",
"url": "http://cinderdev-ny.qa.os.com.br:8776/v3/7685011104884466bd89286f411d518d",
"region": "NYQA",
"interface": "admin",
"id": "a550810eba0d43b280ec1872265e7188"
},
...
]
}
This is a bug or I need to change the code? The code used to obtain volumes is:
OSClientV3 os = OSFactory.builderV3()
.endpoint("http://192.168.55.34:5000/v3")
.credentials("qauser", "r1q150Sqa", Identifier.byName("default"))
.scopeToProject(Identifier.byName("qauser"), Identifier.byName("default"))
.authenticate();
// I've tried various combinations of credentials and scope
List<? extends Volume> volumes = os.blockStorage().volumes().list();
I expected sdk to transparently resolve the use of endpoints...
I solved the problem by changing the "forName" method of the ServiceType enum to the following code:
public static ServiceType forName(String name) {
if (name == null || name.isEmpty()) return ServiceType.UNKNOWN;
for (ServiceType s : ServiceType.values()) {
if (name.toLowerCase().startsWith(s.getServiceName().toLowerCase())) {
return s;
}
if (name.toLowerCase().startsWith(s.name().toLowerCase())) {
return s;
}
if (name.toLowerCase().startsWith(s.type.toLowerCase())) {
return s;
}
}
return ServiceType.UNKNOWN;
}
The attribute "name" it was "volumev3" and this enum don't has this value. This way you can correct future issues with version number.
Edit: The release of the openstack I am using is the ocata.
Hi everyone, when i try to get volumes of project with api V3 the response is "404 Not Found", but if i do request with api V2 all volumes are returned.
See request logs of V2 and V3, i noticed that in V3 the project id is not being sent...
V2 log
maven depency: