@Override public String apply(OSType input) { return input.getId(); }
@Override public String apply(OSType input) { return input.getId(); }
@Override public String apply(OSType input) { return input.getId(); }
@Override public int compareTo(OSType o) { return id.compareTo(o.getId()); } }
@Override public int compareTo(OSType o) { return id.compareTo(o.getId()); } }
@Override public int compareTo(OSType o) { return id.compareTo(o.getId()); } }
@Override public String apply(OSType arg0) { return arg0.getId(); } });
@Override public String apply(OSType arg0) { return arg0.getId(); } });
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); } }
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); } }
public T fromOSType(OSType in) { return this .id(in.getId()) .OSCategoryId(in.getOSCategoryId()) .description(in.getDescription()); } }
public T fromOSType(OSType in) { return this .id(in.getId()) .OSCategoryId(in.getOSCategoryId()) .description(in.getDescription()); } }
public T fromOSType(OSType in) { return this .id(in.getId()) .OSCategoryId(in.getOSCategoryId()) .description(in.getDescription()); } }
public void testRegisterISO() throws Exception { Optional<OSType> guestOSTypeOptional = Iterables.tryFind(client.getGuestOSClient().listOSTypes(), Predicates.notNull()); Optional<Zone> zoneOptional = Iterables.tryFind(client.getZoneClient().listZones(available(true)), Predicates.notNull()); if(guestOSTypeOptional.isPresent() && zoneOptional.isPresent()) { String osTypeId = guestOSTypeOptional.get().getId(); String zoneId = zoneOptional.get().getId(); ISO iso = client.getISOClient().registerISO(isoName, "", url, zoneId, RegisterISOOptions.Builder.isPublic(true).osTypeId(osTypeId)); assertNotNull(iso); assertNotNull(iso.getId()); assertEquals(iso.getName(), isoName); } else { String skipMessage = String.format("Cannot register the iso with url: %s", url); if(zoneOptional.isPresent()) skipMessage += " without a valid zone"; else skipMessage += " without a valid guest OS type"; throw new SkipException(skipMessage); } }
public void testRegisterISO() throws Exception { Optional<OSType> guestOSTypeOptional = Iterables.tryFind(client.getGuestOSApi().listOSTypes(), Predicates.notNull()); Optional<Zone> zoneOptional = Iterables.tryFind(client.getZoneApi().listZones(available(true)), Predicates.notNull()); if (guestOSTypeOptional.isPresent() && zoneOptional.isPresent()) { String osTypeId = guestOSTypeOptional.get().getId(); String zoneId = zoneOptional.get().getId(); ISO iso = client.getISOApi().registerISO(isoName, "", url, zoneId, RegisterISOOptions.Builder.isPublic(true).osTypeId(osTypeId)); assertNotNull(iso); assertNotNull(iso.getId()); assertEquals(iso.getName(), isoName); } else { String skipMessage = String.format("Cannot register the iso with url: %s", url); if (zoneOptional.isPresent()) skipMessage += " without a valid zone"; else skipMessage += " without a valid guest OS type"; throw new SkipException(skipMessage); } }
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);
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);