Package com.sequenceiq.cloudbreak.domain

Examples of com.sequenceiq.cloudbreak.domain.AzureTemplate


    private StackRepository stackRepository;

    @Override
    public List<Resource> create(AzureProvisionContextObject po, int index, List<Resource> resources) throws Exception {
        Stack stack = stackRepository.findById(po.getStackId());
        AzureTemplate azureTemplate = (AzureTemplate) stack.getTemplate();
        AzureCredential azureCredential = (AzureCredential) stack.getCredential();
        Map<String, String> props = new HashMap<>();
        String name = filterResourcesByType(resources, ResourceType.AZURE_CLOUD_SERVICE).get(0).getResourceName();
        props.put(NAME, name);
        X509Certificate sshCert = null;
View Full Code Here


    }

    public static Template createTemplate(String owner, String account, CloudPlatform platform) {
        switch (platform) {
            case AZURE:
                AzureTemplate azureTemplate = new AzureTemplate();
                azureTemplate.setId(1L);
                azureTemplate.setOwner(owner);
                azureTemplate.setAccount(account);
                azureTemplate.setVmType("test-vm-type");
                azureTemplate.setLocation(AzureLocation.NORTH_EUROPE);
                azureTemplate.setImageName("TEST_IMAGE");
                azureTemplate.setVolumeCount(1);
                azureTemplate.setVolumeSize(100);
                azureTemplate.setDescription("azure test template");
                azureTemplate.setPublicInAccount(true);
                return azureTemplate;
            case AWS:
                AwsTemplate awsTemplate = new AwsTemplate();
                awsTemplate.setId(1L);
                awsTemplate.setOwner(owner);
View Full Code Here

    @Test
    public void testConvertAzureTemplateJsonToEntity() {
        // GIVEN
        // WHEN
        AzureTemplate result = underTest.convert(templateJson);
        assertEquals(result.cloudPlatform(), templateJson.getCloudPlatform());
        assertEquals(result.getDescription(), templateJson.getDescription());
        assertEquals(result.getLocation().name(),
                templateJson.getParameters().get(AzureTemplateParam.LOCATION.getName()));
    }
View Full Code Here

        props.put(AzureTemplateParam.LOCATION.getName(), DUMMY_LOCATION);
        props.put(AzureTemplateParam.IMAGENAME.getName(), DUMMY_IMAGE_NAME);
        props.put(AzureTemplateParam.VMTYPE.getName(), DUMMY_VM_TYPE);
        templateJson.setParameters(props);
        // WHEN
        AzureTemplate result = underTest.convert(templateJson);
        assertEquals(result.cloudPlatform(), templateJson.getCloudPlatform());
        assertEquals(result.getDescription(), templateJson.getDescription());
        assertEquals(result.getImageName(),
                templateJson.getParameters().get(AzureTemplateParam.IMAGENAME.getName()));
    }
View Full Code Here

        props.put(AzureTemplateParam.VMTYPE.getName(), DUMMY_VM_TYPE);
        templateJson.setVolumeCount(1);
        templateJson.setVolumeSize(100);
        templateJson.setParameters(props);

        AzureTemplate result = underTest.convert(templateJson);
    }
View Full Code Here

        props.put(AzureTemplateParam.VMTYPE.getName(), DUMMY_VM_TYPE);
        templateJson.setVolumeCount(10);
        templateJson.setVolumeSize(10000);
        templateJson.setParameters(props);

        AzureTemplate result = underTest.convert(templateJson);
    }
View Full Code Here

        props.put(AzureTemplateParam.VMTYPE.getName(), DUMMY_VM_TYPE);
        templateJson.setVolumeCount(3);
        templateJson.setVolumeSize(2049);
        templateJson.setParameters(props);

        AzureTemplate result = underTest.convert(templateJson);
    }
View Full Code Here

        AzureTemplate result = underTest.convert(templateJson);
    }

    private AzureTemplate createAzureTemplate() {
        AzureTemplate azureTemplate = new AzureTemplate();
        azureTemplate.setVmType(DUMMY_VM_TYPE);
        azureTemplate.setDescription(DUMMY_DESCRIPTION);
        azureTemplate.setImageName(DUMMY_IMAGE_NAME);
        azureTemplate.setLocation(DUMMY_LOCATION);
        azureTemplate.setName(DUMMY_NAME);
        azureTemplate.setId(1L);
        Set<Port> ports = new HashSet<>();
        ports.add(new Port(DUMMY_NAME, PORT, LOCAL_PORT, DUMMY_PROTOCOL));
        azureTemplate.setPublicInAccount(true);
        return azureTemplate;
    }
View Full Code Here

        Cluster cluster = new Cluster();
        cluster.setEmailNeeded(false);
        stack.setCluster(cluster);
        stack.setName(STACK_NAME);
        stack.setCredential(new AzureCredential());
        AzureTemplate azureTemplate = new AzureTemplate();
        stack.setTemplate(azureTemplate);
        stack.setOwner(DUMMY_EMAIL);
        return stack;
    }
View Full Code Here

    public void setUp() {
        underTest = new SimpleTemplateService();
        MockitoAnnotations.initMocks(this);
        awsTemplate = new AwsTemplate();
        awsTemplate.setId(1L);
        azureTemplate = new AzureTemplate();
        azureTemplate.setId(1L);
    }
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloudbreak.domain.AzureTemplate

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.