class ExternalRestService {

    public Optional<String> getLocalAuthorityDcId(LocalAuthority localAuthority) {
        RestTemplate restTemplate = new RestTemplate();

        try {
            String dcId = restTemplate.getForObject(
                    discoveryUtils.adminServiceUrl() + "/api/admin/local-authority/{localAuthoritySiren}/dcId",
                    String.class,
                    localAuthority.getSiren());
            return Optional.ofNullable(dcId);
        } catch (RestClientResponseException e){
            LOGGER.error(
                    "[getLocalAuthorityDcId] An error was occured when tried to get DcId for organization {} from {} : Status {} Body {} ",
                    localAuthority.getSiren(),
                    discoveryUtils.adminServiceUrl(),
                    e.getRawStatusCode(),
                    e.getResponseBodyAsString());
            return Optional.empty();
        }
    }

}