/** * {@inheritDoc} */ @Override public Envelope build() { return new Envelope(diskSections, networkSections, additionalSections, virtualSystem); }
private Envelope getOVFForVAppTemplateAndValidate(VAppTemplate from) throws IllegalArgumentException { Envelope ovf; try { ovf = envelopes.get(from.getHref()); checkArgument(ovf.getVirtualSystem().getVirtualHardwareSections().size() > 0, "no hardware sections exist in ovf %s", ovf); } catch (ExecutionException e) { throw new IllegalArgumentException("no ovf envelope found for: " + from, e); } return ovf; } }
private Envelope getOVFForVAppTemplateAndValidate(VAppTemplate from) throws IllegalArgumentException { Envelope ovf; try { ovf = envelopes.get(from.getHref()); checkArgument(ovf.getVirtualSystem().getVirtualHardwareSections().size() > 0, "no hardware sections exist in ovf %s", ovf); } catch (ExecutionException e) { throw new IllegalArgumentException("no ovf envelope found for: " + from, e); } return ovf; } }
private Envelope getOVFForVAppTemplateAndValidate(VAppTemplate from) throws IllegalArgumentException { Envelope ovf; try { ovf = envelopes.get(from.getHref()); checkArgument(ovf.getVirtualSystem().getVirtualHardwareSections().size() > 0, "no hardware sections exist in ovf %s", ovf); } catch (ExecutionException e) { throw new IllegalArgumentException("no ovf envelope found for: " + from, e); } return ovf; } }
/** * {@inheritDoc} */ public Envelope build() { return new Envelope(diskSections, networkSections, additionalSections, virtualSystem); }
private Envelope getOVFForVAppTemplateAndValidate(VAppTemplate from) throws IllegalArgumentException { Envelope ovf; try { ovf = envelopes.get(from.getHref()); checkArgument(ovf.getVirtualSystem().getVirtualHardwareSections().size() > 0, "no hardware sections exist in ovf %s", ovf); } catch (ExecutionException e) { throw new IllegalArgumentException("no ovf envelope found for: " + from, e); } return ovf; } }
/** * {@inheritDoc} */ public Envelope build() { return new Envelope(diskSections, networkSections, additionalSections, virtualSystem); }
private Envelope getOVFForVAppTemplateAndValidate(VAppTemplate from) throws IllegalArgumentException { Envelope ovf; try { ovf = envelopes.get(from.getHref()); checkArgument(ovf.getVirtualSystem().getVirtualHardwareSections().size() > 0, "no hardware sections exist in ovf %s", ovf); } catch (ExecutionException e) { throw new IllegalArgumentException("no ovf envelope found for: " + from, e); } return ovf; } }
/** * {@inheritDoc} */ @Override public Envelope build() { return new Envelope(diskSections, networkSections, additionalSections, virtualSystem); }
public static CIMOperatingSystem toComputeOs(Envelope ovf) { return toComputeOs(ovf.getVirtualSystem().getOperatingSystemSection()); }
public static CIMOperatingSystem toComputeOs(Envelope ovf) { return toComputeOs(ovf.getVirtualSystem().getOperatingSystemSection()); }
public static CIMOperatingSystem toComputeOs(Envelope ovf) { return toComputeOs(ovf.getVirtualSystem().getOperatingSystemSection()); }
public static CIMOperatingSystem toComputeOs(Envelope ovf) { return toComputeOs(ovf.getVirtualSystem().getOperatingSystemSection()); }
static void checkOvfEnvelope(Envelope result) { VirtualSystemSettingDataHandlerTest.checkVirtualSystem(result.getVirtualSystem()); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testThrowIllegalArgumentAsWeDontYetSupportVirtualSystemCollections() { InputStream is = getClass().getResourceAsStream("/ovf-vcd1.5.xml"); Injector injector = Guice.createInjector(new SaxParserModule()); Factory factory = injector.getInstance(ParseSax.Factory.class); factory.create(injector.getInstance(EnvelopeHandler.class)).parse(is).getVirtualSystem(); }
@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(); }
@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(); }
@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(); }