use of com.tremolosecurity.unison.openstack.model.ProjectsResponse in project OpenUnison by TremoloSecurity.
the class KeystoneProvisioningTarget method getProjectID.
private String getProjectID(String token, HttpCon con, String name) throws Exception {
StringBuffer b = new StringBuffer();
b.append(this.url).append("/projects?name=").append(URLEncoder.encode(name, "UTF-8"));
String json = this.callWS(token, con, b.toString());
Gson gson = new Gson();
ProjectsResponse res = gson.fromJson(json, ProjectsResponse.class);
if (res.getProjects().isEmpty()) {
return null;
} else {
return res.getProjects().get(0).getId();
}
}
Aggregations