Package org.jclouds.softlayer.domain

Examples of org.jclouds.softlayer.domain.OperatingSystem$Builder


      // list private images and transform them to OperatingSystem
      Set<VirtualGuestBlockDeviceTemplateGroup> privateImages = api.getAccountApi().getBlockDeviceTemplateGroups();
      Map<String, SoftwareDescription> privateImagesSoftwareDescriptions = extractSoftwareDescriptions(privateImages);
      for (Map.Entry<String, SoftwareDescription> entry : privateImagesSoftwareDescriptions.entrySet()) {
         OperatingSystem os = getOperatingSystem(entry);
         if (os != null) {
            result.add(os);
         }
      }
      // list public images and transform them to OperatingSystem
      if (includePublicImages) {
         Set<VirtualGuestBlockDeviceTemplateGroup> publicImages = api.getVirtualGuestBlockDeviceTemplateGroupApi().getPublicImages();
         Map<String, SoftwareDescription> publicImagesSoftwareDescriptions = extractSoftwareDescriptions(publicImages);
         for (Map.Entry<String, SoftwareDescription> entry : publicImagesSoftwareDescriptions.entrySet()) {
            OperatingSystem os = getOperatingSystem(entry);
            if (os != null) {
               result.add(os);
            }
         }
      }
View Full Code Here


@Test(groups = "unit", testName = "OperatingSystemToImageTest")
public class OperatingSystemToImageTest {

   @Test
   public void testOperatingSystemToImage() {
      OperatingSystem operatingSystem = OperatingSystem.builder()
              .id("123456789")
              .softwareLicense(SoftwareLicense.builder()
                      .softwareDescription(SoftwareDescription.builder()
                              .version("12.04-64 Minimal for CCI")
                              .referenceCode("UBUNTU_12_64")
                              .longDescription("Ubuntu Linux 12.04 LTS Precise Pangolin - Minimal Install (64 bit)")
                              .build())
                      .build())
              .build();
      Image image = new OperatingSystemToImage().apply(operatingSystem);

      assertEquals(image.getId(), operatingSystem.getId());
      String referenceCode = operatingSystem.getSoftwareLicense().getSoftwareDescription().getReferenceCode();
      assertEquals(image.getDescription(), referenceCode);
      assertTrue(image.getOperatingSystem().getFamily().toString().equalsIgnoreCase("UBUNTU"));
      assertEquals(image.getOperatingSystem().getVersion(), "12.04");
      assertEquals(image.getOperatingSystem().is64Bit(), true);
      assertEquals(image.getStatus(), Image.Status.AVAILABLE);
View Full Code Here

TOP

Related Classes of org.jclouds.softlayer.domain.OperatingSystem$Builder

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.