use of org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters in project ovirt-engine by oVirt.
the class ImportHostedEngineStorageDomainCommand method executeCommand.
@Override
protected void executeCommand() {
StorageDomainManagementParameter addSdParams = new StorageDomainManagementParameter(heStorageDomain.getStorageStaticData());
addSdParams.setVdsId(getParameters().getVdsId());
addSdParams.setStoragePoolId(getVds().getStoragePoolId());
ActionType actionType = null;
switch(heStorageDomain.getStorageType()) {
case NFS:
case GLUSTERFS:
actionType = ActionType.AddExistingFileStorageDomain;
addStorageServerConnection();
break;
case ISCSI:
discoverBlockConnectionDetails();
case FCP:
actionType = ActionType.AddExistingBlockStorageDomain;
removeHostedEngineLunDisk();
break;
}
if (getSucceeded()) {
setSucceeded(backend.runInternalAction(actionType, addSdParams, getContext()).getSucceeded());
}
if (getSucceeded()) {
AttachStorageDomainToPoolParameters attachSdParams = new AttachStorageDomainToPoolParameters(addSdParams.getStorageDomainId(), addSdParams.getStoragePoolId());
setSucceeded(backend.runInternalAction(ActionType.AttachStorageDomainToPool, attachSdParams, getContext()).getSucceeded());
}
setActionReturnValue(heStorageDomain);
}
use of org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters in project ovirt-engine by oVirt.
the class BackendAttachedStorageDomainsResource method add.
@Override
public Response add(StorageDomain storageDomain) {
validateParameters(storageDomain, "id|name");
Guid storageDomainId;
if (storageDomain.isSetId()) {
storageDomainId = asGuid(storageDomain.getId());
} else {
storageDomainId = lookupStorageDomainIdByName(storageDomain.getName());
}
return performCreate(ActionType.AttachStorageDomainToPool, new AttachStorageDomainToPoolParameters(storageDomainId, dataCenterId), new StorageDomainIdResolver(storageDomainId));
}
use of org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters in project ovirt-engine by oVirt.
the class AddLocalStorageDomainCommand method executeCommand.
@Override
protected void executeCommand() {
super.executeCommand();
if (getSucceeded()) {
ActionReturnValue returnValue = Backend.getInstance().runInternalAction(ActionType.AttachStorageDomainToPool, new AttachStorageDomainToPoolParameters(getStorageDomain().getId(), getStoragePool().getId()));
if (!returnValue.getSucceeded()) {
getReturnValue().setSucceeded(false);
getReturnValue().setFault(returnValue.getFault());
}
}
}
use of org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters in project ovirt-engine by oVirt.
the class StorageDataCenterListModel method executeAttachStorageDomains.
public void executeAttachStorageDomains(Model model) {
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (StoragePool dataCenter : getSelectedDataCentersForAttach()) {
parameters.add(new AttachStorageDomainToPoolParameters(getEntity().getId(), dataCenter.getId()));
}
Frontend.getInstance().runMultipleAction(ActionType.AttachStorageDomainToPool, parameters, result -> {
ListModel localModel = (ListModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters in project ovirt-engine by oVirt.
the class StorageListModel method attachStorageToDataCenter.
private void attachStorageToDataCenter(Guid storageId, Guid dataCenterId, Boolean activateDomain) {
AttachStorageDomainToPoolParameters params = new AttachStorageDomainToPoolParameters(storageId, dataCenterId);
if (activateDomain != null) {
params.setActivate(activateDomain);
}
Frontend.getInstance().runAction(ActionType.AttachStorageDomainToPool, params, null, this);
}
Aggregations