use of com.emc.storageos.model.smis.StorageProviderList in project coprhd-controller by CoprHD.
the class StorageProviderService method getStorageProviderList.
/**
* @brief List Storage providers
* This function allows user to fetch list of all Storage Providers information.
*
* @return List of Storage Providers.
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public StorageProviderList getStorageProviderList() {
List<URI> ids = _dbClient.queryByType(StorageProvider.class, true);
List<StorageProvider> mgmtProviders = _dbClient.queryObject(StorageProvider.class, ids);
if (mgmtProviders == null) {
throw APIException.badRequests.unableToFindStorageProvidersForIds(ids);
}
StorageProviderList providerList = new StorageProviderList();
for (StorageProvider provider : mgmtProviders) {
providerList.getStorageProviders().add(toNamedRelatedResource(provider));
}
return providerList;
}
Aggregations