Search in sources :

Example 1 with ComputeSystemList

use of com.emc.storageos.model.compute.ComputeSystemList in project coprhd-controller by CoprHD.

the class ComputeSystemService method getComputeSystemList.

/**
 * Gets a list of all (active) ViPR Compute Systems.
 *
 * @brief List compute systems
 * @return A list of Name/Id pairs representing active Compute Systems. The
 *         IDs returned can be used to fetch more detailed information about
 *         Compute Systems
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public ComputeSystemList getComputeSystemList() {
    List<URI> ids = _dbClient.queryByType(ComputeSystem.class, true);
    ComputeSystemList list = new ComputeSystemList();
    Iterator<ComputeSystem> iter = _dbClient.queryIterativeObjects(ComputeSystem.class, ids);
    while (iter.hasNext()) {
        list.getComputeSystems().add(toNamedRelatedResource(iter.next()));
    }
    return list;
}
Also used : ComputeSystemList(com.emc.storageos.model.compute.ComputeSystemList) URI(java.net.URI) ComputeSystem(com.emc.storageos.db.client.model.ComputeSystem) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

ComputeSystem (com.emc.storageos.db.client.model.ComputeSystem)1 ComputeSystemList (com.emc.storageos.model.compute.ComputeSystemList)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