Package org.jclouds.trmk.vcloud_0_8.domain

Examples of org.jclouds.trmk.vcloud_0_8.domain.VApp


    * @see VAppApi#remove(URI)
    */
   @Test(groups = { "live", "user" }, description = "DELETE /vApp/{id}")
   public void testRemoveVApp() {
      // Create a temporary VApp to remove
      VApp temp = instantiateVApp();

      // The method under test
      Task removeVApp = vAppApi.remove(temp.getId());
      assertTrue(retryTaskSuccess.apply(removeVApp), String.format(TASK_COMPLETE_TIMELY, "removeVApp"));

      VApp removed = vAppApi.get(temp.getId());
      assertNull(removed, "The VApp " + temp.getName() + " should have been removed");
   }
View Full Code Here


    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

   @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

   }

   @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

      // 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

   /**
    * 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

   /**
    * 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

   /**
    * Suspend a {@link VApp}.
    */
   protected VApp suspendVApp(String vAppUrn) {
      VApp test = vAppApi.get(vAppUrn);
      Status status = test.getStatus();
      if (status != Status.SUSPENDED) {
         Task suspend = vAppApi.suspend(vAppUrn);
         assertTaskSucceedsLong(suspend);
      }
      test = vAppApi.get(vAppUrn);
View Full Code Here

   /**
    * Check the {@link VApp}s current status.
    */
   protected void assertVAppStatus(final String vAppUrn, final Status status) {
      VApp testVApp = vAppApi.get(vAppUrn);
      assertStatus(VAPP, testVApp, status);
   }
View Full Code Here

      InstantiateVAppTemplateParams instantiate = InstantiateVAppTemplateParams.builder().name(name).notDeploy()
               .notPowerOn().description("Test VApp").instantiationParams(instantiationParams())
               .source(Reference.builder().href(lazyGetVAppTemplate().getHref()).build()).build();

      VdcApi vdcApi = context.getApi().getVdcApi();
      VApp vAppInstantiated = vdcApi.instantiateVApp(vdcUrn, instantiate);
      assertNotNull(vAppInstantiated, String.format(ENTITY_NON_NULL, VAPP));

      Task instantiationTask = getFirst(vAppInstantiated.getTasks(), null);
      if (instantiationTask != null)
         assertTaskSucceedsLong(instantiationTask);

      // Save VApp name for cleanUp
      vAppNames.add(name);
View Full Code Here

TOP

Related Classes of org.jclouds.trmk.vcloud_0_8.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.