use of org.ovirt.engine.api.model.Link in project ovirt-engine by oVirt.
the class BackendHostNicsResource method addLinks.
@Override
protected HostNic addLinks(HostNic hostNic, String... subCollectionsToExclude) {
if (hostNic.isSetVirtualFunctionsConfiguration()) {
return super.addLinks(hostNic, subCollectionsToExclude);
} else {
final HostNic resultHostNic = super.addLinks(hostNic, ArrayUtils.concat(PF_SUB_COLLECTIONS, subCollectionsToExclude));
final Iterator<Link> linkIterator = resultHostNic.getActions().getLinks().iterator();
while (linkIterator.hasNext()) {
final Link link = linkIterator.next();
if (link.getRel().equals(UPDATE_VFS_CONFIG_ACTION)) {
linkIterator.remove();
}
}
if (isBond(resultHostNic)) {
removeLldpLink(resultHostNic);
}
return resultHostNic;
}
}
use of org.ovirt.engine.api.model.Link in project ovirt-engine by oVirt.
the class BackendHostNicsResource method masterLink.
private Link masterLink(String id) {
Link master = new Link();
master.setRel("master");
master.setHref(idToHref(id));
return master;
}
use of org.ovirt.engine.api.model.Link in project ovirt-engine by oVirt.
the class AbstractBackendBaseTest method verifyLinks.
protected void verifyLinks(BaseResource model) {
assertNotNull(model.getHref());
assertTrue(model.getHref().startsWith("/ovirt-engine/api"));
for (Link link : model.getLinks()) {
assertTrue(link.getHref().startsWith("/ovirt-engine/api"));
}
}
use of org.ovirt.engine.api.model.Link in project ovirt-engine by oVirt.
the class BackendApiResourceTest method verifyApiGlusterOnly.
protected void verifyApiGlusterOnly(Api api) {
assertNotNull(api);
assertNotNull(api.getTime());
assertNotNull(api.getLinks());
assertEquals(relationshipsGlusterOnly.length, api.getLinks().size());
for (int i = 0; i < relationshipsGlusterOnly.length; i++) {
Link l = api.getLinks().get(i);
assertNotNull(l);
assertEquals(relationshipsGlusterOnly[i], l.getRel());
assertEquals(hrefsGlusterOnly[i], l.getHref());
}
assertNotNull(api.getSpecialObjects());
assertContainsRootTag(api.getSpecialObjects());
assertNotNull(api.getProductInfo());
assertNotNull(api.getProductInfo().getVersion());
assertEquals(MAJOR, api.getProductInfo().getVersion().getMajor().intValue());
assertEquals(MINOR, api.getProductInfo().getVersion().getMinor().intValue());
assertEquals(BUILD, api.getProductInfo().getVersion().getBuild().intValue());
assertEquals(REVISION, api.getProductInfo().getVersion().getRevision().intValue());
assertNotNull(api.getSummary());
assertEquals(TOTAL_HOSTS, api.getSummary().getHosts().getTotal().intValue());
assertEquals(ACTIVE_HOSTS, api.getSummary().getHosts().getActive().intValue());
assertEquals(TOTAL_USERS, api.getSummary().getUsers().getTotal().intValue());
assertEquals(ACTIVE_USERS, api.getSummary().getUsers().getActive().intValue());
}
Aggregations