use of com.sequenceiq.cloudbreak.cloud.model.ExtendedCloudCredential 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.cloud.model.ExtendedCloudCredential 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.cloud.model.ExtendedCloudCredential 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.cloud.model.ExtendedCloudCredential 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.cloud.model.ExtendedCloudCredential 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);
}
}
Aggregations