Search in sources :

Example 1 with ComputeImageServerList

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

the class ComputeImageServerService method getComputeImageServers.

/**
 * Returns a list of all compute image servers.
 *
 * @brief Show compute image servers
 * @return List of all compute image servers.
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public ComputeImageServerList getComputeImageServers() {
    List<URI> ids = _dbClient.queryByType(ComputeImageServer.class, true);
    ComputeImageServerList imageServerList = new ComputeImageServerList();
    Iterator<ComputeImageServer> iter = _dbClient.queryIterativeObjects(ComputeImageServer.class, ids);
    while (iter.hasNext()) {
        ComputeImageServer imageServer = iter.next();
        imageServerList.getComputeImageServers().add(DbObjectMapper.toNamedRelatedResource(imageServer));
    }
    return imageServerList;
}
Also used : ComputeImageServer(com.emc.storageos.db.client.model.ComputeImageServer) ComputeImageServerList(com.emc.storageos.model.compute.ComputeImageServerList) URI(java.net.URI) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

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