Search in sources :

Example 1 with CustomConfigList

use of com.emc.storageos.model.customconfig.CustomConfigList in project coprhd-controller by CoprHD.

the class CustomConfigService method getCustomConfigs.

/**
 * List custom configurations.
 *
 * @brief List config names and ids
 * @return A reference to a CustomConfigList.
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public CustomConfigList getCustomConfigs() {
    CustomConfigList configList = new CustomConfigList();
    List<URI> ids = _dbClient.queryByType(CustomConfig.class, true);
    Iterator<CustomConfig> iter = _dbClient.queryIterativeObjects(CustomConfig.class, ids);
    while (iter.hasNext()) {
        configList.getCustomConfigs().add(toNamedRelatedResource(iter.next()));
    }
    return configList;
}
Also used : CustomConfig(com.emc.storageos.db.client.model.CustomConfig) MapCustomConfig(com.emc.storageos.api.mapper.functions.MapCustomConfig) CustomConfigList(com.emc.storageos.model.customconfig.CustomConfigList) URI(java.net.URI) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

MapCustomConfig (com.emc.storageos.api.mapper.functions.MapCustomConfig)1 CustomConfig (com.emc.storageos.db.client.model.CustomConfig)1 CustomConfigList (com.emc.storageos.model.customconfig.CustomConfigList)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 URI (java.net.URI)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1