Examples of NetworkConfigSection


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

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

   }
  
   private void addVAppNetworkWithSecurityGroupOnVApp(ImmutableList<String> securityGroups, String vAppUrn) {
      String newVAppNetworkName = generateVAppNetworkName(network.getName(), securityGroups);
      // Create a vAppNetwork with firewall rules
      NetworkConfigSection newSection = generateNetworkConfigSection(securityGroups, newVAppNetworkName);
      Task editNetworkConfigSection = vAppApi.editNetworkConfigSection(vAppUrn, newSection);
      assertTrue(retryTaskSuccess.apply(editNetworkConfigSection), String.format(TASK_COMPLETE_TIMELY, "editNetworkConfigSection"));
      attachVmToVAppNetwork(vm, newVAppNetworkName);
   }
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

      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

      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

      }

      NetworkConfiguration networkConfiguration = NetworkConfiguration.builder().parentNetwork(parentNetwork.get())
               .fenceMode(FenceMode.BRIDGED).build();

      NetworkConfigSection networkConfigSection = NetworkConfigSection
               .builder()
               .info("Configuration parameters for logical networks")
               .networkConfigs(
                        ImmutableSet.of(VAppNetworkConfiguration.builder().networkName("vAppNetwork")
                                 .configuration(networkConfiguration).build())).build();
View Full Code Here

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

      return instantiationParams;
   }

   /** Build a {@link NetworkConfigSection} object. */
   private NetworkConfigSection networkConfigSection() {
      NetworkConfigSection networkConfigSection = NetworkConfigSection
               .builder()
               .info("Configuration parameters for logical networks")
               .networkConfigs(
                        ImmutableSet.of(VAppNetworkConfiguration.builder()
                                 .networkName("vAppNetwork")
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.