use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class BackendIscsiBondNetworksResource method add.
@Override
public Response add(Network network) {
org.ovirt.engine.core.common.businessentities.network.Network entity = NetworkMapper.map(network, null);
IscsiBond iscsiBond = getIscsiBond();
iscsiBond.getNetworkIds().add(entity.getId());
return performAction(ActionType.EditIscsiBond, new EditIscsiBondParameters(iscsiBond));
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class BackendIscsiBondStorageConnectionResource method remove.
@Override
public Response remove() {
get();
IscsiBond iscsiBond = parent.getIscsiBond();
iscsiBond.getStorageConnectionIds().remove(id);
return performAction(ActionType.EditIscsiBond, new EditIscsiBondParameters(iscsiBond));
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class BackendIscsiBondStorageConnectionsResource method add.
@Override
public Response add(StorageConnection conn) {
StorageServerConnections entity = StorageDomainMapper.map(conn, null);
IscsiBond iscsiBond = getIscsiBond();
iscsiBond.getStorageConnectionIds().add(entity.getId());
return performAction(ActionType.EditIscsiBond, new EditIscsiBondParameters(iscsiBond));
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class RemoveIscsiBondCommand method getStoragePoolId.
@Override
public Guid getStoragePoolId() {
Guid storagePoolId = super.getStoragePoolId();
if (storagePoolId == null) {
IscsiBond iscsiBond = getIscsiBond();
if (iscsiBond != null) {
storagePoolId = iscsiBond.getStoragePoolId();
setStoragePoolId(storagePoolId);
}
}
return storagePoolId;
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class AddIscsiBondCommand method executeCommand.
@Override
protected void executeCommand() {
final IscsiBond iscsiBond = getIscsiBond();
iscsiBond.setId(Guid.newGuid());
TransactionSupport.executeInNewTransaction(() -> {
iscsiBondDao.save(iscsiBond);
for (Guid networkId : iscsiBond.getNetworkIds()) {
iscsiBondDao.addNetworkToIscsiBond(iscsiBond.getId(), networkId);
}
for (String connectionId : iscsiBond.getStorageConnectionIds()) {
iscsiBondDao.addStorageConnectionToIscsiBond(iscsiBond.getId(), connectionId);
}
getReturnValue().setActionReturnValue(iscsiBond.getId());
return null;
});
connectAllHostsToStorage(iscsiBond.getStorageConnectionIds());
setSucceeded(true);
}
Aggregations