Package org.jclouds.ovf

Examples of org.jclouds.ovf.Network$Builder


      if (vAppTemplate.getNetworkSection().getNetworks().size() > 1)
         throw new UnsupportedOperationException(
                  "we currently do not support multiple network connections in a vAppTemplate " + vAppTemplate);

      Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);

     
      NetworkConfig config = networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);

      // note that in VCD 1.5, the network name after instantiation will be the same as the parent
View Full Code Here


      }
      return client.getVmClient().updateGuestCustomizationOfVm(guestConfiguration, vm.getHref());
   }

   public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
      Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));

      Vm vm = get(vApp.getChildren(), 0);

      NetworkConnectionSection net = vm.getNetworkConnectionSection();
      checkArgument(net.getConnections().size() > 0, "no connections on vm %s", vm);

      NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);

      if (ipAllocationMode == null)
         ipAllocationMode = toConnect.getIpAddressAllocationMode();

      // make sure that we are in fact allocating ips
      if (ipAllocationMode == IpAddressAllocationMode.NONE)
         ipAllocationMode = IpAddressAllocationMode.POOL;

      if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
               && toConnect.getNetwork().equals(networkToConnect.getName())) {
         // then we don't need to change the network settings, and can save a call
      } else {
         Builder builder = net.toBuilder();
         builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName()).connected(true)
                  .ipAddressAllocationMode(ipAllocationMode).build()));
         logger.trace(">> updating networkConnection vm(%s)", vm.getName());

         waitForTask(client.getVmClient().updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
         logger.trace("<< updated networkConnection vm(%s)", vm.getName());
View Full Code Here

      if (vAppTemplate.getNetworkSection().getNetworks().size() > 1)
         throw new UnsupportedOperationException(
                  "we currently do not support multiple network connections in a vAppTemplate " + vAppTemplate);

      Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);

     
      NetworkConfig config = networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);

      // note that in VCD 1.5, the network name after instantiation will be the same as the parent
View Full Code Here

      }
      return client.getVmApi().updateGuestCustomizationOfVm(guestConfiguration, vm.getHref());
   }

   public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
      Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));

      Vm vm = get(vApp.getChildren(), 0);

      NetworkConnectionSection net = vm.getNetworkConnectionSection();
      checkArgument(net.getConnections().size() > 0, "no connections on vm %s", vm);

      NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);

      if (ipAllocationMode == null)
         ipAllocationMode = toConnect.getIpAddressAllocationMode();

      // make sure that we are in fact allocating ips
      if (ipAllocationMode == IpAddressAllocationMode.NONE)
         ipAllocationMode = IpAddressAllocationMode.POOL;

      if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
               && toConnect.getNetwork().equals(networkToConnect.getName())) {
         // then we don't need to change the network settings, and can save a call
      } else {
         Builder builder = net.toBuilder();
         builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName()).connected(true)
                  .ipAddressAllocationMode(ipAllocationMode).build()));
         logger.trace(">> updating networkConnection vm(%s)", vm.getName());

         waitForTask(client.getVmApi().updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
         logger.trace("<< updated networkConnection vm(%s)", vm.getName());
View Full Code Here

               network.getHref(),
               URI
                        .create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vappTemplate-1201908921/networkSection/"));
      assertEquals(network.getType(), VCloudMediaType.NETWORKSECTION_XML);
      assertEquals(network.getInfo(), "The list of logical networks");
      assertEquals(network.getNetworks(), ImmutableSet.of(new Network("vAppNet-vApp Internal", null)));

   }
View Full Code Here

      if (vAppTemplate.getNetworkSection().getNetworks().size() > 1)
         throw new UnsupportedOperationException(
                  "we currently do not support multiple network connections in a vAppTemplate " + vAppTemplate);

      Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);

     
      NetworkConfig config = networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);

      // note that in VCD 1.5, the network name after instantiation will be the same as the parent
View Full Code Here

      }
      return client.getVmApi().updateGuestCustomizationOfVm(guestConfiguration, vm.getHref());
   }

   public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
      Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));

      Vm vm = get(vApp.getChildren(), 0);

      NetworkConnectionSection net = vm.getNetworkConnectionSection();
      checkArgument(net.getConnections().size() > 0, "no connections on vm %s", vm);

      NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);

      if (ipAllocationMode == null)
         ipAllocationMode = toConnect.getIpAddressAllocationMode();

      // make sure that we are in fact allocating ips
      if (ipAllocationMode == IpAddressAllocationMode.NONE)
         ipAllocationMode = IpAddressAllocationMode.POOL;

      if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
               && toConnect.getNetwork().equals(networkToConnect.getName())) {
         // then we don't need to change the network settings, and can save a call
      } else {
         Builder builder = net.toBuilder();
         builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName()).connected(true)
                  .ipAddressAllocationMode(ipAllocationMode).build()));
         logger.trace(">> updating networkConnection vm(%s)", vm.getName());

         waitForTask(client.getVmApi().updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
         logger.trace("<< updated networkConnection vm(%s)", vm.getName());
View Full Code Here

               network.getHref(),
               URI
                        .create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vappTemplate-1201908921/networkSection/"));
      assertEquals(network.getType(), VCloudMediaType.NETWORKSECTION_XML);
      assertEquals(network.getInfo(), "The list of logical networks");
      assertEquals(network.getNetworks(), ImmutableSet.of(new Network("vAppNet-vApp Internal", null)));

   }
View Full Code Here

      if (vAppTemplate.getNetworkSection().getNetworks().size() > 1)
         throw new UnsupportedOperationException(
                  "we currently do not support multiple network connections in a vAppTemplate " + vAppTemplate);

      Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);

     
      NetworkConfig config = networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);

      // note that in VCD 1.5, the network name after instantiation will be the same as the parent
View Full Code Here

      }
      return client.getVmClient().updateGuestCustomizationOfVm(guestConfiguration, vm.getHref());
   }

   public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
      Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));

      Vm vm = get(vApp.getChildren(), 0);

      NetworkConnectionSection net = vm.getNetworkConnectionSection();
      checkArgument(net.getConnections().size() > 0, "no connections on vm %s", vm);

      NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);

      if (ipAllocationMode == null)
         ipAllocationMode = toConnect.getIpAddressAllocationMode();

      // make sure that we are in fact allocating ips
      if (ipAllocationMode == IpAddressAllocationMode.NONE)
         ipAllocationMode = IpAddressAllocationMode.POOL;

      if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
               && toConnect.getNetwork().equals(networkToConnect.getName())) {
         // then we don't need to change the network settings, and can save a call
      } else {
         Builder builder = net.toBuilder();
         builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName()).connected(true)
                  .ipAddressAllocationMode(ipAllocationMode).build()));
         logger.trace(">> updating networkConnection vm(%s)", vm.getName());

         waitForTask(client.getVmClient().updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
         logger.trace("<< updated networkConnection vm(%s)", vm.getName());
View Full Code Here

TOP

Related Classes of org.jclouds.ovf.Network$Builder

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.