use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendTemplateDiskResourceTest method setUpCopyParams.
private Action setUpCopyParams(boolean byName) {
Action action = new Action();
StorageDomain sd = new StorageDomain();
if (byName) {
sd.setName(NAMES[2]);
} else {
sd.setId(GUIDS[3].toString());
}
action.setStorageDomain(sd);
return action;
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendAttachedStorageDomainResource method remove.
@Override
public Response remove() {
StorageDomain storageDomain = get();
if (storageDomain.getStorage().getType().equals(StorageType.LOCALFS)) {
RemoveStorageDomainParameters params = new RemoveStorageDomainParameters(guid);
params.setDoFormat(true);
return performAction(ActionType.RemoveStorageDomain, params);
} else {
DetachStorageDomainFromPoolParameters params = new DetachStorageDomainFromPoolParameters(guid, dataCenterId);
return performAction(ActionType.DetachStorageDomainFromPool, params);
}
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendFilesResource method addParents.
@Override
protected File addParents(File file) {
file.setStorageDomain(new StorageDomain());
file.getStorageDomain().setId(storageDomainId);
return file;
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class V3StorageDomainInAdapter method adapt.
@Override
public StorageDomain adapt(V3StorageDomain from) {
StorageDomain to = new StorageDomain();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetAvailable()) {
to.setAvailable(from.getAvailable());
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetCommitted()) {
to.setCommitted(from.getCommitted());
}
if (from.isSetCriticalSpaceActionBlocker()) {
to.setCriticalSpaceActionBlocker(from.getCriticalSpaceActionBlocker());
}
if (from.isSetDataCenter()) {
to.setDataCenter(adaptIn(from.getDataCenter()));
}
if (from.isSetDataCenters()) {
to.setDataCenters(new DataCenters());
to.getDataCenters().getDataCenters().addAll(adaptIn(from.getDataCenters().getDataCenters()));
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetExternalStatus() && from.getExternalStatus().isSetState()) {
to.setExternalStatus(ExternalStatus.fromValue(from.getExternalStatus().getState()));
}
if (from.isSetHost()) {
to.setHost(adaptIn(from.getHost()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetImport()) {
to.setImport(from.isImport());
}
if (from.isSetMaster()) {
to.setMaster(from.isMaster());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetStatus() && from.getStatus().isSetState()) {
to.setStatus(StorageDomainStatus.fromValue(from.getStatus().getState()));
}
if (from.isSetStorage()) {
to.setStorage(adaptIn(from.getStorage()));
}
if (from.isSetStorageFormat()) {
to.setStorageFormat(StorageFormat.fromValue(from.getStorageFormat()));
}
if (from.isSetType()) {
to.setType(StorageDomainType.fromValue(from.getType()));
}
if (from.isSetUsed()) {
to.setUsed(from.getUsed());
}
if (from.isSetWarningLowSpaceIndicator()) {
to.setWarningLowSpaceIndicator(from.getWarningLowSpaceIndicator());
}
if (from.isSetWipeAfterDelete()) {
to.setWipeAfterDelete(from.isWipeAfterDelete());
}
return to;
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainDiskResource method addParents.
@Override
protected Disk addParents(Disk disk) {
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(storageDomainId.toString());
StorageDomains storageDomains = new StorageDomains();
storageDomains.getStorageDomains().add(storageDomain);
disk.setStorageDomain(storageDomain);
disk.setStorageDomains(storageDomains);
return disk;
}
Aggregations