use of com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformRegionsRequest in project cloudbreak by hortonworks.
the class CloudParameterService method getRegions.
public PlatformRegions getRegions() {
LOGGER.debug("Get platform regions");
GetPlatformRegionsRequest getPlatformRegionsRequest = new GetPlatformRegionsRequest();
eventBus.notify(getPlatformRegionsRequest.selector(), eventFactory.createEvent(getPlatformRegionsRequest));
try {
GetPlatformRegionsResult res = getPlatformRegionsRequest.await();
LOGGER.info("Platform regions result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
LOGGER.error("Failed to get platform regions", res.getErrorDetails());
throw new OperationException(res.getErrorDetails());
}
return res.getPlatformRegions();
} catch (InterruptedException e) {
LOGGER.error("Error while getting the platform regions", e);
throw new OperationException(e);
}
}
Aggregations