Package io.fabric8.api

Examples of io.fabric8.api.FabricRequirements.profile()


        FabricRequirements requirements = new FabricRequirements();
        requirements.sshConfiguration().defaultPath("/opt/fuse").defaultUsername("root").defaultPassword("adminuser").defaultPassPhrase("cheese");
        requirements.sshHost(hostSmall).hostName(hostSmall).maximumContainerCount(1);
        requirements.sshHost(hostMedium).hostName(hostMedium).maximumContainerCount(2);
        requirements.sshHost(hostBig).hostName(hostBig).maximumContainerCount(8);
        requirements.profile(mqProfileId).minimumInstances(2).maximumInstancesPerHost(1).sshScaling().hostPatterns("!small");
        requirements.profile(exampleProfileId).minimumInstances(5).dependentProfiles(mqProfileId);

        HostProfileCounter hostProfileCounter = assertSshAutoScale(requirements);
        assertHostHasProfileCount(hostProfileCounter, hostSmall, exampleProfileId, 1);
        assertHostHasProfileCount(hostProfileCounter, hostMedium, exampleProfileId, 1);
View Full Code Here


        requirements.sshConfiguration().defaultPath("/opt/fuse").defaultUsername("root").defaultPassword("adminuser").defaultPassPhrase("cheese");
        requirements.sshHost(hostSmall).hostName(hostSmall).maximumContainerCount(1);
        requirements.sshHost(hostMedium).hostName(hostMedium).maximumContainerCount(2);
        requirements.sshHost(hostBig).hostName(hostBig).maximumContainerCount(8);
        requirements.profile(mqProfileId).minimumInstances(2).maximumInstancesPerHost(1).sshScaling().hostPatterns("!small");
        requirements.profile(exampleProfileId).minimumInstances(5).dependentProfiles(mqProfileId);

        HostProfileCounter hostProfileCounter = assertSshAutoScale(requirements);
        assertHostHasProfileCount(hostProfileCounter, hostSmall, exampleProfileId, 1);
        assertHostHasProfileCount(hostProfileCounter, hostMedium, exampleProfileId, 1);
        assertHostHasProfileCount(hostProfileCounter, hostMedium, mqProfileId, 1);
View Full Code Here

            requirements.sshHost(box).tags("mq");
        }
        for (String box : esbBoxes) {
            requirements.sshHost(box).tags("esb");
        }
        requirements.profile(mqProfileId).minimumInstances(2).sshScaling().hostTags("mq");
        requirements.profile(exampleProfileId).minimumInstances(8).dependentProfiles(mqProfileId).sshScaling().hostTags("esb");

        HostProfileCounter hostProfileCounter = assertSshAutoScale(requirements);
        for (String box : mqBoxes) {
            assertHostHasProfileCount(hostProfileCounter, box, mqProfileId, 1);
View Full Code Here

        }
        for (String box : esbBoxes) {
            requirements.sshHost(box).tags("esb");
        }
        requirements.profile(mqProfileId).minimumInstances(2).sshScaling().hostTags("mq");
        requirements.profile(exampleProfileId).minimumInstances(8).dependentProfiles(mqProfileId).sshScaling().hostTags("esb");

        HostProfileCounter hostProfileCounter = assertSshAutoScale(requirements);
        for (String box : mqBoxes) {
            assertHostHasProfileCount(hostProfileCounter, box, mqProfileId, 1);
        }
View Full Code Here

        requirements.sshConfiguration().defaultUsername("root");

        for (String box : esbBoxes) {
            requirements.sshHost(box);
        }
        requirements.profile(exampleProfileId).minimumInstances(2);

        HostProfileCounter hostProfileCounter = assertSshAutoScale(requirements);
        assertHostHasProfileCount(hostProfileCounter, "esb1", exampleProfileId, 1);
        assertHostHasProfileCount(hostProfileCounter, "esb2", exampleProfileId, 1);
        assertHostHasProfileCount(hostProfileCounter, "esb3", exampleProfileId, 0);
View Full Code Here

        assertNotNull("Should have a profile ID for " + archetype, profileId);

        FabricRequirements requirements = fabricController.getRequirements();
        if (!addedBroker) {
            addedBroker = true;
            requirements.profile("mq-default").minimumInstances(1);
            FabricAssertions.assertRequirementsSatisfied(fabricController, requirements);
        }

        // deploying each profile should have caused the requirements to be updated to add them all now
        // so lets load the requirements and assert they are satisfied
View Full Code Here

            FabricAssertions.assertRequirementsSatisfied(fabricController, requirements);
        }

        // deploying each profile should have caused the requirements to be updated to add them all now
        // so lets load the requirements and assert they are satisfied
        requirements.profile(profileId).minimumInstances(1);
        FabricAssertions.assertRequirementsSatisfied(fabricController, requirements);
        System.out.println();
        System.out.println("Managed to create a container for " + profileId + ". Now lets stop it");
        System.out.println();
View Full Code Here

        System.out.println();
        System.out.println("Managed to create a container for " + profileId + ". Now lets stop it");
        System.out.println();

        // now lets force the container to be stopped
        requirements.profile(profileId).minimumInstances(0).maximumInstances(0);
        FabricAssertions.assertRequirementsSatisfied(fabricController, requirements);
        System.out.println();
        System.out.println("Stopped a container for " + profileId + ". Now lets clear requirements");
        System.out.println();
        requirements.removeProfileRequirements(profileId);
View Full Code Here

    @Test
    public void createProvisionedFabric() throws Exception {
        System.out.println("The fabric has now been created somewhere and we have a controller for it, so lets define our requirements");

        FabricRequirements requirements = new FabricRequirements();
        requirements.profile("mq-default").minimumInstances(1);

        FabricAssertions.assertRequirementsSatisfied(fabricController, requirements);

        // now lets ensure that the autoscaler can scale back down again, stopping the broker
        requirements.profile("mq-default").minimumInstances(0).maximumInstances(0);
View Full Code Here

        requirements.profile("mq-default").minimumInstances(1);

        FabricAssertions.assertRequirementsSatisfied(fabricController, requirements);

        // now lets ensure that the autoscaler can scale back down again, stopping the broker
        requirements.profile("mq-default").minimumInstances(0).maximumInstances(0);
        FabricAssertions.assertRequirementsSatisfied(fabricController, requirements);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.