Package org.jclouds.trmk.vcloud_0_8.domain

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


            URI.create("https://vcloud.safesecureweb.com/api/v0.8/vdc/1"),
            URI.create("https://vcloud/vAppTemplate/3"),
            "name",
            InstantiateVAppTemplateOptions.Builder.processorCount(2).memory(512).inGroup("group")
                  .withPassword("password").inRow("row")
                  .addNetworkConfig(new NetworkConfig(URI.create("http://network")))));

      assertRequestLineEquals(request,
            "POST https://vcloud.safesecureweb.com/api/v0.8/vdc/1/action/instantiateVAppTemplate HTTP/1.1");
      assertNonPayloadHeadersEqual(request, "Accept: application/vnd.vmware.vcloud.vApp+xml\n");
      assertPayloadEquals(request, Strings2.toStringAndClose(getClass().getResourceAsStream(
View Full Code Here


   }

   @Test
   public void testAddNetworkConfig() {
      InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
      options.addNetworkConfig(new NetworkConfig("default", URI.create("http://localhost"), FenceMode.ALLOW_IN_OUT));
      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getNetworkName(), "default");
      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getParentNetwork(), URI.create("http://localhost"));
      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getFenceMode(), FenceMode.ALLOW_IN_OUT);
   }
View Full Code Here

      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getFenceMode(), FenceMode.ALLOW_IN_OUT);
   }

   @Test
   public void testAddNetworkConfigStatic() {
      InstantiateVAppTemplateOptions options = addNetworkConfig(new NetworkConfig("default",
            URI.create("http://localhost"), FenceMode.ALLOW_IN_OUT));
      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getNetworkName(), "default");
      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getParentNetwork(), URI.create("http://localhost"));
      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getFenceMode(), FenceMode.ALLOW_IN_OUT);
   }
View Full Code Here

      String network = (defaultNetwork != null) ? defaultNetwork.get().getHref().toASCIIString() : null;
      String fenceMode = defaultFenceMode;
      String networkName = name;
      if (options != null) {
         if (options.getNetworkConfig().size() > 0) {
            NetworkConfig config = Iterables.get(options.getNetworkConfig(), 0);
            network = ifNullDefaultTo(config.getParentNetwork(), network);
            fenceMode = ifNullDefaultTo(config.getFenceMode(), defaultFenceMode);
            networkName = ifNullDefaultTo(config.getNetworkName(), networkName);
         }
         addQuantity(options, virtualHardwareQuantity);
      }
      try {
         return stringBinder.bindToRequest(request,
View Full Code Here

      assertEquals(catalog.getId(), catalogUrn);
   }

   @Test(description = "GET /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
   public void testGetCatalogItem() {
      CatalogItem catalogItem = catalogApi.getItem(this.catalogItem.getId());
      checkCatalogItem(catalogItem);
      assertEquals(catalogItem.getEntity().getHref(), this.catalogItem.getEntity().getHref());
   }
View Full Code Here

               .imageType(Media.ImageType.ISO).description("Test media generated by testAddMedia()").build();
      media = context.getApi().getMediaApi().add(addMedia.getHref(), sourceMedia);

      Checks.checkMediaFor(VCloudDirectorMediaType.MEDIA, media);

      CatalogItem editedCatalogItem = CatalogItem.builder().name("newitem").description("New Item")
               .type(VCloudDirectorMediaType.CATALOG_ITEM).entity(Reference.builder().href(media.getHref()).build())
               .build();
      catalogItem = catalogApi.addItem(catalogUrn, editedCatalogItem);
      checkCatalogItem(catalogItem);
      assertEquals(catalogItem.getName(), "newitem");
View Full Code Here

      assertEquals(catalogItem.getDescription(), "New Item");
   }

   @Test(description = "PUT /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
   public void testEditCatalogItem() {
      CatalogItem editedCatalogItem = CatalogItem.builder().fromCatalogItem(catalogItem).name("UPDATEDNAME").build();
      catalogItem = catalogApi.editItem(catalogItem.getId(), editedCatalogItem);
      checkCatalogItem(catalogItem);
      assertEquals(catalogItem.getName(), "UPDATEDNAME");
   }
View Full Code Here

      assertEquals(catalog.getId(), catalogUrn);
   }

   @Test(description = "GET /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
   public void testGetCatalogItem() {
      CatalogItem catalogItem = catalogApi.getItem(this.catalogItem.getId());
      checkCatalogItem(catalogItem);
      assertEquals(catalogItem.getEntity().getHref(), this.catalogItem.getEntity().getHref());
   }
View Full Code Here

               .imageType(Media.ImageType.ISO).description("Test media generated by testAddMedia()").build();
      media = context.getApi().getMediaApi().add(addMedia.getHref(), sourceMedia);

      Checks.checkMediaFor(VCloudDirectorMediaType.MEDIA, media);

      CatalogItem editedCatalogItem = CatalogItem.builder().name("newitem").description("New Item")
               .type(VCloudDirectorMediaType.CATALOG_ITEM).entity(Reference.builder().href(media.getHref()).build())
               .build();
      catalogItem = catalogApi.addItem(catalogUrn, editedCatalogItem);
      checkCatalogItem(catalogItem);
      assertEquals(catalogItem.getName(), "newitem");
View Full Code Here

      assertEquals(catalogItem.getDescription(), "New Item");
   }

   @Test(description = "PUT /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
   public void testEditCatalogItem() {
      CatalogItem editedCatalogItem = CatalogItem.builder().fromCatalogItem(catalogItem).name("UPDATEDNAME").build();
      catalogItem = catalogApi.editItem(catalogItem.getId(), editedCatalogItem);
      checkCatalogItem(catalogItem);
      assertEquals(catalogItem.getName(), "UPDATEDNAME");
   }
View Full Code Here

TOP

Related Classes of org.jclouds.trmk.vcloud_0_8.domain.CatalogItem

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.