use of org.ovirt.engine.api.v3.types.V3Action in project ovirt-engine by oVirt.
the class V3ActionOutAdapter method adapt.
@Override
public V3Action adapt(Action from) {
V3Action to = new V3Action();
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetLinks()) {
to.getLinks().addAll(adaptOut(from.getLinks()));
}
if (from.isSetAsync()) {
to.setAsync(from.isAsync());
}
if (from.isSetBricks()) {
to.setBricks(adaptOut(from.getBricks()));
}
if (from.isSetCertificates()) {
to.setCertificates(adaptOut(from.getCertificates()));
}
if (from.isSetCheckConnectivity()) {
to.setCheckConnectivity(from.isCheckConnectivity());
}
if (from.isSetClone()) {
to.setClone(from.isClone());
}
if (from.isSetCluster()) {
to.setCluster(adaptOut(from.getCluster()));
}
if (from.isSetConnectivityTimeout()) {
to.setConnectivityTimeout(from.getConnectivityTimeout());
}
if (from.isSetDiscardSnapshots()) {
to.setDiscardSnapshots(from.isDiscardSnapshots());
}
if (from.isSetDisk()) {
to.setDisk(adaptOut(from.getDisk()));
}
if (from.isSetDisks()) {
to.setDisks(adaptOut(from.getDisks()));
}
if (from.isSetExclusive()) {
to.setExclusive(from.isExclusive());
}
if (from.isSetFault()) {
to.setFault(adaptOut(from.getFault()));
}
if (from.isSetFenceType()) {
to.setFenceType(from.getFenceType());
}
if (from.isSetFixLayout()) {
to.setFixLayout(from.isFixLayout());
}
if (from.isSetForce()) {
to.setForce(from.isForce());
}
if (from.isSetGracePeriod()) {
to.setGracePeriod(adaptOut(from.getGracePeriod()));
}
if (from.isSetHost()) {
to.setHost(adaptOut(from.getHost()));
}
if (from.isSetImage()) {
to.setImage(from.getImage());
}
if (from.isSetImportAsTemplate()) {
to.setImportAsTemplate(from.isImportAsTemplate());
}
if (from.isSetIsAttached()) {
to.setIsAttached(from.isIsAttached());
}
if (from.isSetIscsi()) {
to.setIscsi(adaptOut(from.getIscsi()));
}
if (from.isSetIscsiTargets()) {
to.getIscsiTargets().addAll(from.getIscsiTargets().getIscsiTargets());
}
if (from.isSetJob()) {
to.setJob(adaptOut(from.getJob()));
}
if (from.isSetLogicalUnits()) {
to.setLogicalUnits(adaptOut(from.getLogicalUnits()));
}
if (from.isSetMaintenanceEnabled()) {
to.setMaintenanceEnabled(from.isMaintenanceEnabled());
}
if (from.isSetModifiedBonds()) {
to.setModifiedBonds(adaptOut(from.getModifiedBonds()));
}
if (from.isSetModifiedLabels()) {
to.setModifiedLabels(adaptOut(from.getModifiedLabels()));
}
if (from.isSetModifiedNetworkAttachments()) {
to.setModifiedNetworkAttachments(adaptOut(from.getModifiedNetworkAttachments()));
}
if (from.isSetOption()) {
to.setOption(adaptOut(from.getOption()));
}
if (from.isSetPause()) {
to.setPause(from.isPause());
}
if (from.isSetPowerManagement()) {
to.setPowerManagement(adaptOut(from.getPowerManagement()));
}
if (from.isSetProxyTicket()) {
to.setProxyTicket(adaptOut(from.getProxyTicket()));
}
if (from.isSetReason()) {
to.setReason(from.getReason());
}
if (from.isSetRemovedBonds()) {
to.setRemovedBonds(adaptOut(from.getRemovedBonds()));
}
if (from.isSetRemovedLabels()) {
to.setRemovedLabels(adaptOut(from.getRemovedLabels()));
}
if (from.isSetRemovedNetworkAttachments()) {
to.setRemovedNetworkAttachments(adaptOut(from.getRemovedNetworkAttachments()));
}
if (from.isSetResolutionType()) {
to.setResolutionType(from.getResolutionType());
}
if (from.isSetRestoreMemory()) {
to.setRestoreMemory(from.isRestoreMemory());
}
if (from.isSetRootPassword()) {
to.setRootPassword(from.getRootPassword());
}
if (from.isSetSnapshot()) {
to.setSnapshot(adaptOut(from.getSnapshot()));
}
if (from.isSetSsh()) {
to.setSsh(adaptOut(from.getSsh()));
}
if (from.isSetStatus()) {
V3Status status = new V3Status();
status.setState(from.getStatus());
to.setStatus(status);
}
if (from.isSetStorageDomain()) {
to.setStorageDomain(adaptOut(from.getStorageDomain()));
}
if (from.isSetStorageDomains()) {
to.setStorageDomains(adaptOut(from.getStorageDomains()));
}
if (from.isSetSucceeded()) {
to.setSucceeded(from.isSucceeded());
}
if (from.isSetSynchronizedNetworkAttachments()) {
to.setSynchronizedNetworkAttachments(adaptOut(from.getSynchronizedNetworkAttachments()));
}
if (from.isSetTemplate()) {
to.setTemplate(adaptOut(from.getTemplate()));
}
if (from.isSetTicket()) {
to.setTicket(adaptOut(from.getTicket()));
}
if (from.isSetUseCloudInit()) {
to.setUseCloudInit(from.isUseCloudInit());
}
if (from.isSetUseSysprep()) {
to.setUseSysprep(from.isUseSysprep());
}
if (from.isSetVirtualFunctionsConfiguration()) {
to.setVirtualFunctionsConfiguration(adaptOut(from.getVirtualFunctionsConfiguration()));
}
if (from.isSetVm()) {
to.setVm(adaptOut(from.getVm()));
}
return to;
}
use of org.ovirt.engine.api.v3.types.V3Action 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.v3.types.V3Action in project ovirt-engine by oVirt.
the class V3ActionInAdapter method adapt.
@Override
public Action adapt(V3Action from) {
Action to = new Action();
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetAsync()) {
to.setAsync(from.isAsync());
}
if (from.isSetBricks()) {
to.setBricks(adaptIn(from.getBricks()));
}
if (from.isSetCertificates()) {
to.setCertificates(adaptIn(from.getCertificates()));
}
if (from.isSetCheckConnectivity()) {
to.setCheckConnectivity(from.isCheckConnectivity());
}
if (from.isSetClone()) {
to.setClone(from.isClone());
}
if (from.isSetCluster()) {
to.setCluster(adaptIn(from.getCluster()));
}
if (from.isSetConnectivityTimeout()) {
to.setConnectivityTimeout(from.getConnectivityTimeout());
}
if (from.isSetDiscardSnapshots()) {
to.setDiscardSnapshots(from.isDiscardSnapshots());
}
if (from.isSetDisk()) {
to.setDisk(adaptIn(from.getDisk()));
}
if (from.isSetDisks()) {
to.setDisks(adaptIn(from.getDisks()));
}
if (from.isSetExclusive()) {
to.setExclusive(from.isExclusive());
}
if (from.isSetFault()) {
to.setFault(adaptIn(from.getFault()));
}
if (from.isSetFenceType()) {
to.setFenceType(from.getFenceType());
}
if (from.isSetFixLayout()) {
to.setFixLayout(from.isFixLayout());
}
if (from.isSetForce()) {
to.setForce(from.isForce());
}
if (from.isSetGracePeriod()) {
to.setGracePeriod(adaptIn(from.getGracePeriod()));
}
if (from.isSetHost()) {
to.setHost(adaptIn(from.getHost()));
}
if (from.isSetImage()) {
to.setImage(from.getImage());
}
if (from.isSetImportAsTemplate()) {
to.setImportAsTemplate(from.isImportAsTemplate());
}
if (from.isSetIsAttached()) {
to.setIsAttached(from.isIsAttached());
}
if (from.isSetIscsi()) {
to.setIscsi(adaptIn(from.getIscsi()));
}
if (from.isSetIscsiTargets()) {
to.setIscsiTargets(new Action.IscsiTargetsList());
to.getIscsiTargets().getIscsiTargets().addAll(from.getIscsiTargets());
}
if (from.isSetJob()) {
to.setJob(adaptIn(from.getJob()));
}
if (from.isSetLogicalUnits()) {
to.setLogicalUnits(adaptIn(from.getLogicalUnits()));
}
if (from.isSetMaintenanceEnabled()) {
to.setMaintenanceEnabled(from.isMaintenanceEnabled());
}
if (from.isSetModifiedBonds()) {
to.setModifiedBonds(adaptIn(from.getModifiedBonds()));
}
if (from.isSetModifiedLabels()) {
to.setModifiedLabels(adaptIn(from.getModifiedLabels()));
}
if (from.isSetModifiedNetworkAttachments()) {
to.setModifiedNetworkAttachments(adaptIn(from.getModifiedNetworkAttachments()));
}
if (from.isSetOption()) {
to.setOption(adaptIn(from.getOption()));
}
if (from.isSetPause()) {
to.setPause(from.isPause());
}
if (from.isSetPowerManagement()) {
to.setPowerManagement(adaptIn(from.getPowerManagement()));
}
if (from.isSetProxyTicket()) {
to.setProxyTicket(adaptIn(from.getProxyTicket()));
}
if (from.isSetReason()) {
to.setReason(from.getReason());
}
if (from.isSetRemovedBonds()) {
to.setRemovedBonds(adaptIn(from.getRemovedBonds()));
}
if (from.isSetRemovedLabels()) {
to.setRemovedLabels(adaptIn(from.getRemovedLabels()));
}
if (from.isSetRemovedNetworkAttachments()) {
to.setRemovedNetworkAttachments(adaptIn(from.getRemovedNetworkAttachments()));
}
if (from.isSetResolutionType()) {
to.setResolutionType(from.getResolutionType());
}
if (from.isSetRestoreMemory()) {
to.setRestoreMemory(from.isRestoreMemory());
}
if (from.isSetRootPassword()) {
to.setRootPassword(from.getRootPassword());
}
if (from.isSetSnapshot()) {
to.setSnapshot(adaptIn(from.getSnapshot()));
}
if (from.isSetSsh()) {
to.setSsh(adaptIn(from.getSsh()));
}
if (from.isSetStatus() && from.getStatus().isSetState()) {
to.setStatus(from.getStatus().getState());
}
if (from.isSetStorageDomain()) {
to.setStorageDomain(adaptIn(from.getStorageDomain()));
}
if (from.isSetStorageDomains()) {
to.setStorageDomains(adaptIn(from.getStorageDomains()));
}
if (from.isSetSucceeded()) {
to.setSucceeded(from.isSucceeded());
}
if (from.isSetSynchronizedNetworkAttachments()) {
to.setSynchronizedNetworkAttachments(adaptIn(from.getSynchronizedNetworkAttachments()));
}
if (from.isSetTemplate()) {
to.setTemplate(adaptIn(from.getTemplate()));
}
if (from.isSetTicket()) {
to.setTicket(adaptIn(from.getTicket()));
}
if (from.isSetUseCloudInit()) {
to.setUseCloudInit(from.isUseCloudInit());
}
if (from.isSetUseSysprep()) {
to.setUseSysprep(from.isUseSysprep());
}
if (from.isSetVirtualFunctionsConfiguration()) {
to.setVirtualFunctionsConfiguration(adaptIn(from.getVirtualFunctionsConfiguration()));
}
if (from.isSetVm()) {
to.setVm(adaptIn(from.getVm()));
}
return to;
}
Aggregations