HttpURLConnection.HTTP_NOT_FOUND,
HttpURLConnection.HTTP_FORBIDDEN);
if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
throw new NotFoundException("system service", serviceName);
} else if (response.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) {
throw new ServiceNotEnabledException(serviceName);
}
return ObjectResponse.fromJsonBody(response, Instances.class).getResponseObject().getInstances();
}