Search in sources :

Example 1 with StorageDriverList

use of com.emc.storageos.model.storagedriver.StorageDriverList in project coprhd-controller by CoprHD.

the class StorageDriverServiceTest method testGetStorageDrivers.

@Test
public void testGetStorageDrivers() {
    StorageDriverList driverList = service.getStorageDrivers();
    assertEquals(driverList.getDrivers().size(), 2);
    for (StorageDriverRestRep driver : driverList.getDrivers()) {
        if ("driver1".equals(driver.getDriverName())) {
            assertEquals(driver.getSupportedTypes().size(), 2);
            assertTrue(driver.getSupportedTypes().contains("systemtype1"));
            assertTrue(driver.getSupportedTypes().contains("providertype1"));
            assertEquals(driver.getDriverStatus(), "IN_USE");
        }
        if ("driver2".equals(driver.getDriverName())) {
            assertEquals(driver.getSupportedTypes().size(), 1);
            assertTrue(driver.getSupportedTypes().contains("systemtype2"));
            assertEquals(driver.getDriverStatus(), "READY");
        }
    }
}
Also used : StorageDriverList(com.emc.storageos.model.storagedriver.StorageDriverList) StorageDriverRestRep(com.emc.storageos.model.storagedriver.StorageDriverRestRep) Test(org.junit.Test)

Example 2 with StorageDriverList

use of com.emc.storageos.model.storagedriver.StorageDriverList in project coprhd-controller by CoprHD.

the class StorageDriverService method getStorageDrivers.

@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.RESTRICTED_SYSTEM_ADMIN })
public StorageDriverList getStorageDrivers() {
    StorageDriverList driverList = new StorageDriverList();
    driverList.setDrivers(queryStorageDriver(null));
    return driverList;
}
Also used : StorageDriverList(com.emc.storageos.model.storagedriver.StorageDriverList) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

StorageDriverList (com.emc.storageos.model.storagedriver.StorageDriverList)2 StorageDriverRestRep (com.emc.storageos.model.storagedriver.StorageDriverRestRep)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 Test (org.junit.Test)1