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));
}
}
Aggregations