use of org.ovirt.engine.api.model.Actionable in project ovirt-engine by oVirt.
the class V3StorageDomainVmServer method doImport.
@POST
@Consumes({ "application/xml", "application/json" })
@Actionable
@Path("import")
public Response doImport(V3Action action) {
// to be collapsed during import, but in V4 this has been replaced by a "collapse_snapshots" boolean parameter:
if (action.isSetVm() && action.getVm().isSetSnapshots()) {
V3Snapshots snapshots = action.getVm().getSnapshots();
if (snapshots.isSetCollapseSnapshots() && snapshots.isCollapseSnapshots()) {
Map<String, String> parameters = CurrentManager.get().getParameters();
parameters.put("collapse_snapshots", String.valueOf(true));
}
}
return adaptAction(getDelegate()::doImport, action);
}
use of org.ovirt.engine.api.model.Actionable in project ovirt-engine by oVirt.
the class ActionsBuilder method build.
public Actions build() {
Actions actions = null;
for (Method method : ArrayUtils.concat(service.getMethods(), getInterfaceSignatures(collection))) {
Path path = method.getAnnotation(Path.class);
Actionable actionable = method.getAnnotation(Actionable.class);
if (actionable != null && path != null) {
Link link = new Link();
link.setRel(path.value());
link.setHref(base + URL_SEPARATOR + link.getRel());
if (actions == null) {
actions = new Actions();
}
actions.getLinks().add(link);
}
}
return actions;
}
Aggregations