use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class AddStorageServerConnectionCommandTest method createCommand.
@Override
protected AddStorageServerConnectionCommand<StorageServerConnectionParametersBase> createCommand() {
parameters = new StorageServerConnectionParametersBase();
parameters.setVdsId(Guid.newGuid());
return new AddStorageServerConnectionCommand<>(parameters, null);
}
use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class ConnectStorageToVdsCommandTest method prepareCommand.
@Before
public void prepareCommand() {
params = new StorageServerConnectionParametersBase();
command = new ConnectStorageToVdsCommand(params, null);
}
use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class BackendHostResource method iscsiLogin.
@Override
public Response iscsiLogin(Action action) {
validateParameters(action, "iscsi.address", "iscsi.target");
StorageServerConnections cnx = new StorageServerConnections();
IscsiDetails iscsiDetails = action.getIscsi();
cnx.setConnection(iscsiDetails.getAddress());
cnx.setIqn(iscsiDetails.getTarget());
cnx.setStorageType(StorageType.ISCSI);
if (iscsiDetails.isSetPort()) {
cnx.setPort(iscsiDetails.getPort().toString());
} else {
cnx.setPort(DEFAULT_ISCSI_PORT);
}
if (iscsiDetails.isSetPortal()) {
cnx.setPortal(iscsiDetails.getPortal());
}
if (iscsiDetails.isSetUsername()) {
cnx.setUserName(iscsiDetails.getUsername());
}
if (iscsiDetails.isSetPassword()) {
cnx.setPassword(iscsiDetails.getPassword());
}
StorageServerConnectionParametersBase connectionParms = new StorageServerConnectionParametersBase(cnx, guid, false);
return doAction(ActionType.ConnectStorageToVds, connectionParms, action);
}
use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class AddExistingFileStorageDomainCommand method executeCommand.
@Override
protected void executeCommand() {
updateStaticDataDefaults();
if (StringUtils.isEmpty(getStorageDomain().getStorage())) {
getStorageDomain().setStorage(Backend.getInstance().runInternalAction(ActionType.AddStorageServerConnection, new StorageServerConnectionParametersBase(getStorageDomain().getStorageStaticData().getConnection(), getVds().getId(), false)).getActionReturnValue());
}
addStorageDomainInDb();
updateStorageDomainDynamicFromIrs();
setSucceeded(true);
}
use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class BackendStorageDomainsResource method connectStorageToHost.
private void connectStorageToHost(Guid hostId, StorageType storageType, LogicalUnit unit) {
StorageServerConnections cnx = StorageDomainHelper.getConnection(storageType, unit.getAddress(), unit.getTarget(), unit.getUsername(), unit.getPassword(), unit.getPort());
performAction(ActionType.ConnectStorageToVds, new StorageServerConnectionParametersBase(cnx, hostId, false));
}
Aggregations