本文整理了Java中org.jclouds.compute.domain.Hardware.getHypervisor()
方法的一些代码示例,展示了Hardware.getHypervisor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hardware.getHypervisor()
方法的具体详情如下:
包路径:org.jclouds.compute.domain.Hardware
类名称:Hardware
方法名:getHypervisor
暂无
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public boolean apply(Hardware input) {
boolean returnVal = true;
if (hypervisor != null) {
if (input.getHypervisor() == null)
returnVal = false;
else
returnVal = input.getHypervisor().contains(hypervisor)
|| input.getHypervisor().matches(hypervisor);
}
return returnVal;
}
代码示例来源:origin: org.apache.jclouds/jclouds-compute
@Override
public boolean apply(Hardware input) {
boolean returnVal = true;
if (hypervisor != null) {
if (input.getHypervisor() == null)
returnVal = false;
else
returnVal = input.getHypervisor().contains(hypervisor)
|| input.getHypervisor().matches(hypervisor);
}
return returnVal;
}
代码示例来源:origin: apache/jclouds
@Override
public boolean apply(Hardware input) {
boolean returnVal = true;
if (hypervisor != null) {
if (input.getHypervisor() == null)
returnVal = false;
else
returnVal = input.getHypervisor().contains(hypervisor)
|| input.getHypervisor().matches(hypervisor);
}
return returnVal;
}
代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute
@Override
public boolean apply(Hardware input) {
boolean returnVal = true;
if (hypervisor != null) {
if (input.getHypervisor() == null)
returnVal = false;
else
returnVal = input.getHypervisor().contains(hypervisor)
|| input.getHypervisor().matches(hypervisor);
}
return returnVal;
}
代码示例来源:origin: io.cloudsoft.jclouds.labs.representations/representations-codec
@Override
public Hardware apply(@Nullable org.jclouds.compute.domain.Hardware input) {
if (input == null) {
return null;
}
return Hardware.builder().id(input.getId()).name(input.getName()).hypervisor(input.getHypervisor())
.ram(input.getRam())
//Transformation is lazy and doesn't serialize well, so let's wrap the processor list
.processors(ImmutableList.<Processor>builder().addAll(transform(input.getProcessors(), ToProcessor.INSTANCE)).build())
//Transformation is lazy and doesn't serialize well, so let's wrap the volume list
.volumes(ImmutableList.<Volume>builder().addAll(transform(input.getVolumes(), ToVolume.INSTANCE)).build())
.build();
}
}
代码示例来源:origin: jclouds/legacy-jclouds
/**
* {@inheritDoc}
*/
@Override
public TemplateBuilder fromHardware(Hardware hardware) {
if (currentLocationWiderThan(hardware.getLocation()))
this.location = hardware.getLocation();
this.minCores = getCores(hardware);
this.minRam = hardware.getRam();
this.minDisk = getSpace(hardware);
this.hypervisor = hardware.getHypervisor();
return this;
}
代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute
/**
* {@inheritDoc}
*/
@Override
public TemplateBuilder fromHardware(Hardware hardware) {
if (currentLocationWiderThan(hardware.getLocation()))
this.location = hardware.getLocation();
this.minCores = getCores(hardware);
this.minRam = hardware.getRam();
this.minDisk = getSpace(hardware);
this.hypervisor = hardware.getHypervisor();
return this;
}
代码示例来源:origin: org.apache.jclouds/jclouds-compute
/**
* {@inheritDoc}
*/
@Override
public TemplateBuilder fromHardware(Hardware hardware) {
if (currentLocationWiderThan(hardware.getLocation()))
this.location = hardware.getLocation();
this.minCores = getCores(hardware);
this.minRam = hardware.getRam();
this.minDisk = getSpace(hardware);
this.hypervisor = hardware.getHypervisor();
return this;
}
代码示例来源:origin: apache/jclouds
/**
* {@inheritDoc}
*/
@Override
public TemplateBuilder fromHardware(Hardware hardware) {
if (currentLocationWiderThan(hardware.getLocation()))
this.location = hardware.getLocation();
this.minCores = getCores(hardware);
this.minRam = hardware.getRam();
this.minDisk = getSpace(hardware);
this.hypervisor = hardware.getHypervisor();
return this;
}
代码示例来源:origin: jclouds/legacy-jclouds
builder.datacenter(template.getLocation().getId());
builder.templateName(template.getImage().getId());
builder.platform(template.getHardware().getHypervisor());
builder.memorySizeMB(template.getHardware().getRam());
builder.diskSizeGB(Math.round(template.getHardware().getVolumes().get(0).getSize()));
代码示例来源:origin: jclouds/legacy-jclouds
@Test
public void testDefaultTemplateBuilder() throws IOException {
Template defaultTemplate = view.getComputeService().templateBuilder().build();
assertEquals(defaultTemplate.getImage().getId(), "Ubuntu 12.04 x64");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "12.04");
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
assertEquals(defaultTemplate.getHardware().getRam(), 768);
assertEquals(defaultTemplate.getHardware().getHypervisor(), "Xen");
assertEquals(getSpace(defaultTemplate.getHardware()), 5.0d);
assertEquals(defaultTemplate.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL);
// test that we bound the correct templateoptions in guice
assertEquals(defaultTemplate.getOptions().getClass(), GleSYSTemplateOptions.class);
}
代码示例来源:origin: apache/jclouds
@Test
public void testDefaultTemplateBuilder() throws IOException {
Template defaultTemplate = view.getComputeService().templateBuilder().build();
assertEquals(defaultTemplate.getImage().getId(), "Ubuntu 12.04 x64");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "12.04");
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
assertEquals(defaultTemplate.getHardware().getRam(), 768);
assertEquals(defaultTemplate.getHardware().getHypervisor(), "Xen");
assertEquals(getSpace(defaultTemplate.getHardware()), 5.0d);
assertEquals(defaultTemplate.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL);
// test that we bound the correct templateoptions in guice
assertEquals(defaultTemplate.getOptions().getClass(), GleSYSTemplateOptions.class);
}
代码示例来源:origin: apache/jclouds
builder.datacenter(template.getLocation().getId());
builder.templateName(template.getImage().getId());
builder.platform(template.getHardware().getHypervisor());
builder.memorySizeMB(template.getHardware().getRam());
builder.diskSizeGB(Math.round(template.getHardware().getVolumes().get(0).getSize()));
代码示例来源:origin: jclouds/legacy-jclouds
@SuppressWarnings("unchecked")
public static HardwareBuilder fromHardware(Hardware in) {
return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
.supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
}
}
代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute
@SuppressWarnings("unchecked")
public static HardwareBuilder fromHardware(Hardware in) {
return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
.supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
}
}
代码示例来源:origin: org.apache.jclouds/jclouds-compute
@SuppressWarnings("unchecked")
public static HardwareBuilder fromHardware(Hardware in) {
return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
.supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
}
}
代码示例来源:origin: apache/jclouds
@SuppressWarnings("unchecked")
public static HardwareBuilder fromHardware(Hardware in) {
return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
.supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
}
}
代码示例来源:origin: jclouds/jclouds-labs
private void applyAndAssert(Server server) {
final Hardware hardware = serverToHardware.apply(server);
assertEquals(server.memoryGb() * 1024, hardware.getRam());
assertEquals("vmx", hardware.getHypervisor());
assertEquals(server.id(), hardware.getId());
assertEquals(server.id(), hardware.getProviderId());
assertEquals(server.name(), hardware.getName());
assertEquals(server.disks().size(), hardware.getVolumes().size());
assertEquals(Float.valueOf(server.disks().get(0).sizeGb()), hardware.getVolumes().get(0).getSize());
assertEquals(Volume.Type.LOCAL, hardware.getVolumes().get(0).getType());
assertEquals(server.disks().get(0).id(), hardware.getVolumes().get(0).getId());
assertEquals(server.disks().get(0).scsiId().toString(), hardware.getVolumes().get(0).getDevice());
assertEquals(server.cpu().count(), hardware.getProcessors().size());
assertEquals(Double.valueOf(server.cpu().coresPerSocket()), hardware.getProcessors().get(0).getCores());
assertEquals(CpuSpeed.STANDARD.getSpeed(), hardware.getProcessors().get(0).getSpeed());
}
代码示例来源:origin: jclouds/jclouds-labs
private void applyAndAssert(BaseImage baseImage) {
final Hardware hardware = baseImageToHardware.apply(baseImage);
assertEquals(baseImage.memoryGb() * 1024, hardware.getRam());
assertEquals("vmx", hardware.getHypervisor());
assertEquals(baseImage.id(), hardware.getId());
assertEquals(baseImage.id(), hardware.getProviderId());
assertEquals(baseImage.name(), hardware.getName());
assertEquals(baseImage.disks().size(), hardware.getVolumes().size());
assertEquals(Float.valueOf(baseImage.disks().get(0).sizeGb()), hardware.getVolumes().get(0).getSize());
assertEquals(Volume.Type.LOCAL, hardware.getVolumes().get(0).getType());
assertEquals(baseImage.disks().get(0).id(), hardware.getVolumes().get(0).getId());
assertEquals(baseImage.disks().get(0).scsiId().toString(), hardware.getVolumes().get(0).getDevice());
assertEquals(baseImage.cpu().count(), hardware.getProcessors().size());
assertEquals(Double.valueOf(baseImage.cpu().coresPerSocket()), hardware.getProcessors().get(0).getCores());
assertEquals(CpuSpeed.STANDARD.getSpeed(), hardware.getProcessors().get(0).getSpeed());
}
代码示例来源:origin: jclouds/legacy-jclouds
assertEquals(template.getHardware().getHypervisor(), "OpenVZ");
assertEquals(template.getImage().getId(), "Ubuntu 11.04 64-bit");
内容来源于网络,如有侵权,请联系作者删除!