Package org.jclouds.vcloud.director.v1_5.features

Examples of org.jclouds.vcloud.director.v1_5.features.VdcApi


      vApp = vAppApi.get(vApp.getId()); // reload, so it has the VMs
      List<Vm> vms = vApp.getChildren().getVms();
      Set<URI> vmHrefs = toHrefs(vms);

      // Method under test: do the query
      QueryResultRecords queryResult = queryApi.vmsQueryAll();
      Set<URI> hrefs = toHrefs(queryResult);

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VM, null), QueryResultVMRecord.class);
      assertTrue(hrefs.containsAll(vmHrefs), "VMs query result should include vms " + vmHrefs + "; but only has "
               + hrefs);
View Full Code Here


  @Test(description = "GET /vms/query?filter", dependsOnMethods = { "testQueryAllVms" })
  public void testQueryAllVmsWithFilter() {
    List<Vm> vms = vApp.getChildren().getVms();
    Set<URI> vmHrefs = toHrefs(vms);

    QueryResultRecords queryResult = queryApi.vmsQuery(String.format(
        "containerName==%s", vApp.getName()));
    Set<URI> hrefs = toHrefs(queryResult);

    assertRecordTypes(queryResult,
        Arrays.asList(VCloudDirectorMediaType.VM, null),
View Full Code Here

        message);
  }

   @Test(description = "GET /mediaList/query")
   public void testQueryAllMedia() {
      QueryResultRecords queryResult = queryApi.mediaListQueryAll();

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class);
   }
View Full Code Here

   }

   @Test(description = "GET /mediaList/query?filter")
   public void testQueryMediaWithFilter() {
      String mediaName = "abc";
      QueryResultRecords queryResult = queryApi.mediaListQuery(String.format("name==%s", mediaName));

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class);
   }
View Full Code Here

      return params;
   }

   public static GuestCustomizationSection getGuestCustomizationSection() {
      GuestCustomizationSection section = GuestCustomizationSection.builder()
            .build();

      return section;
   }
View Full Code Here

            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/getLeaseSettingsSection.xml", VCloudDirectorMediaType.LEASE_SETTINGS_SECTION)
            .httpResponseBuilder().build());

      LeaseSettingsSection expected = getLeaseSettingsSection();

      assertEquals(api.getVAppApi().getLeaseSettingsSection(vAppURI), expected);
   }
View Full Code Here

            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/editLeaseSettingsSectionTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

      LeaseSettingsSection section = getLeaseSettingsSection().toBuilder()
            .build();

    Task expected = editLeaseSettingsSectionTask();

    assertEquals(api.getVAppApi().editLeaseSettingsSection(vAppURI, section), expected);
View Full Code Here

      return task;
   }

   public static LeaseSettingsSection getLeaseSettingsSection() {
      LeaseSettingsSection section = LeaseSettingsSection.builder()
            .build();

      return section;
   }
View Full Code Here

   protected VApp instantiateVApp(String name) {
      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);
View Full Code Here

   protected VApp instantiateVApp(String name) {
      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);
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.features.VdcApi

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.