Search in sources :

Example 1 with SMISProviderList

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;
}
Also used : SMISProviderList(com.emc.storageos.model.smis.SMISProviderList) StorageProvider(com.emc.storageos.db.client.model.StorageProvider) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

StorageProvider (com.emc.storageos.db.client.model.StorageProvider)1 SMISProviderList (com.emc.storageos.model.smis.SMISProviderList)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1