Example #1
0
 private VmTemplate lookupInstanceTypeByName(Template template) {
   return getEntity(
       VmTemplate.class,
       VdcQueryType.GetInstanceType,
       new GetVmTemplateParameters(template.getName()),
       "GetVmTemplate");
 }
Example #2
0
  @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());
  }
Example #3
0
 private Guid lookupInstanceTypeId(Template template) {
   return template.isSetId()
       ? asGuid(template.getId())
       : lookupInstanceTypeByName(template).getId();
 }