Package org.jclouds.vcloud.domain

Examples of org.jclouds.vcloud.domain.VAppTemplate


   @VisibleForTesting
   Set<Vm> ifCustomizationScriptIsSetGetVmsInTemplate(String customizationScript, final URI template) {
      Set<Vm> vms = ImmutableSet.of();
      if (customizationScript != null) {
         VAppTemplate vAppTemplate = templateCache.getUnchecked(template);
         checkArgument(vAppTemplate != null, "vAppTemplate %s not found!", template);
         vms = vAppTemplate.getChildren();
         checkArgument(!vms.isEmpty(), "no vms found in vAppTemplate %s", vAppTemplate);
      }
      return vms;
   }
View Full Code Here


   protected VApp instantiateVAppFromTemplate(String name, Template template) {
      VCloudTemplateOptions vOptions = VCloudTemplateOptions.class.cast(template.getOptions());

      URI templateId = URI.create(template.getImage().getId());

      VAppTemplate vAppTemplate = vAppTemplates.getUnchecked(templateId);

      if (vAppTemplate.getChildren().size() > 1)
         throw new UnsupportedOperationException("we currently do not support multiple vms in a vAppTemplate "
                  + vAppTemplate);

      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

TOP

Related Classes of org.jclouds.vcloud.domain.VAppTemplate

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.