use of org.onap.so.client.HttpClientFactory in project so by onap.
the class ResourceRequestBuilder method getServiceInstnace.
public static Map<String, Object> getServiceInstnace(String uuid) throws Exception {
String catalogEndPoint = UrnPropertiesReader.getVariable("mso.catalog.db.endpoint");
HttpClient client = new HttpClientFactory().newJsonClient(UriBuilder.fromUri(catalogEndPoint).path(SERVICE_URL_SERVICE_INSTANCE).queryParam("serviceModelUuid", uuid).build().toURL(), ONAPComponents.CATALOG_DB);
client.addAdditionalHeader("Accept", "application/json");
client.addAdditionalHeader("Authorization", UrnPropertiesReader.getVariable("mso.db.auth"));
Response apiResponse = client.get();
String value = apiResponse.readEntity(String.class);
ObjectMapper objectMapper = new ObjectMapper();
HashMap<String, Object> map = objectMapper.readValue(value, HashMap.class);
return map;
}
Aggregations