use of com.emc.storageos.db.client.model.StorageSystemType in project coprhd-controller by CoprHD.
the class StorageSystemTypeService method getStorageSystemType.
/**
* Show Storage System Type detail for given URI
*
* @param id
* the URN of Storage System Type
* @brief Show storage system type of storage
* @return Storage System Type details
*/
@GET
@Path("/{id}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public StorageSystemTypeRestRep getStorageSystemType(@PathParam("id") URI id) {
log.info("GET getStorageSystemType on Uri: " + id);
ArgValidator.checkFieldUriType(id, StorageSystemType.class, "id");
StorageSystemType storageType = queryResource(id);
ArgValidator.checkEntity(storageType, id, isIdEmbeddedInURL(id));
StorageSystemTypeRestRep storageTypeRest = new StorageSystemTypeRestRep();
return map(storageType, storageTypeRest);
}
use of com.emc.storageos.db.client.model.StorageSystemType in project coprhd-controller by CoprHD.
the class StorageSystemTypeService method getStorageSystemTypes.
/**
* Returns a list of all Storage System Types requested for like block,
* file, object or all. Valid input parameters are block, file, object and
* all
*
* @brief List storage system types
* @return List of all storage system types.
*/
@GET
@Path("/type/{type}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public StorageSystemTypeList getStorageSystemTypes(@PathParam("type") String type) {
log.info("GET getStorageSystemType on type: " + type);
if (type != null) {
ArgValidator.checkFieldValueFromEnum(type.toUpperCase(), "metaType", StorageSystemType.META_TYPE.class);
}
List<URI> ids = _dbClient.queryByType(StorageSystemType.class, true);
StorageSystemTypeList list = new StorageSystemTypeList();
Iterator<StorageSystemType> iter = _dbClient.queryIterativeObjects(StorageSystemType.class, ids);
while (iter.hasNext()) {
StorageSystemType ssType = iter.next();
if (ssType.getStorageTypeId() == null) {
ssType.setStorageTypeId(ssType.getId().toString());
}
if (StringUtils.equals(ALL_TYPE, type) || StringUtils.equals(type, ssType.getMetaType())) {
list.getStorageSystemTypes().add(map(ssType));
}
}
return list;
}
use of com.emc.storageos.db.client.model.StorageSystemType in project coprhd-controller by CoprHD.
the class StorageDriverManagerProxy method listNonNativeTypes.
private List<StorageSystemType> listNonNativeTypes() {
List<StorageSystemType> result = new ArrayList<StorageSystemType>();
List<URI> ids = dbClient.queryByType(StorageSystemType.class, true);
Iterator<StorageSystemType> it = dbClient.queryIterativeObjects(StorageSystemType.class, ids);
while (it.hasNext()) {
StorageSystemType type = it.next();
if (type.getIsNative() == null || type.getIsNative()) {
continue;
}
if (StringUtils.equals(type.getDriverStatus(), StorageSystemType.STATUS.ACTIVE.toString())) {
result.add(type);
}
}
return result;
}
use of com.emc.storageos.db.client.model.StorageSystemType in project coprhd-controller by CoprHD.
the class StorageDriverManagerProxy method refreshInfo.
private void refreshInfo() {
clearInfo();
List<StorageSystemType> types = listNonNativeTypes();
for (StorageSystemType type : types) {
String typeName = type.getStorageTypeName();
String driverName = type.getDriverName();
if (type.getIsSmiProvider()) {
storageProvidersMap.put(driverName, typeName);
log.info("Driver info for storage system type {} has been set into storageDriverManagerProxy instance", typeName);
continue;
}
storageSystemsMap.put(driverName, typeName);
if (type.getManagedBy() != null) {
providerManaged.add(typeName);
} else {
directlyManaged.add(typeName);
}
if (StringUtils.equals(type.getMetaType(), StorageSystemType.META_TYPE.FILE.toString())) {
fileSystems.add(typeName);
} else if (StringUtils.equals(type.getMetaType(), StorageSystemType.META_TYPE.BLOCK.toString())) {
blockSystems.add(typeName);
}
log.info("Driver info for storage system type {} has been set into storageDriverManagerProxy instance", typeName);
}
}
Aggregations