Package com.sequenceiq.cloudbreak.controller

Examples of com.sequenceiq.cloudbreak.controller.BadRequestException


            Map<String, Integer> installRequests = ambariClient.installComponentsToHost(host, stack.getCluster().getBlueprint().getBlueprintName(), hostgroup);
            LOGGER.info("Host added and service install requests are sent. [Ambari server: {}, host: '{}']", ambariIp, host);
            return installRequests;
        } catch (HttpResponseException e) {
            if ("Conflict".equals(e.getMessage())) {
                throw new BadRequestException("Host already exists.", e);
            } else if ("Bad Request".equals(e.getMessage())) {
                throw new BadRequestException("Failed to validate host.", e);
            } else {
                throw new InternalServerException("Something went wrong", e);
            }
        }
    }
View Full Code Here


        azureTemplate.setDescription(json.getDescription());
        azureTemplate.setVolumeCount((json.getVolumeCount() == null) ? 0 : json.getVolumeCount());
        azureTemplate.setVolumeSize((json.getVolumeSize() == null) ? 0 : json.getVolumeSize());
        AzureVmType azureVmType = AzureVmType.valueOf(json.getParameters().get(AzureTemplateParam.VMTYPE.getName()).toString());
        if (azureVmType.maxDiskSize() < azureTemplate.getVolumeCount()) {
            throw new BadRequestException(
                    String.format("Azure not support this volumesize on the %s. The max suppported size is: %s",
                            azureVmType.vmType(),
                            azureVmType.maxDiskSize()));
        }
        return azureTemplate;
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloudbreak.controller.BadRequestException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.