Package org.jclouds.cloudstack.domain

Examples of org.jclouds.cloudstack.domain.OSType


      });
      assertEquals(Iterables.size(networks), 1);
      Network network = Iterables.getOnlyElement(networks, null);
      assertNotNull(network);
      Set<OSType> osTypes = client.getGuestOSClient().listOSTypes();
      OSType osType = Iterables.getFirst(osTypes, null);

      // Register a template
      RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32).isExtractable(true);
      TemplateMetadata templateMetadata = TemplateMetadata.builder().name(prefix+"-registerTemplate").osTypeId(osType.getId()).displayText("jclouds live testRegisterTemplate").build();
      Set<Template> templates = client.getTemplateClient().registerTemplate(templateMetadata, "VHD", "XenServer", IMPORT_VHD_URL, zone.getId(), options);
      registeredTemplate = Iterables.getOnlyElement(templates, null);
      assertNotNull(registeredTemplate);

      // Ensure it is available
View Full Code Here


   public void testListOSTypes() throws Exception {
      Set<OSType> response = client.getGuestOSClient().listOSTypes();
      assert null != response;
      assertTrue(response.size() >= 0);
      for (OSType type : response) {
         OSType newDetails = getOnlyElement(client.getGuestOSClient().listOSTypes(
               ListOSTypesOptions.Builder.id(type.getId())));
         assertEquals(type.getId(), newDetails.getId());
         checkOSType(type);
      }
   }
View Full Code Here

   }

   public OperatingSystem apply(Template from) {
      Builder builder = OperatingSystem.builder().description(from.getOSType());

      OSType type = osTypes.get().get(from.getOSTypeId());
      if (type == null) {
         logger.warn("Template refers to OS type ID %s but this does not exist. Template=%s Known OS types=%s", from.getOSTypeId(), from, osTypes.get());
         return builder.build();
      }
      builder.description(type.getDescription());
      builder.is64Bit(type.getDescription().indexOf("64-bit") != -1);
      String osCategory = osCategories.get().get(type.getOSCategoryId());
      if (osCategory == null) {
         logger.warn("OS type refers to OS category ID %s but this does not exist. OS type=%s Known OS categories=%s", type.getOSCategoryId(), type, osCategories.get());
         return builder.build();
      }
      builder.name(osCategory);
      OsFamily family = OsFamily.fromValue(osCategory.toLowerCase());
      builder.family(family);
      Matcher matcher = DEFAULT_PATTERN.matcher(type.getDescription());
      if (matcher.find()) {
         builder.version(ComputeServiceUtils.parseVersionOrReturnEmptyString(family, matcher.group(1), osVersionMap));
      }
      return builder.build();
   }
View Full Code Here

   public void testListOSTypes() throws Exception {
      Set<OSType> response = client.getGuestOSApi().listOSTypes();
      assert null != response;
      assertTrue(response.size() >= 0);
      for (OSType type : response) {
         OSType newDetails = getOnlyElement(client.getGuestOSApi().listOSTypes(
               ListOSTypesOptions.Builder.id(type.getId())));
         assertEquals(type.getId(), newDetails.getId());
         checkOSType(type);
      }
   }
View Full Code Here

      });
      assertEquals(Iterables.size(networks), 1);
      Network network = Iterables.getOnlyElement(networks, null);
      assertNotNull(network);
      Set<OSType> osTypes = client.getGuestOSApi().listOSTypes();
      OSType osType = Iterables.getFirst(osTypes, null);

      // Register a template
      RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32).isExtractable(true);
      TemplateMetadata templateMetadata = TemplateMetadata.builder().name(prefix+"-registerTemplate").osTypeId(osType.getId()).displayText("jclouds live testRegisterTemplate").build();
      Set<Template> templates = client.getTemplateApi().registerTemplate(templateMetadata, "VHD", "XenServer", IMPORT_VHD_URL, zone.getId(), options);
      registeredTemplate = Iterables.getOnlyElement(templates, null);
      assertNotNull(registeredTemplate);

      // Ensure it is available
