Examples of NetworkConfigSection


Examples of org.jclouds.savvis.vpdc.domain.NetworkConfigSection

   public void test() {
      InputStream is = getClass().getResourceAsStream("/networkconfigsection.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      NetworkConfigSection result = factory.create(injector.getInstance(NetworkConfigSectionHandler.class)).parse(is);
      assertEquals(result.toString(), NetworkConfigSection.builder().network("VM Tier01").gateway("0.0.0.0").netmask(
               "0.0.0.0").info("MAC=00:00:00:00:00:00").fenceMode("allowInOut").dhcp(true).internalToExternalNATRule(
               "10.76.2.4", "206.24.124.1").build().toString());
   }
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.NetworkConfigSection

   public void test() {
      InputStream is = getClass().getResourceAsStream("/networkconfigsection.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      NetworkConfigSection result = factory.create(injector.getInstance(NetworkConfigSectionHandler.class)).parse(is);
      assertEquals(result.toString(), NetworkConfigSection.builder().network("VM Tier01").gateway("0.0.0.0").netmask(
               "0.0.0.0").info("MAC=00:00:00:00:00:00").fenceMode("allowInOut").dhcp(true).internalToExternalNATRule(
               "10.76.2.4", "206.24.124.1").build().toString());
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection

            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/getNetworkConfigSection.xml", VCloudDirectorMediaType.NETWORK_CONFIG_SECTION)
            .httpResponseBuilder().build());

    NetworkConfigSection expected = getNetworkConfigSection();

    assertEquals(api.getVAppApi().getNetworkConfigSection(vAppURI), expected);
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection

            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/editNetworkConfigSectionTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

    NetworkConfigSection section = getNetworkConfigSection().toBuilder()
          .build();

    Task expected = editNetworkConfigSectionTask();

    assertEquals(api.getVAppApi().editNetworkConfigSection(vAppURI, section), expected);
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection

      return task;
   }

   public static NetworkConfigSection getNetworkConfigSection() {
      NetworkConfigSection section = NetworkConfigSection.builder()
            .build();

      return section;
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection

   }

   @Test(groups = { "live", "user" }, description = "GET /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetVApp" })
   public void testGetNetworkConfigSection() {
      // The method under test
      NetworkConfigSection section = vAppApi.getNetworkConfigSection(vAppUrn);

      // Check the retrieved object is well formed
      checkNetworkConfigSection(section);
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection

   @Test(description = "PUT /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetNetworkConfigSection" })
   public void testEditNetworkConfigSection() {
     
      // Copy existing section and update fields
      NetworkConfigSection oldSection = vAppApi.getNetworkConfigSection(vAppUrn);
      Network network = lazyGetNetwork();
     
      tryFindBridgedNetworkInOrg();
      IpRange ipRange = ipRange();
      NetworkConfiguration newConfiguration = NetworkConfiguration.builder()
               .ipScope(ipScope(ipRange))
               .parentNetwork(Reference.builder().fromEntity(network).build())
               .fenceMode(FenceMode.NAT_ROUTED)
               .retainNetInfoAcrossDeployments(false)
               .syslogServerSettings(SyslogServerSettings.builder().syslogServerIp1("192.168.14.27").build())
               .features(NetworkFeatures.builder()
                        .service(DhcpService.builder()
                                 .ipRange(ipRange)
                                 .build())
                        .service(FirewallService.builder()
                                 .logDefaultAction(false)
                                 .defaultAction("drop")
                                 .build())
                        .service(NatService.builder()
                                 .natType("portForwarding")
                                 .enabled(false)
                                 .build())                              
                        .build())
               .build();
          
      final String networkName = name("vAppNetwork-");
      VAppNetworkConfiguration newVAppNetworkConfiguration = VAppNetworkConfiguration.builder()
               .networkName(networkName)
               .description(name("description-"))
               .configuration(newConfiguration)
               .build();

      NetworkConfigSection newSection = oldSection.toBuilder().networkConfigs(ImmutableSet.of(newVAppNetworkConfiguration)).build();

      // The method under test
      Task editNetworkConfigSection = vAppApi.editNetworkConfigSection(vAppUrn, newSection);
      assertTrue(retryTaskSuccess.apply(editNetworkConfigSection),
               String.format(TASK_COMPLETE_TIMELY, "editNetworkConfigSection"));

      // Retrieve the modified section
      NetworkConfigSection modified = vAppApi.getNetworkConfigSection(vAppUrn);

      // Check the retrieved object is well formed
      checkNetworkConfigSection(modified);
     
      Optional<VAppNetworkConfiguration> modifiedOptionalVAppNetwork = Iterables.tryFind(modified.getNetworkConfigs(), new IsVAppNetworkNamed(networkName));
      if(!modifiedOptionalVAppNetwork.isPresent())
         fail(String.format("Could not find vApp network named %s", networkName));
     
      Optional<VAppNetworkConfiguration> newOptionalVAppNetwork = Iterables.tryFind(newSection.getNetworkConfigs(), new IsVAppNetworkNamed(networkName));
      if(!newOptionalVAppNetwork.isPresent())
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection

   public void testAddVAppNetworkWithDefaultSecurityGroup() {
      ImmutableList<String> securityGroups = ImmutableList.of(DEFAULT_SECURITY_GROUP);
      addVAppNetworkWithSecurityGroupOnVApp(securityGroups, vAppUrn);

      // Retrieve the modified section
      NetworkConfigSection modified = vAppApi.getNetworkConfigSection(vAppUrn);

      // Check the retrieved object is well formed
      checkNetworkConfigSection(modified);

      /*
 
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection

   public void testAddVAppNetworkWithHttpSecurityGroup() {
      ImmutableList<String> securityGroups = ImmutableList.of(HTTP_SECURITY_GROUP);
      addVAppNetworkWithSecurityGroupOnVApp(securityGroups, vAppUrn);

      // Retrieve the modified section
      NetworkConfigSection modified = vAppApi.getNetworkConfigSection(vAppUrn);

      // Check the retrieved object is well formed
      checkNetworkConfigSection(modified);

      /*
 
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection

   public void testAddVAppNetworkWithDefaultAndHttpSecurityGroup() {
      ImmutableList<String> securityGroups = ImmutableList.of(DEFAULT_SECURITY_GROUP, HTTP_SECURITY_GROUP);
      addVAppNetworkWithSecurityGroupOnVApp(securityGroups, vAppUrn);

      // Retrieve the modified section
      NetworkConfigSection modified = vAppApi.getNetworkConfigSection(vAppUrn);

      // Check the retrieved object is well formed
      checkNetworkConfigSection(modified);

      /*
 
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.