Search in sources :

Example 46 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class ForceSelectSPMCommandTest method createVDSandStoragePool.

private void createVDSandStoragePool() {
    vds = new VDS();
    vds.setId(vdsId);
    vds.setVdsName("TestVDS");
    vds.setStoragePoolId(storagePoolId);
    vds.setStatus(VDSStatus.Up);
    vds.setClusterSupportsVirtService(true);
    vds.setSpmStatus(VdsSpmStatus.None);
    vds.setVdsSpmPriority(10);
    storagePool = new StoragePool();
    storagePool.setId(storagePoolId);
    storagePool.setStatus(StoragePoolStatus.Up);
}
Also used : StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) VDS(org.ovirt.engine.core.common.businessentities.VDS)

Example 47 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class StorageServerConnectionExtensionValidatorTest method setup.

@Before
public void setup() {
    Guid hostId = Guid.newGuid();
    doReturn(dbFacade).when(validator).getDbFacade();
    doReturn(storageServerConnectionExtensionDao).when(dbFacade).getStorageServerConnectionExtensionDao();
    doReturn(vdsDao).when(dbFacade).getVdsDao();
    doReturn(new VDS()).when(vdsDao).get(hostId);
    conn = new StorageServerConnectionExtension();
    conn.setHostId(hostId);
    conn.setIqn("iqn1");
    conn.setUserName("user1");
    conn.setPassword("password1");
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) Guid(org.ovirt.engine.core.compat.Guid) StorageServerConnectionExtension(org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension) Before(org.junit.Before)

Example 48 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class BackendAffinityLabelHostResource method remove.

public Response remove() {
    // First we need to check if the label contains the host:
    Label label = BackendAffinityLabelHelper.getLabel(this, labelId);
    if (!label.getHosts().contains(guid)) {
        throw new WebApplicationException(Response.Status.NOT_FOUND);
    }
    // Remove the host from the label:
    VDS entity = new VDS();
    entity.setId(guid);
    Label updatedLabel = new LabelBuilder(label).removeEntity(entity).build();
    return performAction(ActionType.UpdateLabel, new LabelActionParameters(updatedLabel));
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) VDS(org.ovirt.engine.core.common.businessentities.VDS) LabelActionParameters(org.ovirt.engine.core.common.action.LabelActionParameters) Label(org.ovirt.engine.core.common.businessentities.Label) LabelBuilder(org.ovirt.engine.core.common.businessentities.LabelBuilder)

Example 49 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class BackendHostNicResourceTest method setGetVdsQueryExpectations.

protected void setGetVdsQueryExpectations(int times) throws Exception {
    while (times-- > 0) {
        VDS vds = new VDS();
        vds.setClusterId(GUIDS[0]);
        setUpEntityQueryExpectations(QueryType.GetVdsByVdsId, IdQueryParameters.class, new String[] { "Id" }, new Object[] { PARENT_GUID }, vds);
    }
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS)

Example 50 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class BackendHostNicsResourceTest method setGetVdsQueryExpectations.

protected void setGetVdsQueryExpectations(int times) throws Exception {
    while (times-- > 0) {
        VDS vds = new VDS();
        vds.setClusterId(GUIDS[0]);
        setUpEntityQueryExpectations(QueryType.GetVdsByVdsId, IdQueryParameters.class, new String[] { "Id" }, new Object[] { PARENT_GUID }, vds);
    }
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS)

Aggregations

VDS (org.ovirt.engine.core.common.businessentities.VDS)578 ArrayList (java.util.ArrayList)160 Test (org.junit.Test)138 Guid (org.ovirt.engine.core.compat.Guid)132 List (java.util.List)78 VM (org.ovirt.engine.core.common.businessentities.VM)65 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)55 HashMap (java.util.HashMap)53 HashSet (java.util.HashSet)48 Map (java.util.Map)45 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)42 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)42 Set (java.util.Set)40 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)39 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)39 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)39 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)38 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)38 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)37 Frontend (org.ovirt.engine.ui.frontend.Frontend)35