use of com.sequenceiq.cloudbreak.service.stack.connector.OperationException in project cloudbreak by hortonworks.
the class CloudParameterService method getPlatformParameters.
public Map<Platform, PlatformParameters> getPlatformParameters() {
LOGGER.debug("Get platform parameters for");
PlatformParametersRequest parametersRequest = new PlatformParametersRequest();
eventBus.notify(parametersRequest.selector(), eventFactory.createEvent(parametersRequest));
try {
PlatformParametersResult res = parametersRequest.await();
LOGGER.info("Platform parameter result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
LOGGER.error("Failed to get platform parameters", res.getErrorDetails());
throw new OperationException(res.getErrorDetails());
}
return res.getPlatformParameters();
} catch (InterruptedException e) {
LOGGER.error("Error while getting platform parameters", e);
throw new OperationException(e);
}
}
use of com.sequenceiq.cloudbreak.service.stack.connector.OperationException in project cloudbreak by hortonworks.
the class CloudParameterService method getGateways.
public CloudGateWays getGateways(Credential credential, String region, String variant, Map<String, String> filters) {
LOGGER.debug("Get platform gateways");
ExtendedCloudCredential cloudCredential = credentialToExtendedCloudCredentialConverter.convert(credential);
GetPlatformCloudGatewaysRequest getPlatformCloudGatewaysRequest = new GetPlatformCloudGatewaysRequest(cloudCredential, cloudCredential, variant, region, filters);
eventBus.notify(getPlatformCloudGatewaysRequest.selector(), Event.wrap(getPlatformCloudGatewaysRequest));
try {
GetPlatformCloudGatewaysResult res = getPlatformCloudGatewaysRequest.await();
LOGGER.info("Platform gateways result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
LOGGER.error("Failed to get platform gateways", res.getErrorDetails());
throw new GetCloudParameterException("Failed to get gateways for the cloud provider", res.getErrorDetails());
}
return res.getCloudGateWays();
} catch (InterruptedException e) {
LOGGER.error("Error while getting the platform gateways", e);
throw new OperationException(e);
}
}
use of com.sequenceiq.cloudbreak.service.stack.connector.OperationException in project cloudbreak by hortonworks.
the class CloudParameterService method getCloudSshKeys.
public CloudSshKeys getCloudSshKeys(Credential credential, String region, String variant, Map<String, String> filters) {
LOGGER.debug("Get platform sshkeys");
ExtendedCloudCredential cloudCredential = credentialToExtendedCloudCredentialConverter.convert(credential);
GetPlatformSshKeysRequest getPlatformSshKeysRequest = new GetPlatformSshKeysRequest(cloudCredential, cloudCredential, variant, region, filters);
eventBus.notify(getPlatformSshKeysRequest.selector(), eventFactory.createEvent(getPlatformSshKeysRequest));
try {
GetPlatformSshKeysResult res = getPlatformSshKeysRequest.await();
LOGGER.info("Platform sshkeys types result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
LOGGER.error("Failed to get platform sshkeys", res.getErrorDetails());
throw new GetCloudParameterException("Failed to get SSH keys for the cloud provider", res.getErrorDetails());
}
return res.getCloudSshKeys();
} catch (InterruptedException e) {
LOGGER.error("Error while getting the platform sshkeys", e);
throw new OperationException(e);
}
}
use of com.sequenceiq.cloudbreak.service.stack.connector.OperationException in project cloudbreak by hortonworks.
the class CloudParameterService method getVmTypesV2.
public CloudVmTypes getVmTypesV2(Credential credential, String region, String variant, Map<String, String> filters) {
LOGGER.debug("Get platform vmtypes");
ExtendedCloudCredential cloudCredential = credentialToExtendedCloudCredentialConverter.convert(credential);
GetPlatformVmTypesRequest getPlatformVmTypesRequest = new GetPlatformVmTypesRequest(cloudCredential, cloudCredential, variant, region, filters);
eventBus.notify(getPlatformVmTypesRequest.selector(), Event.wrap(getPlatformVmTypesRequest));
try {
GetPlatformVmTypesResult res = getPlatformVmTypesRequest.await();
LOGGER.info("Platform vmtypes result: {}", res);
if (res.getStatus().equals(EventStatus.FAILED)) {
LOGGER.error("Failed to get platform vmtypes", res.getErrorDetails());
throw new GetCloudParameterException("Failed to VM types for the cloud provider", res.getErrorDetails());
}
return res.getCloudVmTypes();
} catch (InterruptedException e) {
LOGGER.error("Error while getting the platform vmtypes", e);
throw new OperationException(e);
}
}
Aggregations