Search in sources :

Example 11 with StorageServerConnectionParametersBase

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);
}
Also used : StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase)

Example 12 with StorageServerConnectionParametersBase

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);
}
Also used : StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) Before(org.junit.Before)

Example 13 with StorageServerConnectionParametersBase

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);
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) IscsiDetails(org.ovirt.engine.api.model.IscsiDetails) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase)

Example 14 with StorageServerConnectionParametersBase

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);
}
Also used : StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase)

Example 15 with StorageServerConnectionParametersBase

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));
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase)

Aggregations

StorageServerConnectionParametersBase (org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase)23 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)13 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)13 Guid (org.ovirt.engine.core.compat.Guid)9 VDS (org.ovirt.engine.core.common.businessentities.VDS)8 ArrayList (java.util.ArrayList)7 HashSet (java.util.HashSet)7 List (java.util.List)7 Set (java.util.Set)7 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)7 ActionType (org.ovirt.engine.core.common.action.ActionType)7 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)7 StorageDomainStatus (org.ovirt.engine.core.common.businessentities.StorageDomainStatus)7 StorageDomainType (org.ovirt.engine.core.common.businessentities.StorageDomainType)7 LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)7 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)7 GetDeviceListQueryParameters (org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters)7 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)7 QueryType (org.ovirt.engine.core.common.queries.QueryType)7 Frontend (org.ovirt.engine.ui.frontend.Frontend)7