private void checkServiceOffering(ServiceOffering offering) { assertNotNull(offering.getId()); assertEquals(offering.getCpuNumber(), 2); assertEquals(offering.getCpuSpeed(), 1024); assertEquals(offering.getMemory(), 2048); assertTrue(offering.supportsHA()); assertEquals(offering.getStorageType(), StorageType.LOCAL); }
private void checkServiceOffering(ServiceOffering offering) { assertNotNull(offering.getId()); assertEquals(offering.getCpuNumber(), 2); assertEquals(offering.getCpuSpeed(), 1024); assertEquals(offering.getMemory(), 2048); assertTrue(offering.supportsHA()); assertEquals(offering.getStorageType(), StorageType.LOCAL); }
@Override public Hardware apply(ServiceOffering offering) { return new HardwareBuilder() .ids(offering.getId() + "") .name(offering.getName()) .tags(offering.getTags()) .processors(ImmutableList.of(new Processor(offering.getCpuNumber(), offering.getCpuSpeed()))) .ram(offering.getMemory())// // TODO: hypervisor probably from zone? // TODO .volumes() // displayText // created // haSupport // storageType // TODO where's the location of this? .build(); }
@Override public Hardware apply(ServiceOffering offering) { return new HardwareBuilder() .ids(offering.getId() + "") .name(offering.getName()) .tags(offering.getTags()) .processors(ImmutableList.of(new Processor(offering.getCpuNumber(), offering.getCpuSpeed()))) .ram(offering.getMemory())// // TODO: hypervisor probably from zone? // TODO .volumes() // displayText // created // haSupport // storageType // TODO where's the location of this? .build(); }
@Override public Hardware apply(ServiceOffering offering) { return new HardwareBuilder() .ids(offering.getId() + "") .name(offering.getName()) .tags(offering.getTags()) .processors(ImmutableList.of(new Processor(offering.getCpuNumber(), offering.getCpuSpeed()))) .ram(offering.getMemory())// // TODO: hypervisor probably from zone? // TODO .volumes() // displayText // created // haSupport // storageType // TODO where's the location of this? .build(); }
public void testListServiceOfferings() throws Exception { Set<ServiceOffering> response = client.getOfferingClient().listServiceOfferings(); assert null != response; long offeringCount = response.size(); assertTrue(offeringCount >= 0); for (ServiceOffering offering : response) { ServiceOffering newDetails = Iterables.getOnlyElement(client.getOfferingClient().listServiceOfferings( ListServiceOfferingsOptions.Builder.id(offering.getId()))); assertEquals(offering, newDetails); assert offering.getId() != null : offering; assert offering.getName() != null : offering; assert offering.getDisplayText() != null : offering; assert offering.getCpuNumber() > 0 : offering; assert offering.getCpuSpeed() > 0 : offering; assert offering.getMemory() > 0 : offering; assert offering.getStorageType() != null && StorageType.UNRECOGNIZED != offering.getStorageType() : offering; assert offering.getTags() != null : offering; } }
public void testListServiceOfferings() throws Exception { Set<ServiceOffering> response = client.getOfferingApi().listServiceOfferings(); assert null != response; long offeringCount = response.size(); assertTrue(offeringCount >= 0); for (ServiceOffering offering : response) { ServiceOffering newDetails = Iterables.getOnlyElement(client.getOfferingApi().listServiceOfferings( ListServiceOfferingsOptions.Builder.id(offering.getId()))); assertEquals(offering, newDetails); assert offering.getId() != null : offering; assert offering.getName() != null : offering; assert offering.getDisplayText() != null : offering; assert offering.getCpuNumber() > 0 : offering; assert offering.getCpuSpeed() > 0 : offering; assert offering.getMemory() > 0 : offering; assert offering.getStorageType() != null && StorageType.UNRECOGNIZED != offering.getStorageType() : offering; assert offering.getTags() != null : offering; } }
public T fromServiceOffering(ServiceOffering in) { return this .id(in.getId()) .name(in.getName()) .displayText(in.getDisplayText()) .created(in.getCreated()) .domain(in.getDomain()) .domainId(in.getDomainId()) .cpuNumber(in.getCpuNumber()) .cpuSpeed(in.getCpuSpeed()) .memory(in.getMemory()) .supportsHA(in.supportsHA()) .storageType(in.getStorageType()) .tags(in.getTags()) .defaultUse(in.isDefaultUse()) .systemOffering(in.isSystemOffering()) .cpuUseLimited(in.isCpuUseLimited()) .networkRate(in.getNetworkRate()) .systemVmType(in.isSystemVmType()); } }
public T fromServiceOffering(ServiceOffering in) { return this .id(in.getId()) .name(in.getName()) .displayText(in.getDisplayText()) .created(in.getCreated()) .domain(in.getDomain()) .domainId(in.getDomainId()) .cpuNumber(in.getCpuNumber()) .cpuSpeed(in.getCpuSpeed()) .memory(in.getMemory()) .supportsHA(in.supportsHA()) .storageType(in.getStorageType()) .tags(in.getTags()) .defaultUse(in.isDefaultUse()) .systemOffering(in.isSystemOffering()) .cpuUseLimited(in.isCpuUseLimited()) .networkRate(in.getNetworkRate()) .systemVmType(in.isSystemVmType()); } }
public T fromServiceOffering(ServiceOffering in) { return this .id(in.getId()) .name(in.getName()) .displayText(in.getDisplayText()) .created(in.getCreated()) .domain(in.getDomain()) .domainId(in.getDomainId()) .cpuNumber(in.getCpuNumber()) .cpuSpeed(in.getCpuSpeed()) .memory(in.getMemory()) .supportsHA(in.supportsHA()) .storageType(in.getStorageType()) .tags(in.getTags()) .defaultUse(in.isDefaultUse()) .systemOffering(in.isSystemOffering()) .cpuUseLimited(in.isCpuUseLimited()) .networkRate(in.getNetworkRate()) .systemVmType(in.isSystemVmType()); } }