View Full Code Here

   }

   public OperatingSystem apply(Template from) {
      Builder builder = OperatingSystem.builder().description(from.getOSType());

      OSType type = osTypes.get().get(from.getOSTypeId());
      if (type == null) {
         logger.warn("Template refers to OS type ID %s but this does not exist. Template=%s Known OS types=%s", from.getOSTypeId(), from, osTypes.get());
         return builder.build();
      }
      builder.description(type.getDescription());
      builder.is64Bit(type.getDescription().indexOf("64-bit") != -1);
      String osCategory = osCategories.get().get(type.getOSCategoryId());
      if (osCategory == null) {
         logger.warn("OS type refers to OS category ID %s but this does not exist. OS type=%s Known OS categories=%s", type.getOSCategoryId(), type, osCategories.get());
         return builder.build();
      }
      builder.name(osCategory);
      OsFamily family = OsFamily.fromValue(osCategory.toLowerCase());
      builder.family(family);
      Matcher matcher = DEFAULT_PATTERN.matcher(type.getDescription());
      if (matcher.find()) {
         builder.version(ComputeServiceUtils.parseVersionOrReturnEmptyString(family, matcher.group(1), osVersionMap));
      }
      return builder.build();
   }
View Full Code Here

      });
      assertEquals(Iterables.size(networks), 1);
      Network network = Iterables.getOnlyElement(networks, null);
      assertNotNull(network);
      Set<OSType> osTypes = client.getGuestOSClient().listOSTypes();
      OSType osType = Iterables.getFirst(osTypes, null);

      // Register a template
      RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32).isExtractable(true);
      TemplateMetadata templateMetadata = TemplateMetadata.builder().name(prefix+"-registerTemplate").osTypeId(osType.getId()).displayText("jclouds live testRegisterTemplate").build();
      Set<Template> templates = client.getTemplateClient().registerTemplate(templateMetadata, "VHD", "XenServer", IMPORT_VHD_URL, zone.getId(), options);
      registeredTemplate = Iterables.getOnlyElement(templates, null);
      assertNotNull(registeredTemplate);

      // Ensure it is available
View Full Code Here

   public void testListOSTypes() throws Exception {
      Set<OSType> response = client.getGuestOSClient().listOSTypes();
      assert null != response;
      assertTrue(response.size() >= 0);
      for (OSType type : response) {
         OSType newDetails = getOnlyElement(client.getGuestOSClient().listOSTypes(
               ListOSTypesOptions.Builder.id(type.getId())));
         assertEquals(type.getId(), newDetails.getId());
         checkOSType(type);
      }
   }
View Full Code Here

      });
      assertEquals(Iterables.size(networks), 1);
      Network network = Iterables.getOnlyElement(networks, null);
      assertNotNull(network);
      Set<OSType> osTypes = client.getGuestOSApi().listOSTypes();
      OSType osType = Iterables.getFirst(osTypes, null);

      // Register a template
      RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32).isExtractable(true);
      TemplateMetadata templateMetadata = TemplateMetadata.builder().name(prefix + "-registerTemplate").osTypeId(osType.getId()).displayText("jclouds live testRegisterTemplate").build();
      Set<Template> templates = client.getTemplateApi().registerTemplate(templateMetadata, "VHD", "XenServer", IMPORT_VHD_URL, zone.getId(), options);
      registeredTemplate = Iterables.getOnlyElement(templates, null);
      assertNotNull(registeredTemplate);

      // Ensure it is available
View Full Code Here

   }

   public OperatingSystem apply(Template from) {
      Builder builder = OperatingSystem.builder().description(from.getOSType());

      OSType type = osTypes.get().get(from.getOSTypeId());
      if (type == null) {
         logger.warn("Template refers to OS type ID %s but this does not exist. Template=%s Known OS types=%s", from.getOSTypeId(), from, osTypes.get());
         return builder.build();
      }
      builder.description(type.getDescription());
      builder.is64Bit(type.getDescription().indexOf("64-bit") != -1);
      String osCategory = osCategories.get().get(type.getOSCategoryId());
      if (osCategory == null) {
         logger.warn("OS type refers to OS category ID %s but this does not exist. OS type=%s Known OS categories=%s", type.getOSCategoryId(), type, osCategories.get());
         return builder.build();
      }
      builder.name(osCategory);
      OsFamily family = OsFamily.fromValue(osCategory.toLowerCase());
      builder.family(family);
      Matcher matcher = DEFAULT_PATTERN.matcher(type.getDescription());
      if (matcher.find()) {
         builder.version(ComputeServiceUtils.parseVersionOrReturnEmptyString(family, matcher.group(1), osVersionMap));
      }
      return builder.build();
   }
View Full Code Here

TOP

Related Classes of org.jclouds.cloudstack.domain.OSType

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.