Examples of VAppTemplate


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

            .getHref());

      if (customizationOptions.canCustomizePassword())
         instantiateOptions.withPassword("robotsarefun");

      VAppTemplate vAppTemplate = api.getVAppTemplate(item.getEntity().getHref());

      assert vAppTemplate != null;

      // instantiate, noting vApp returned has minimal details
      vApp = api.instantiateVAppTemplateInVDC(vdc.getHref(), vAppTemplate.getHref(), serverName,
            instantiateOptions);

      assertEquals(vApp.getStatus(), Status.RESOLVED);

      // in terremark, this should be a no-op, as it should simply return the
View Full Code Here

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

      cleanUpVAppTemplateInOrg();
   }

   @Test(description = "GET /query")
   public void testQuery() {
      VAppTemplate vAppTemplate = lazyGetVAppTemplate();
      QueryResultRecords queryResult = queryApi
               .query("vAppTemplate", String.format("name==%s", vAppTemplate.getName()));
      Set<URI> hrefs = toHrefs(queryResult);

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null),
               QueryResultVAppTemplateRecord.class);
      assertTrue(hrefs.contains(vAppTemplate.getHref()), "VAppTemplates query result should include vAppTemplate "
               + vAppTemplate.getHref() + "; but only has " + hrefs);
   }
View Full Code Here

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

               + lazyGetVAppTemplate().getHref() + "; but only has " + hrefs);
   }

   @Test(description = "GET /vAppTemplates/query?filter")
   public void testQueryVAppTemplatesWithFilter() {
      VAppTemplate vAppTemplate = lazyGetVAppTemplate();
      QueryResultRecords queryResult = queryApi.vAppTemplatesQuery(String.format("name==%s", vAppTemplate.getName()));
      Set<URI> hrefs = toHrefs(queryResult);

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null),
               QueryResultVAppTemplateRecord.class);
      assertTrue(hrefs.contains(vAppTemplate.getHref()), "VAppTemplates query result should have found vAppTemplate "
               + vAppTemplate.getHref());
   }
View Full Code Here

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

            new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId).acceptMedia(TASK).httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
      ).getVAppTemplateApi();

      assertNotNull(api);
      VAppTemplate template = api.get(uri);

      assertEquals(template, exampleTemplate());

      Task task = api.edit(uri, exampleTemplate());
      assertNotNull(task);
View Full Code Here

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

      Checks.checkVdc(vdc);
   }

   @Test(description = "POST /vdc/{id}/action/captureVApp", dependsOnMethods = { "testInstantiateVAppTemplate" })
   public void testCaptureVApp() {
    VAppTemplate vAppTemplate = vappTemplateApi.get(vAppTemplateUrn);
      String name = name("captured-");

      CaptureVAppParams captureVappParams = CaptureVAppParams.builder()
          .name(name)
          .source(instantiatedVApp.getHref())
View Full Code Here

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

   private VAppTemplate cloneVAppTemplate(boolean waitForTask) throws Exception {
      CloneVAppTemplateParams cloneVAppTemplateParams = CloneVAppTemplateParams.builder()
               .source(Reference.builder().href(lazyGetVAppTemplate().getHref()).build()).isSourceDelete(false)
               .name("clone").build();
      VAppTemplate clonedVappTemplate = vdcApi.cloneVAppTemplate(vdcUrn, cloneVAppTemplateParams);

      if (waitForTask) {
         Task cloneTask = Iterables.getFirst(clonedVappTemplate.getTasks(), null);
         assertNotNull(cloneTask, "vdcApi.cloneVAppTemplate returned VAppTemplate that did not contain any tasks");
         assertTaskSucceeds(cloneTask);
      }
      return clonedVappTemplate;
   }
View Full Code Here

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

   @Test(description = "PUT /vAppTemplate/{id}")
   public void testEditVAppTemplate() {
      String name = name("myname-");
      String description = name("Description ");
      VAppTemplate template = VAppTemplate.builder().name(name).description(description).build();

      final Task task = vAppTemplateApi.edit(vAppTemplateUrn, template);
      assertTaskSucceeds(task);

      VAppTemplate newTemplate = vAppTemplateApi.get(vAppTemplateUrn);
      assertEquals(newTemplate.getName(), name);
      assertEquals(newTemplate.getDescription(), description);
   }
View Full Code Here

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

      assertEquals(newLeaseSettingsSection.getStorageLeaseInSeconds(), (Integer) storageLeaseInSeconds);
   }

   @Test(description = "DELETE /vAppTemplate/{id}", dependsOnMethods = { "testGetVAppTemplate" })
   public void testRemoveVAppTemplate() throws Exception {
      VAppTemplate clonedVappTemplate = cloneVAppTemplate(true);

      // Confirm that "get" works pre-remove
      VAppTemplate vAppTemplatePreDelete = vAppTemplateApi.get(clonedVappTemplate.getHref());
      checkVAppTemplate(vAppTemplatePreDelete);

      // Delete the template
      final Task task = vAppTemplateApi.remove(clonedVappTemplate.getHref());
      assertTaskSucceeds(task);

      // Confirm that can't access post-remove, i.e. template has been removed
      VAppTemplate removed = vAppTemplateApi.get(clonedVappTemplate.getHref());
      assertNull(removed);
   }
View Full Code Here

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

      vAppTemplateApi.disableDownload(vAppTemplateUrn);

      // TODO Check that it really is disabled. The only thing I can see for determining this
      // is the undocumented "download" link in the VAppTemplate. But that is brittle and we
      // don't know what timing guarantees there are for adding/removing the link.
      VAppTemplate vAppTemplate = vAppTemplateApi.get(vAppTemplateUrn);
      Set<Link> links = vAppTemplate.getLinks();
      assertTrue(Iterables.all(Iterables.transform(links, rel),
               Predicates.not(Predicates.in(EnumSet.of(Link.Rel.DOWNLOAD_DEFAULT, Link.Rel.DOWNLOAD_ALTERNATE)))),
               "Should not offer download link after disabling download: " + vAppTemplate);
   }
View Full Code Here

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

      assertTaskSucceedsLong(task);

      // TODO Check that it really is enabled. The only thing I can see for determining this
      // is the undocumented "download" link in the VAppTemplate. But that is brittle and we
      // don't know what timing guarantees there are for adding/removing the link.
      VAppTemplate vAppTemplate = vAppTemplateApi.get(vAppTemplateUrn);
      Set<Link> links = vAppTemplate.getLinks();
      assertTrue(
               Iterables.any(Iterables.transform(links, rel),
                        Predicates.in(EnumSet.of(Link.Rel.DOWNLOAD_DEFAULT, Link.Rel.DOWNLOAD_ALTERNATE))),
               "Should offer download link after enabling download: " + vAppTemplate);
   }
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.