Examples of VApp


Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

    * @see VmApi#remove(String)
    */
   @Test(description = "DELETE /vApp/{id}")
   public void testRemoveVm() {
      // Create a temporary VApp to remove
      VApp remove = instantiateVApp();
      DeployVAppParams params = DeployVAppParams.builder()
               .deploymentLeaseSeconds((int) TimeUnit.SECONDS.convert(1L, TimeUnit.HOURS)).notForceCustomization()
               .powerOn().build();
      Task deployVApp = vAppApi.deploy(remove.getId(), params);
      assertTaskSucceedsLong(deployVApp);

      // Get the edited VApp and the Vm
      remove = vAppApi.get(remove.getId());
      List<Vm> vms = remove.getChildren().getVms();
      Vm temp = Iterables.get(vms, 0);

      // otherwise it's impossible to stop a running vApp with no vms
      if (vms.size() == 1) {
         UndeployVAppParams undeployParams = UndeployVAppParams.builder().build();
         Task shutdownVapp = vAppApi.undeploy(remove.getId(), undeployParams);
         assertTaskSucceedsLong(shutdownVapp);
      } else {
         powerOffVm(temp.getId());
      }
      // The method under test
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

    api.getVAppApi().exitMaintenanceMode(vAppURI);
   }

   public static VApp getVApp() {
      // FIXME Does not match XML
      VApp vApp = VApp.builder()
            .href(URI.create("https://mycloud.greenhousedata.com/api/vApp/vapp-d0e2b6b9-4381-4ddc-9572-cdfae54059be"))
//            .link(Link.builder()
//                     .href(URI.create())
//                     .build())
            .build();
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

   @Test(description = "POST /vApp/{id}/action/enterMaintenanceMode", groups = { "systemAdmin" })
   public void testEnterMaintenanceMode() {

      // Do this to a new vApp, so don't mess up subsequent tests by making the vApp read-only
      VApp temp = instantiateVApp();
      DeployVAppParams params = DeployVAppParams.builder()
               .deploymentLeaseSeconds((int) TimeUnit.SECONDS.convert(1L, TimeUnit.HOURS)).notForceCustomization()
               .notPowerOn().build();
      Task deployVApp = vAppApi.deploy(temp.getId(), params);
      assertTaskSucceedsLong(deployVApp);

      try {
         // Method under test
         vAppApi.enterMaintenanceMode(temp.getId());

         temp = vAppApi.get(temp.getId());
         assertTrue(temp.isInMaintenanceMode(),
                  String.format(CONDITION_FMT, "InMaintenanceMode", "TRUE", temp.isInMaintenanceMode()));

         // Exit maintenance mode
         vAppApi.exitMaintenanceMode(temp.getId());
      } finally {
         cleanUpVApp(temp);
      }
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

   }

   @Test(description = "POST /vApp/{id}/action/exitMaintenanceMode", dependsOnMethods = { "testEnterMaintenanceMode" }, groups = { "systemAdmin" })
   public void testExitMaintenanceMode() {
      // Do this to a new vApp, so don't mess up subsequent tests by making the vApp read-only
      VApp temp = instantiateVApp();
      DeployVAppParams params = DeployVAppParams.builder()
               .deploymentLeaseSeconds((int) TimeUnit.SECONDS.convert(1L, TimeUnit.HOURS)).notForceCustomization()
               .notPowerOn().build();
      Task deployVApp = vAppApi.deploy(temp.getId(), params);
      assertTaskSucceedsLong(deployVApp);

      try {
         // Enter maintenance mode
         vAppApi.enterMaintenanceMode(temp.getId());

         // Method under test
         vAppApi.exitMaintenanceMode(temp.getId());

         temp = vAppApi.get(temp.getId());
         assertFalse(temp.isInMaintenanceMode(),
                  String.format(CONDITION_FMT, "InMaintenanceMode", "FALSE", temp.isInMaintenanceMode()));
      } finally {
         cleanUpVApp(temp);
      }
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vdc/cloneVApp.xml", VCloudDirectorMediaType.VAPP)
               .httpResponseBuilder().build());
     
      VApp expected = cloneVApp();

      // TODO: configure params
      CloneVAppParams params = CloneVAppParams.builder()
        
         .build();
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vdc/composeVApp.xml", VCloudDirectorMediaType.VAPP)
               .httpResponseBuilder().build());
     
      VApp expected = composeVApp();

      // TODO: configure params
      ComposeVAppParams params = ComposeVAppParams.builder()
        
         .build();
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vdc/instantiateVAppTemplate.xml", VCloudDirectorMediaType.VAPP)
               .httpResponseBuilder().build());
     
      VApp expected = instantiateVAppTemplate();

      // TODO: configure params
      InstantiateVAppTemplateParams params = InstantiateVAppTemplateParams.builder()
        
         .build();
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

      // Get the configured VAppTemplate for the tests
      vAppTemplate = vAppTemplateApi.get(vAppTemplateUrn);
      assertNotNull(vAppTemplate, String.format(ENTITY_NON_NULL, VAPP_TEMPLATE));

      // Instantiate a new VApp
      VApp vAppInstantiated = instantiateVApp();
      assertNotNull(vAppInstantiated, String.format(ENTITY_NON_NULL, VAPP));
      vAppUrn = vAppInstantiated.getId();

      // Wait for the task to complete
      Task instantiateTask = Iterables.getOnlyElement(vAppInstantiated.getTasks());
      assertTrue(retryTaskSuccessLong.apply(instantiateTask), String.format(TASK_COMPLETE_TIMELY, "instantiateTask"));

      // Get the instantiated VApp
      vApp = vAppApi.get(vAppUrn);
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

   /**
    * Power on a {@link VApp}.
    */
   protected VApp powerOnVApp(String vAppUrn) {
      VApp test = vAppApi.get(vAppUrn);
      Status status = test.getStatus();
      if (status != Status.POWERED_ON) {
         Task powerOn = vAppApi.powerOn(vAppUrn);
         assertTaskSucceedsLong(powerOn);
      }
      test = vAppApi.get(vAppUrn);
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.VApp

   /**
    * Power off a {@link VApp}.
    */
   protected VApp powerOffVApp(String vAppUrn) {
      VApp test = vAppApi.get(vAppUrn);
      Status status = test.getStatus();
      if (status != Status.POWERED_OFF) {
         Task powerOff = vAppApi.powerOff(vAppUrn);
         assertTaskSucceedsLong(powerOff);
      }
      test = vAppApi.get(vAppUrn);
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.