Search in sources :

Example 1 with NetworkSystemList

use of com.emc.storageos.model.network.NetworkSystemList in project coprhd-controller by CoprHD.

the class NetworkSystemService method getNetworkSystemList.

/**
 * Returns list of all network systems. Each item in the list contains
 * an id, name, and link.
 *
 * @prereq none
 * @brief List network systems
 * @return NetworkSystemList for each NetworkSystem, each containing an id, name, and link.
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public NetworkSystemList getNetworkSystemList() {
    NetworkSystem system;
    List<URI> ids;
    ids = _dbClient.queryByType(NetworkSystem.class, true);
    NetworkSystemList list = new NetworkSystemList();
    for (URI id : ids) {
        system = _dbClient.queryObject(NetworkSystem.class, id);
        if (system != null) {
            list.getSystems().add(toNamedRelatedResource(system));
        }
    }
    return list;
}
Also used : NetworkSystem(com.emc.storageos.db.client.model.NetworkSystem) MapNetworkSystem(com.emc.storageos.api.mapper.functions.MapNetworkSystem) URI(java.net.URI) NetworkSystemList(com.emc.storageos.model.network.NetworkSystemList) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

MapNetworkSystem (com.emc.storageos.api.mapper.functions.MapNetworkSystem)1 NetworkSystem (com.emc.storageos.db.client.model.NetworkSystem)1 NetworkSystemList (com.emc.storageos.model.network.NetworkSystemList)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