Search in sources :

Example 6 with PlatformParameters

use of com.sequenceiq.cloudbreak.cloud.PlatformParameters in project cloudbreak by hortonworks.

the class PlatformParametersHandler method accept.

@Override
public void accept(Event<PlatformParametersRequest> platformParameterRequestEvent) {
    LOGGER.info("Received event: {}", platformParameterRequestEvent);
    PlatformParametersRequest request = platformParameterRequestEvent.getData();
    Map<Platform, PlatformParameters> platformParameters = new HashMap<>();
    try {
        for (Entry<Platform, Collection<Variant>> connector : cloudPlatformConnectors.getPlatformVariants().getPlatformToVariants().entrySet()) {
            platformParameters.put(connector.getKey(), cloudPlatformConnectors.getDefault(connector.getKey()).parameters());
        }
        PlatformParametersResult platformParameterResult = new PlatformParametersResult(request, platformParameters);
        request.getResult().onNext(platformParameterResult);
        LOGGER.info("Query platform parameters finished.");
    } catch (RuntimeException e) {
        request.getResult().onNext(new PlatformParametersResult(e.getMessage(), e, request));
    }
}
Also used : Platform(com.sequenceiq.cloudbreak.cloud.model.Platform) HashMap(java.util.HashMap) PlatformParametersRequest(com.sequenceiq.cloudbreak.cloud.event.platform.PlatformParametersRequest) PlatformParameters(com.sequenceiq.cloudbreak.cloud.PlatformParameters) Collection(java.util.Collection) PlatformParametersResult(com.sequenceiq.cloudbreak.cloud.event.platform.PlatformParametersResult)

Aggregations

PlatformParameters (com.sequenceiq.cloudbreak.cloud.PlatformParameters)6 Platform (com.sequenceiq.cloudbreak.cloud.model.Platform)4 HashMap (java.util.HashMap)3 SpecialParameters (com.sequenceiq.cloudbreak.api.model.SpecialParameters)2 SpecialParametersJson (com.sequenceiq.cloudbreak.api.model.SpecialParametersJson)2 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)2 Map (java.util.Map)2 PlatformDisksJson (com.sequenceiq.cloudbreak.api.model.PlatformDisksJson)1 PlatformOrchestratorsJson (com.sequenceiq.cloudbreak.api.model.PlatformOrchestratorsJson)1 PlatformRegionsJson (com.sequenceiq.cloudbreak.api.model.PlatformRegionsJson)1 PlatformVariantsJson (com.sequenceiq.cloudbreak.api.model.PlatformVariantsJson)1 PlatformVirtualMachinesJson (com.sequenceiq.cloudbreak.api.model.PlatformVirtualMachinesJson)1 TagSpecificationsJson (com.sequenceiq.cloudbreak.api.model.TagSpecificationsJson)1 CloudConnector (com.sequenceiq.cloudbreak.cloud.CloudConnector)1 PlatformParameterRequest (com.sequenceiq.cloudbreak.cloud.event.platform.PlatformParameterRequest)1 PlatformParameterResult (com.sequenceiq.cloudbreak.cloud.event.platform.PlatformParameterResult)1 PlatformParametersRequest (com.sequenceiq.cloudbreak.cloud.event.platform.PlatformParametersRequest)1 PlatformParametersResult (com.sequenceiq.cloudbreak.cloud.event.platform.PlatformParametersResult)1 PlatformDisks (com.sequenceiq.cloudbreak.cloud.model.PlatformDisks)1 PlatformOrchestrators (com.sequenceiq.cloudbreak.cloud.model.PlatformOrchestrators)1