Examples of VDC


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

      }
   }

   @Test(description = "GET /vdc/{id}")
   public void testGetVdc() {
      Vdc vdc = lazyGetVdc();
      assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
      assertNotEquals("DO NOT USE", vdc.getDescription(), "vDC isn't to be used for testing");
      Checks.checkVdc(vdc);
   }
View Full Code Here

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

   }

   // TODO Duplicates code in VAppApiLiveTest
   @Test(description = "POST /vdc/{id}/action/instantiateVAppTemplate")
   public void testInstantiateVAppTemplate() {
      Vdc vdc = vdcApi.get(vdcUrn);

      Set<Reference> networks = vdc.getAvailableNetworks();
      Optional<Reference> parentNetwork = Iterables.tryFind(networks, new Predicate<Reference>() {
         @Override
         public boolean apply(Reference reference) {
            return reference.getHref().equals(network.getHref());
         }
View Full Code Here

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

   }

   @Test(description = "POST /catalog/{id}/catalogItems")
   public void testAddCatalogItem() {
      byte[] iso = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
      Vdc vdc = lazyGetVdc();
      Link addMedia = find(vdc.getLinks(), and(relEquals("add"), typeEquals(VCloudDirectorMediaType.MEDIA)));

      Media sourceMedia = Media.builder().type(VCloudDirectorMediaType.MEDIA).name(name("TestMedia-")).size(iso.length)
               .imageType(Media.ImageType.ISO).description("Test media generated by testAddMedia()").build();
      media = context.getApi().getMediaApi().add(addMedia.getHref(), sourceMedia);
View Full Code Here

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

  @Test(description = "Create Key Pair")
  public void testCreateKeyPair() throws URISyntaxException {
    sshKey = SshKeys.generate();
    String keyPairName = "NewKeyPair";
    Vdc currentVDC = lazyGetVdc();
    Media keyPairsContainer = findOrCreateKeyPairContainerInVDCNamed(currentVDC,
        keyPairContainer, keyPairName);
    String keypairValue = context.getApi().getMetadataApi(
        keyPairsContainer.getId()).get(keyPairName);
    assertEquals(keypairValue, generateKeyPair(keyPairName));
View Full Code Here

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

  }

  @Test(description = "DeleteKeyPair", dependsOnMethods = { "testCreateKeyPair" })
  public void testDeleteKeyPair() {
    String keyPairName = "NewKeyPair";
    Vdc currentVDC = lazyGetVdc();
    Media keyPairsContainer = findOrCreateKeyPairContainerInVDCNamed(currentVDC,
        keyPairContainer, keyPairName);
    Task removeMedia = mediaApi.remove(keyPairsContainer.getId());
    Checks.checkTask(removeMedia);
    assertTrue(retryTaskSuccess.apply(removeMedia),
View Full Code Here

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

      return networkConfigSection;
   }

   /** Build a {@link NetworkConfiguration} object. */
   private NetworkConfiguration networkConfiguration() {
      Vdc vdc = context.getApi().getVdcApi().get(vdcUrn);
      assertNotNull(vdc, String.format(ENTITY_NON_NULL, VDC));

      Set<Reference> networks = vdc.getAvailableNetworks();
      network = lazyGetNetwork();
      // Look up the network in the Vdc with the id configured for the tests
      Optional<Reference> parentNetwork = tryFind(networks, new Predicate<Reference>() {
         @Override
         public boolean apply(Reference reference) {
View Full Code Here

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

      }
   }

   @Test(description = "POST /vdc/{id}/media")
   public void testAddMedia() throws URISyntaxException {
      Vdc vdc = lazyGetVdc();
      Link addMedia = find(vdc.getLinks(), and(relEquals("add"), typeEquals(VCloudDirectorMediaType.MEDIA)));

      // TODO: generate an iso
      byte[] iso = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };

      Media sourceMedia = Media.builder().type(VCloudDirectorMediaType.MEDIA).name("Test media " + random.nextInt())
View Full Code Here

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

               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vdc/vdc.xml", VCloudDirectorMediaType.VDC)
               .httpResponseBuilder().build());
     
      Vdc expected = getVdc();

      assertEquals(api.getVdcApi().get(vdcURI), expected);
   }
View Full Code Here

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

   }

   @Test(description = "POST /catalog/{id}/catalogItems")
   public void testAddCatalogItem() {
      byte[] iso = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
      Vdc vdc = lazyGetVdc();
      Link addMedia = find(vdc.getLinks(), and(relEquals("add"), typeEquals(VCloudDirectorMediaType.MEDIA)));

      Media sourceMedia = Media.builder().type(VCloudDirectorMediaType.MEDIA).name(name("TestMedia-")).size(iso.length)
               .imageType(Media.ImageType.ISO).description("Test media generated by testAddMedia()").build();
      media = context.getApi().getMediaApi().add(addMedia.getHref(), sourceMedia);
View Full Code Here

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

  @Test(description = "Create Key Pair")
  public void testCreateKeyPair() throws URISyntaxException {
    sshKey = SshKeys.generate();
    String keyPairName = "NewKeyPair";
    Vdc currentVDC = lazyGetVdc();
    Media keyPairsContainer = findOrCreateKeyPairContainerInVDCNamed(currentVDC,
        keyPairContainer, keyPairName);
    String keypairValue = context.getApi().getMetadataApi(
        keyPairsContainer.getId()).get(keyPairName);
    assertEquals(keypairValue, generateKeyPair(keyPairName));
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.