class CnfAdapterService {

    public ResponseEntity<InstanceResponse> getInstanceByInstanceId(String instanceId)
            throws JsonParseException, JsonMappingException, IOException {

        logger.info("CnfAdapterService createInstance called");
        ResponseEntity<InstanceResponse> instanceResponse = null;
        try {

            // String uri = env.getRequiredProperty("multicloud.endpoint"); //TODO:
            // This needs to be added as well
            // for configuration
            String uri = "http://multicloud-k8s:9015"; // TODO: What is the correct uri?
            String path = "/v1/instance/" + instanceId;
            String endpoint = UriBuilder.fromUri(uri).path(path).build().toString();
            HttpEntity<?> requestEntity = new HttpEntity<>(getHttpHeaders());
            instanceResponse = restTemplate.exchange(endpoint, HttpMethod.GET, requestEntity, InstanceResponse.class);
            return instanceResponse;
        } catch (HttpClientErrorException e) {
            logger.error("Error Calling Multicloud, e");
            if (HttpStatus.SC_NOT_FOUND == e.getStatusCode().value()) {
                throw new EntityNotFoundException(e.getResponseBodyAsString());
            }
            throw e;
        } catch (HttpStatusCodeException e) {
            logger.error("Error in Multicloud, e");
            String responseString = e.getResponseBodyAsString();
            InstanceResponse result = new InstanceResponse(responseString.trim());
            return ResponseEntity.status(e.getStatusCode()).body(result);
        }
    }

}