@Override public Hardware apply(VApp from) { checkNotNull(from, "VApp"); // TODO make this work with composite vApps Vm vm = from.getChildren().size() == 0 ? null : Iterables.get(from.getChildren(), 0); if (vm == null) return null; VirtualHardwareSection hardware = vm.getVirtualHardwareSection(); HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems()); builder.location(findLocationForResource.apply(checkNotNull(from, "from").getVDC())); builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage( ImagePredicates.idEquals(from.getHref().toASCIIString())); builder.hypervisor("VMware"); return builder.build(); } }
@Override public Hardware apply(VApp from) { checkNotNull(from, "VApp"); // TODO make this work with composite vApps Vm vm = from.getChildren().size() == 0 ? null : Iterables.get(from.getChildren(), 0); if (vm == null) return null; VirtualHardwareSection hardware = vm.getVirtualHardwareSection(); HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems()); builder.location(findLocationForResource.apply(checkNotNull(from, "from").getVDC())); builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage( ImagePredicates.idEquals(from.getHref().toASCIIString())); builder.hypervisor("VMware"); return builder.build(); } }
@Override public Hardware apply(VApp from) { checkNotNull(from, "VApp"); // TODO make this work with composite vApps Vm vm = from.getChildren().size() == 0 ? null : Iterables.get(from.getChildren(), 0); if (vm == null) return null; VirtualHardwareSection hardware = vm.getVirtualHardwareSection(); HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems()); builder.location(findLocationForResource.apply(checkNotNull(from, "from").getVDC())); builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage( ImagePredicates.idEquals(from.getHref().toASCIIString())); builder.hypervisor("VMware"); return builder.build(); } }
@Override public Hardware apply(VAppTemplate from) { checkNotNull(from, "VAppTemplate"); Envelope ovf = templateToEnvelope.apply(from); if (ovf.getVirtualSystem().getVirtualHardwareSections().size() > 1) { logger.warn("multiple hardware choices found. using first", ovf); } VirtualHardwareSection hardware = Iterables.get(ovf.getVirtualSystem().getVirtualHardwareSections(), 0); HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems()); if (from.getVDC() != null) { builder.location(findLocationForResource.apply(from.getVDC())); } else { // otherwise, it could be in a public catalog, which is not assigned to a VDC } builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage( ImagePredicates.idEquals(from.getHref().toASCIIString())); builder.hypervisor("VMware"); return builder.build(); }
public VCloudVirtualHardwareSection getResult() { VirtualHardwareSection hardware = hardwareHandler.getResult(); return new VCloudVirtualHardwareSection(this.hardware.getType(), this.hardware.getHref(), hardware.getInfo(), hardware .getTransports(), hardware.getSystem(), hardware.getItems()); }
@Override public Hardware apply(VAppTemplate from) { checkNotNull(from, "VAppTemplate"); Envelope ovf = templateToEnvelope.apply(from); if (ovf.getVirtualSystem().getVirtualHardwareSections().size() > 1) { logger.warn("multiple hardware choices found. using first", ovf); } VirtualHardwareSection hardware = Iterables.get(ovf.getVirtualSystem().getVirtualHardwareSections(), 0); HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems()); if (from.getVDC() != null) { builder.location(findLocationForResource.apply(from.getVDC())); } else { // otherwise, it could be in a public catalog, which is not assigned to a VDC } builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage( ImagePredicates.idEquals(from.getHref().toASCIIString())); builder.hypervisor("VMware"); return builder.build(); }
public VCloudVirtualHardwareSection getResult() { VirtualHardwareSection hardware = hardwareHandler.getResult(); return new VCloudVirtualHardwareSection(this.hardware.getType(), this.hardware.getHref(), hardware.getInfo(), hardware .getTransports(), hardware.getSystem(), hardware.getItems()); }
public VCloudVirtualHardwareSection getResult() { VirtualHardwareSection hardware = hardwareHandler.getResult(); return new VCloudVirtualHardwareSection(this.hardware.getType(), this.hardware.getHref(), hardware.getInfo(), hardware .getTransports(), hardware.getSystem(), hardware.getItems()); }
@Override public Hardware apply(VAppTemplate from) { checkNotNull(from, "VAppTemplate"); Envelope ovf = templateToEnvelope.apply(from); if (ovf.getVirtualSystem().getVirtualHardwareSections().size() > 1) { logger.warn("multiple hardware choices found. using first", ovf); } VirtualHardwareSection hardware = Iterables.get(ovf.getVirtualSystem().getVirtualHardwareSections(), 0); HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems()); if (from.getVDC() != null) { builder.location(findLocationForResource.apply(from.getVDC())); } else { // otherwise, it could be in a public catalog, which is not assigned to a VDC } builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage( ImagePredicates.idEquals(from.getHref().toASCIIString())); builder.hypervisor("VMware"); return builder.build(); }
public Builder fromVirtualHardwareSection(VirtualHardwareSection in) { return fromSection(in).items(in.getItems()).transports(in.getTransports()).system( in.getSystem()).info(in.getInfo()); }
public Builder fromVirtualHardwareSection(VirtualHardwareSection in) { return fromSection(in).items(in.getItems()).transports(in.getTransports()).system( in.getSystem()).info(in.getInfo()); }
public Builder fromVirtualHardwareSection(VirtualHardwareSection in) { return fromSection(in).items(in.getItems()).transports(in.getTransports()).system( in.getSystem()).info(in.getInfo()); }
public Builder fromVirtualHardwareSection(VirtualHardwareSection in) { return fromSection(in).items(in.getItems()).transports(in.getTransports()).system( in.getSystem()).info(in.getInfo()); }
assertEquals(Iterables.get(result.getItems(), 0).toString(), ResourceAllocationSettingData .builder().instanceID("1").elementName("Network adapter 0").description("PCNet32 ethernet adapter") .resourceType(ResourceType.ETHERNET_ADAPTER).resourceSubType("PCNet32").address("00:50:56:8c:00:13") .automaticAllocation(true).connection("vAppNet-vApp Internal").addressOnParent("0").build().toString()); assertEquals(Iterables.get(result.getItems(), 1).toString(), ResourceAllocationSettingData .builder().instanceID("2").elementName("SCSI Controller 0").description("SCSI Controller").resourceType( ResourceType.PARALLEL_SCSI_HBA).resourceSubType("lsilogic").address("0").build().toString()); assertEquals(Iterables.get(result.getItems(), 2).toString(), ResourceAllocationSettingData .builder().instanceID("2000").elementName("Hard disk 1").description("Hard disk").resourceType( ResourceType.DISK_DRIVE).addressOnParent("0").parent("2").build().toString()); assertEquals(Iterables.get(result.getItems(), 3).toString(), ResourceAllocationSettingData .builder().instanceID("3").elementName("IDE Controller 0").description("IDE Controller").resourceType( ResourceType.IDE_CONTROLLER).address("0").build().toString()); assertEquals(Iterables.get(result.getItems(), 4).toString(), ResourceAllocationSettingData .builder().instanceID("3002").elementName("CD/DVD Drive 1").description("CD/DVD Drive").resourceType( ResourceType.CD_DRIVE).addressOnParent("0").parent("3").automaticAllocation(false).build() .toString()); assertEquals(Iterables.get(result.getItems(), 5).toString(), ResourceAllocationSettingData .builder().instanceID("8000").elementName("Floppy Drive 1").description("Floppy Drive").resourceType( ResourceType.FLOPPY_DRIVE).addressOnParent("0").automaticAllocation(false).build().toString()); assertEquals(Iterables.get(result.getItems(), 6).toString(), ResourceAllocationSettingData .builder().instanceID("4").elementName("1 virtual CPU(s)").description("Number of Virtual CPUs") .resourceType(ResourceType.PROCESSOR).virtualQuantity(1l).allocationUnits("hertz * 10^6")