use of com.sequenceiq.cloudbreak.service.stack.connector.OperationException in project cloudbreak by hortonworks.
the class CloudParameterService method getRegionsV2.
public CloudRegions getRegionsV2(Credential credential, String region, String variant, Map<String, String> filters) {
LOGGER.debug("Get platform regions");
ExtendedCloudCredential cloudCredential = credentialToExtendedCloudCredentialConverter.convert(credential);
GetPlatformRegionsRequestV2 getPlatformRegionsRequest = new GetPlatformRegionsRequestV2(cloudCredential, cloudCredential, variant, region, filters);
eventBus.notify(getPlatformRegionsRequest.selector(), Event.wrap(getPlatformRegionsRequest));
try {
GetPlatformRegionsResultV2 res = getPlatformRegionsRequest.await();
LOGGER.info("Platform regions result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
throw new GetCloudParameterException("Failed to get regions from the cloud provider due to network issues or invalid credential", res.getErrorDetails());
}
return res.getCloudRegions();
} catch (InterruptedException e) {
LOGGER.error("Error while getting the platform regions", e);
throw new OperationException(e);
}
}
use of com.sequenceiq.cloudbreak.service.stack.connector.OperationException in project cloudbreak by hortonworks.
the class CloudParameterService method getPublicIpPools.
public CloudIpPools getPublicIpPools(Credential credential, String region, String variant, Map<String, String> filters) {
LOGGER.debug("Get platform publicIpPools");
ExtendedCloudCredential cloudCredential = credentialToExtendedCloudCredentialConverter.convert(credential);
GetPlatformCloudIpPoolsRequest getPlatformCloudIpPoolsRequest = new GetPlatformCloudIpPoolsRequest(cloudCredential, cloudCredential, variant, region, filters);
eventBus.notify(getPlatformCloudIpPoolsRequest.selector(), Event.wrap(getPlatformCloudIpPoolsRequest));
try {
GetPlatformCloudIpPoolsResult res = getPlatformCloudIpPoolsRequest.await();
LOGGER.info("Platform publicIpPools result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
LOGGER.error("Failed to get platform publicIpPools", res.getErrorDetails());
throw new GetCloudParameterException("Failed to get public IP pools for the cloud provider", res.getErrorDetails());
}
return res.getCloudIpPools();
} catch (InterruptedException e) {
LOGGER.error("Error while getting the platform publicIpPools", e);
throw new OperationException(e);
}
}
use of com.sequenceiq.cloudbreak.service.stack.connector.OperationException in project cloudbreak by hortonworks.
the class CloudParameterService method getCloudNetworks.
public CloudNetworks getCloudNetworks(Credential credential, String region, String variant, Map<String, String> filters) {
LOGGER.debug("Get platform cloudnetworks");
ExtendedCloudCredential cloudCredential = credentialToExtendedCloudCredentialConverter.convert(credential);
GetPlatformNetworksRequest getPlatformNetworksRequest = new GetPlatformNetworksRequest(cloudCredential, cloudCredential, variant, region, filters);
eventBus.notify(getPlatformNetworksRequest.selector(), eventFactory.createEvent(getPlatformNetworksRequest));
try {
GetPlatformNetworksResult res = getPlatformNetworksRequest.await();
LOGGER.info("Platform networks types result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
LOGGER.error("Failed to get platform networks", res.getErrorDetails());
throw new GetCloudParameterException("Failed to get networks for the cloud provider", res.getErrorDetails());
}
return res.getCloudNetworks();
} catch (InterruptedException e) {
LOGGER.error("Error while getting the platform networks", e);
throw new OperationException(e);
}
}
use of com.sequenceiq.cloudbreak.service.stack.connector.OperationException in project cloudbreak by hortonworks.
the class CloudParameterService method getSecurityGroups.
public CloudSecurityGroups getSecurityGroups(Credential credential, String region, String variant, Map<String, String> filters) {
LOGGER.debug("Get platform securitygroups");
ExtendedCloudCredential cloudCredential = credentialToExtendedCloudCredentialConverter.convert(credential);
GetPlatformSecurityGroupsRequest getPlatformSecurityGroupsRequest = new GetPlatformSecurityGroupsRequest(cloudCredential, cloudCredential, variant, region, filters);
eventBus.notify(getPlatformSecurityGroupsRequest.selector(), eventFactory.createEvent(getPlatformSecurityGroupsRequest));
try {
GetPlatformSecurityGroupsResult res = getPlatformSecurityGroupsRequest.await();
LOGGER.info("Platform securitygroups types result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
LOGGER.error("Failed to get platform securitygroups", res.getErrorDetails());
throw new GetCloudParameterException("Failed to get security groups for the cloud provider", res.getErrorDetails());
}
return res.getCloudSecurityGroups();
} catch (InterruptedException e) {
LOGGER.error("Error while getting the platform securitygroups", e);
throw new OperationException(e);
}
}
use of com.sequenceiq.cloudbreak.service.stack.connector.OperationException in project cloudbreak by hortonworks.
the class CloudParameterService method getOrchestrators.
public PlatformOrchestrators getOrchestrators() {
LOGGER.debug("Get platform orchestrators");
GetPlatformOrchestratorsRequest getPlatformOrchestratorsRequest = new GetPlatformOrchestratorsRequest();
eventBus.notify(getPlatformOrchestratorsRequest.selector(), eventFactory.createEvent(getPlatformOrchestratorsRequest));
try {
GetPlatformOrchestratorsResult res = getPlatformOrchestratorsRequest.await();
LOGGER.info("Platform orchestrators result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
LOGGER.error("Failed to get platform orchestrators", res.getErrorDetails());
throw new OperationException(res.getErrorDetails());
}
return res.getPlatformOrchestrators();
} catch (InterruptedException e) {
LOGGER.error("Error while getting the platform orchestrators", e);
throw new OperationException(e);
}
}
Aggregations