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