Search in sources :

Example 6 with CloudPlatformVariant

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));
    }
}
Also used : GetPlatformVmTypesResult(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformVmTypesResult) CloudVmTypes(com.sequenceiq.cloudbreak.cloud.model.CloudVmTypes) CloudPlatformVariant(com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant) GetPlatformVmTypesRequest(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformVmTypesRequest)

Example 7 with CloudPlatformVariant

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());
}
Also used : Variant(com.sequenceiq.cloudbreak.cloud.model.Variant) CloudPlatformVariant(com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant) CloudConnector(com.sequenceiq.cloudbreak.cloud.CloudConnector) Platform(com.sequenceiq.cloudbreak.cloud.model.Platform) CloudPlatformVariant(com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant) PostConstruct(javax.annotation.PostConstruct)

Example 8 with CloudPlatformVariant

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));
    }
}
Also used : GetPlatformCloudAccessConfigsResult(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudAccessConfigsResult) CloudPlatformVariant(com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant) CloudAccessConfigs(com.sequenceiq.cloudbreak.cloud.model.CloudAccessConfigs) GetPlatformCloudAccessConfigsRequest(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudAccessConfigsRequest)

Example 9 with CloudPlatformVariant

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));
    }
}
Also used : GetPlatformCloudIpPoolsRequest(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudIpPoolsRequest) CloudIpPools(com.sequenceiq.cloudbreak.cloud.model.CloudIpPools) CloudPlatformVariant(com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant) GetPlatformCloudIpPoolsResult(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudIpPoolsResult)

Example 10 with CloudPlatformVariant

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));
    }
}
Also used : GetPlatformNetworksResult(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformNetworksResult) GetPlatformNetworksRequest(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformNetworksRequest) CloudPlatformVariant(com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant) CloudNetworks(com.sequenceiq.cloudbreak.cloud.model.CloudNetworks)

Aggregations

CloudPlatformVariant (com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant)11 CloudConnector (com.sequenceiq.cloudbreak.cloud.CloudConnector)1 GetPlatformCloudAccessConfigsRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudAccessConfigsRequest)1 GetPlatformCloudAccessConfigsResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudAccessConfigsResult)1 GetPlatformCloudGatewaysRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudGatewaysRequest)1 GetPlatformCloudGatewaysResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudGatewaysResult)1 GetPlatformCloudIpPoolsRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudIpPoolsRequest)1 GetPlatformCloudIpPoolsResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformCloudIpPoolsResult)1 GetPlatformInstanceGroupParameterRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformInstanceGroupParameterRequest)1 GetPlatformInstanceGroupParameterResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformInstanceGroupParameterResult)1 GetPlatformNetworksRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformNetworksRequest)1 GetPlatformNetworksResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformNetworksResult)1 GetPlatformRegionsRequestV2 (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformRegionsRequestV2)1 GetPlatformRegionsResultV2 (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformRegionsResultV2)1 GetPlatformSecurityGroupsRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformSecurityGroupsRequest)1 GetPlatformSecurityGroupsResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformSecurityGroupsResult)1 GetPlatformSshKeysRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformSshKeysRequest)1 GetPlatformSshKeysResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformSshKeysResult)1 GetPlatformVmTypesRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformVmTypesRequest)1 GetPlatformVmTypesResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformVmTypesResult)1