Search in sources :

Example 1 with GetPlatformRegionsResult

use of com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformRegionsResult 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);
    }
}
Also used : GetPlatformRegionsResult(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformRegionsResult) GetPlatformRegionsRequest(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformRegionsRequest) OperationException(com.sequenceiq.cloudbreak.service.stack.connector.OperationException)

Aggregations

GetPlatformRegionsRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformRegionsRequest)1 GetPlatformRegionsResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformRegionsResult)1 OperationException (com.sequenceiq.cloudbreak.service.stack.connector.OperationException)1