Search in sources :

Example 11 with CloudPlatformVariant

use of com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant in project cloudbreak by hortonworks.

the class GetPlatformSshKeysHandler method accept.

@Override
public void accept(Event<GetPlatformSshKeysRequest> getPlatformSshKeysRequest) {
    LOGGER.info("Received event: {}", getPlatformSshKeysRequest);
    GetPlatformSshKeysRequest request = getPlatformSshKeysRequest.getData();
    try {
        CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant(Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant()));
        CloudSshKeys cloudSshKeys = cloudPlatformConnectors.get(cloudPlatformVariant).platformResources().sshKeys(request.getCloudCredential(), Region.region(request.getRegion()), request.getFilters());
        GetPlatformSshKeysResult getPlatformSshKeysResult = new GetPlatformSshKeysResult(request, cloudSshKeys);
        request.getResult().onNext(getPlatformSshKeysResult);
        LOGGER.info("Query platform networks types finished.");
    } catch (RuntimeException e) {
        request.getResult().onNext(new GetPlatformSshKeysResult(e.getMessage(), e, request));
    }
}
Also used : GetPlatformSshKeysRequest(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformSshKeysRequest) GetPlatformSshKeysResult(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformSshKeysResult) CloudPlatformVariant(com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant) CloudSshKeys(com.sequenceiq.cloudbreak.cloud.model.CloudSshKeys)

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