use of com.emc.storageos.model.smis.SMISProviderList in project coprhd-controller by CoprHD.
the class SMISProviderService method getSmiSProviderList.
/**
* This function allows user to fetch list of all SMI-S Providers information.
* <p>
* The method is deprecated. Use /vdc/storage-providers instead.
*
* @brief List SMI-S providers
* @return List of SMIS-Providers.
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public SMISProviderList getSmiSProviderList() {
List<StorageProvider> providerList = CustomQueryUtility.getActiveStorageProvidersByInterfaceType(_dbClient, StorageProvider.InterfaceType.smis.name());
/*
* List<URI> ids = _dbClient.queryByType(SMISProvider.class);
* List<SMISProvider> smisProviders = _dbClient.queryObject(SMISProvider.class, ids);
* if (smisProviders == null) {
* throw APIException.badRequests.unableToFindSMISProvidersForIds(ids);
* }
*/
SMISProviderList smisProviderList = new SMISProviderList();
for (StorageProvider provider : providerList) {
smisProviderList.getSmisProviders().add(toNamedRelatedResource(ResourceTypeEnum.SMIS_PROVIDER, provider.getId(), provider.getLabel()));
}
return smisProviderList;
}
Aggregations