Package org.jclouds.vcloud.domain

Examples of org.jclouds.vcloud.domain.VApp


      URI VDC = URI.create(template.getLocation().getId());

      logger.debug(">> instantiating vApp vDC(%s) template(%s) name(%s) options(%s) ", VDC, templateId, name, options);

      VApp vAppResponse = client.getVAppTemplateClient().createVAppInVDCByInstantiatingTemplate(name, VDC, templateId,
               options);
      return vAppResponse;
   }
View Full Code Here


      for (ReferenceType vdc : org.getVDCs().values()) {
         VDC response = getVCloudApi().getVDCApi().getVDC(vdc.getHref());
         for (ReferenceType item : response.getResourceEntities().values()) {
            if (item.getType().equals(VCloudMediaType.VAPP_XML)) {
               try {
                  VApp app = getVCloudApi().getVAppApi().getVApp(item.getHref());
                  assertNotNull(app);
                  for (Vm vm : app.getChildren()) {
                     assert getVCloudApi().getVmApi().getScreenThumbnailForVm(vm.getHref()) != null;
                  }
               } catch (RuntimeException e) {

               }
View Full Code Here

      for (ReferenceType vdc : org.getVDCs().values()) {
         VDC response = getVCloudApi().getVDCApi().getVDC(vdc.getHref());
         for (ReferenceType item : response.getResourceEntities().values()) {
            if (item.getType().equals(VCloudMediaType.VAPP_XML)) {
               try {
                  VApp app = getVCloudApi().getVAppApi().getVApp(item.getHref());
                  assertNotNull(app);
                  for (Vm vm : app.getChildren()) {
                     assertEquals(getVCloudApi().getVmApi().getVm(vm.getHref()).getHref(), vm.getHref());
                  }
               } catch (RuntimeException e) {

               }
View Full Code Here

         options.blockOnPort(22, 180);
         options.as(VCloudTemplateOptions.class).customizationScript(script);
         options.as(VCloudTemplateOptions.class).description(group);
         node = getOnlyElement(client.createNodesInGroup(group, 1, options));

         VApp vapp = client.getContext().unwrapApi(VCloudApi.class).getVAppApi().getVApp(
                 node.getUri());
         assertEquals(vapp.getDescription(), group);

         Vm vm = Iterables.get(vapp.getChildren(), 0);
         String apiOutput = vm.getGuestCustomizationSection().getCustomizationScript();
         checkApiOutput(apiOutput);

         ExecResponse vmTools = client.runScriptOnNode(node.getId(), PARSE_VMTOOLSD,
               wrapInInitScript(false).runAsRoot(false));
View Full Code Here

         Task task = getVCloudApi().getVAppApi().undeployVApp(URI.create(node.getId()));

         // wait up to ten minutes per above
         assert taskTester.apply(task.getHref()) : node;

         VApp vApp = getVCloudApi().getVAppApi().getVApp(URI.create(node.getId()));

         // wait up to ten minutes per above
         assertEquals(vApp.getStatus(), Status.OFF);

         // vdc is equiv to the node's location
         // vapp uri is the same as the node's id
         vappTemplate = getVCloudApi().getVAppTemplateApi().captureVAppAsTemplateInVDC(URI.create(node.getId()),
                  group, URI.create(node.getLocation().getId()));
View Full Code Here

      for (ReferenceType vdc : org.getVDCs().values()) {
         VDC response = getVCloudApi().getVDCApi().getVDC(vdc.getHref());
         for (ReferenceType item : response.getResourceEntities().values()) {
            if (item.getType().equals(VCloudMediaType.VAPP_XML)) {
               try {
                  VApp app = getVCloudApi().getVAppApi().getVApp(item.getHref());
                  assertNotNull(app);
               } catch (RuntimeException e) {

               }
            }
View Full Code Here

         });
   }

   @VisibleForTesting
   void addVAppToSetRetryingIfNotYetPresent(Builder<VApp> nodes, ReferenceType vdc, ReferenceType resource) {
      VApp node = null;
      int i = 0;
      while (node == null && i++ < 3) {
         try {
            node = client.getVAppApi().getVApp(resource.getHref());
            nodes.add(node);
View Full Code Here

   }
  
   @Override
   public void destroyNode(String id) {
      URI vappId = URI.create(checkNotNull(id, "node.id"));
      VApp vApp = cancelAnyRunningTasks(vappId);
      if (vApp.getStatus() != Status.OFF) {
         logger.debug(">> powering off VApp vApp(%s), current status: %s", vApp.getName(), vApp.getStatus());
         try {
            waitForTask(client.getVAppApi().powerOffVApp(vApp.getHref()));
            vApp = client.getVAppApi().getVApp(vApp.getHref());
            logger.debug("<< %s vApp(%s)", vApp.getStatus(), vApp.getName());
         } catch (IllegalStateException e) {
            logger.warn(e, "<< %s vApp(%s)", vApp.getStatus(), vApp.getName());
         }
         logger.debug(">> undeploying vApp(%s), current status: %s", vApp.getName(), vApp.getStatus());
         try {
            waitForTask(client.getVAppApi().undeployVApp(vApp.getHref()));
            vApp = client.getVAppApi().getVApp(vApp.getHref());
            logger.debug("<< %s vApp(%s)", vApp.getStatus(), vApp.getName());
         } catch (IllegalStateException e) {
            logger.warn(e, "<< %s vApp(%s)", vApp.getStatus(), vApp.getName());
         }
      }
      logger.debug(">> deleting vApp(%s)", vApp.getHref());
      waitForTask(client.getVAppApi().deleteVApp(vApp.getHref()));
      logger.debug("<< deleted vApp(%s)", vApp.getHref());
   }
View Full Code Here

      waitForTask(client.getVAppApi().deleteVApp(vApp.getHref()));
      logger.debug("<< deleted vApp(%s)", vApp.getHref());
   }

   VApp waitForPendingTasksToComplete(URI vappId) {
      VApp vApp = client.getVAppApi().getVApp(vappId);
      if (vApp.getTasks().size() == 0)
         return vApp;
      for (Task task : vApp.getTasks())
         waitForTask(task);
      return client.getVAppApi().getVApp(vappId);
   }
View Full Code Here

         waitForTask(task);
      return client.getVAppApi().getVApp(vappId);
   }

   VApp cancelAnyRunningTasks(URI vappId) {
      VApp vApp = client.getVAppApi().getVApp(vappId);
      if (vApp.getTasks().size() == 0)
         return vApp;
      for (Task task : vApp.getTasks()) {
         try {
            client.getTaskApi().cancelTask(task.getHref());
            waitForTask(task);
         } catch (TaskInErrorStateException e) {
         }
View Full Code Here

TOP

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

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.