private VmTemplate lookupInstanceTypeByName(Template template) { return getEntity( VmTemplate.class, VdcQueryType.GetInstanceType, new GetVmTemplateParameters(template.getName()), "GetVmTemplate"); }
@Test public void testStorageDomainTemplateLinks() throws Exception { Template template = new Template(); template.setId(TEMPLATE_ID); template.setStorageDomain(new StorageDomain()); template.getStorageDomain().setId(STORAGE_DOMAIN_ID); template = LinkHelper.addLinks(template); assertEquals(STORAGE_DOMAIN_TEMPLATE_HREF, template.getHref()); assertEquals(STORAGE_DOMAIN_HREF, template.getStorageDomain().getHref()); }
private Guid lookupInstanceTypeId(Template template) { return template.isSetId() ? asGuid(template.getId()) : lookupInstanceTypeByName(template).getId(); }