use of com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant in project cloudbreak by hortonworks.
the class GetPlatformVmTypesHandler method accept.
@Override
public void accept(Event<GetPlatformVmTypesRequest> getPlatformVmTypesRequest) {
LOGGER.info("Received event: {}", getPlatformVmTypesRequest);
GetPlatformVmTypesRequest request = getPlatformVmTypesRequest.getData();
try {
CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant(Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant()));
CloudVmTypes platformVirtualMachinesJson = cloudPlatformConnectors.get(cloudPlatformVariant).platformResources().virtualMachines(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters());
GetPlatformVmTypesResult getPlatformSecurityGroupsResult = new GetPlatformVmTypesResult(request, platformVirtualMachinesJson);
request.getResult().onNext(getPlatformSecurityGroupsResult);
LOGGER.info("Query platform vmtypes types finished.");
} catch (Exception e) {
request.getResult().onNext(new GetPlatformVmTypesResult(e.getMessage(), e, request));
}
}
use of com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant in project cloudbreak by hortonworks.
the class CloudPlatformConnectors method cloudPlatformConnectors.
@PostConstruct
public void cloudPlatformConnectors() {
platformToVariants = HashMultimap.create();
for (CloudConnector connector : cloudConnectors) {
map.put(new CloudPlatformVariant(connector.platform(), connector.variant()), connector);
platformToVariants.put(connector.platform(), connector.variant());
}
Map<Platform, Variant> environmentDefaults = extractEnvironmentDefaultVariants();
setupDefaultVariants(platformToVariants, environmentDefaults);
LOGGER.debug(map.toString());
LOGGER.debug(defaultVariants.toString());
}
use of com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant in project cloudbreak by hortonworks.
the class GetPlatformAccessConfigsHandler method accept.
@Override
public void accept(Event<GetPlatformCloudAccessConfigsRequest> getPlatformCloudAccessConfigsRequest) {
LOGGER.info("Received event: {}", getPlatformCloudAccessConfigsRequest);
GetPlatformCloudAccessConfigsRequest request = getPlatformCloudAccessConfigsRequest.getData();
try {
CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant(Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant()));
CloudAccessConfigs cloudAccessConfigs = cloudPlatformConnectors.get(cloudPlatformVariant).platformResources().accessConfigs(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters());
GetPlatformCloudAccessConfigsResult getPlatformCloudAccessConfigsResult = new GetPlatformCloudAccessConfigsResult(request, cloudAccessConfigs);
request.getResult().onNext(getPlatformCloudAccessConfigsResult);
LOGGER.info("Query platform access configs finished.");
} catch (Exception e) {
request.getResult().onNext(new GetPlatformCloudAccessConfigsResult(e.getMessage(), e, request));
}
}
use of com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant in project cloudbreak by hortonworks.
the class GetPlatformIpPoolsHandler method accept.
@Override
public void accept(Event<GetPlatformCloudIpPoolsRequest> getPlatformIpPoolsRequest) {
LOGGER.info("Received event: {}", getPlatformIpPoolsRequest);
GetPlatformCloudIpPoolsRequest request = getPlatformIpPoolsRequest.getData();
try {
CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant(Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant()));
CloudIpPools cloudIpPools = cloudPlatformConnectors.get(cloudPlatformVariant).platformResources().publicIpPool(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters());
GetPlatformCloudIpPoolsResult getPlatformIpPoolsResult = new GetPlatformCloudIpPoolsResult(request, cloudIpPools);
request.getResult().onNext(getPlatformIpPoolsResult);
LOGGER.info("Query platform ip pool types finished.");
} catch (Exception e) {
request.getResult().onNext(new GetPlatformCloudIpPoolsResult(e.getMessage(), e, request));
}
}
use of com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant in project cloudbreak by hortonworks.
the class GetPlatformNetworksHandler method accept.
@Override
public void accept(Event<GetPlatformNetworksRequest> getPlatformNetworksRequest) {
LOGGER.info("Received event: {}", getPlatformNetworksRequest);
GetPlatformNetworksRequest request = getPlatformNetworksRequest.getData();
try {
CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant(Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant()));
CloudNetworks networks = cloudPlatformConnectors.get(cloudPlatformVariant).platformResources().networks(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters());
GetPlatformNetworksResult getPlatformNetworksResult = new GetPlatformNetworksResult(request, networks);
request.getResult().onNext(getPlatformNetworksResult);
LOGGER.info("Query platform networks types finished.");
} catch (Exception e) {
request.getResult().onNext(new GetPlatformNetworksResult(e.getMessage(), e, request));
}
}
Aggregations