Package org.apache.provisionr.api.network

Examples of org.apache.provisionr.api.network.Network


            Rule.builder().anySource().icmp().createRule(),
            Rule.builder().anySource().port(22).tcp().createRule(),
            Rule.builder().anySource().port(53).udp().createRule()
        );

        final Network network = Network.builder().ingress(ingressRules).createNetwork();

        Pool pool = mock(Pool.class);

        when(pool.getProvider()).thenReturn(provider);
        when(pool.getNetwork()).thenReturn(network);
View Full Code Here


            .username("admin")
            .publicKey(getResourceAsString("/org/apache/provisionr/test/id_rsa_test.pub"))
            .privateKey(getResourceAsString("/org/apache/provisionr/test/id_rsa_test"))
            .createAdminAccess();

        final Network network = Network.builder().addRules(
            Rule.builder().anySource().tcp().port(22).createRule()).createNetwork();

        hardware = mock(Hardware.class);
        when(hardware.getType()).thenReturn("t1.micro");
        when(hardware.getBlockDevices()).thenReturn(new ArrayList<BlockDevice>());
View Full Code Here

    public void testSerialization() {
        final Provider provider = Provider.builder()
            .id("amazon").accessKey("access").secretKey("secret")
            .createProvider();

        final Network network = Network.builder().addRules(
            Rule.builder().anySource().port(22).tcp().createRule(),
            Rule.builder().anySource().port(8088).tcp().createRule()
        ).createNetwork();

        final AdminAccess adminAccess = AdminAccess.builder().username("admin").publicKey("ssh-rsa AAAAB3N")
View Full Code Here

    }

    @Test
    public void testDeleteSecurityGroup() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        final Network network = Network.builder().createNetwork();

        Pool pool = mock(Pool.class);

        when(pool.getProvider()).thenReturn(provider);
        when(pool.getNetwork()).thenReturn(network);
View Full Code Here

            .username("admin")
            .publicKey(getResourceAsString("/org/apache/provisionr/test/id_rsa_test.pub"))
            .privateKey(getResourceAsString("/org/apache/provisionr/test/id_rsa_test"))
            .createAdminAccess();

        final Network network = Network.builder().addRules(
            Rule.builder().anySource().tcp().port(22).createRule()).createNetwork();

        final Hardware hardware = Hardware.builder().type(getProviderProperty("serviceOffering")).createHardware();
        final Software software = Software.builder()
            .imageId(getProviderProperty("templateId"))
View Full Code Here

        final Provider provider = collectProviderCredentialsFromSystemProperties()
            // TODO: get more options as needed for CloudStack
            .createProvider();

        final Network network = Network.builder()
            .addRules(Rule.builder().anySource().tcp().port(22).createRule())
            .createNetwork();

        final Software software = Software.builder().imageId("ubuntu-10.04")
            .packages("nginx").createSoftware();
View Full Code Here

            provider = provider.toBuilder()
                .option(ProviderOptions.SPOT_BID, spotBid)
                .createProvider();
        }

        final Network network = Network.builder().addRules(
            Rule.builder().anySource().icmp().createRule(),
            Rule.builder().anySource().port(22).protocol(Protocol.TCP).createRule()
        ).createNetwork();

        final Hardware hardware = Hardware.builder().type(TEST_INSTANCE_TYPE).createHardware();
View Full Code Here

    @Test
    public void testApplyCdh3TemplateToNetworkAndSoftware() throws Exception {
        XmlTemplate template = XmlTemplate.newXmlTemplate(readResource(DEFAULT_CDH3_TEMPLATE));

        Network network = template.apply(Network.builder().createNetwork());
        assertThat(network.getIngress()).contains(
            Rule.builder().anySource().tcp().port(8080).createRule());


        Software software = template.apply(Software.builder().createSoftware());
        assertThat(software.getPackages()).contains("hue").contains("hadoop-0.20");
View Full Code Here

    private static final Logger LOG = LoggerFactory.getLogger(EnsureSecurityGroupExists.class);

    @Override
    public void execute(CloudStackClient cloudStackClient, Pool pool, DelegateExecution execution) {
        Network network = checkNotNull(pool.getNetwork(), "Please configure a network for the pool");
        String securityGroupName = SecurityGroups.formatNameFromBusinessKey(execution.getProcessBusinessKey());
        SecurityGroup securityGroup;
        try {
            LOG.info("Creating SecurityGroup {}", securityGroupName);
            securityGroup = SecurityGroups.createSecurityGroup(cloudStackClient, securityGroupName);
View Full Code Here

TOP

Related Classes of org.apache.provisionr.api.network.Network

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.