Search in sources :

Example 1 with ProtectionSystemList

use of com.emc.storageos.model.protection.ProtectionSystemList in project coprhd-controller by CoprHD.

the class ProtectionSystemService method getProtectionSystems.

/**
 * Gets the id, name, and self link for all registered protection systems.
 *
 * @brief List protection systems
 * @return A reference to a ProtectionSystemList.
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public ProtectionSystemList getProtectionSystems() {
    ProtectionSystemList systemsList = new ProtectionSystemList();
    ProtectionSystem system = null;
    List<URI> ids = _dbClient.queryByType(ProtectionSystem.class, true);
    for (URI id : ids) {
        system = _dbClient.queryObject(ProtectionSystem.class, id);
        if (system != null && RegistrationStatus.REGISTERED.toString().equalsIgnoreCase(system.getRegistrationStatus())) {
            systemsList.getSystems().add(toNamedRelatedResource(system));
        }
    }
    return systemsList;
}
Also used : ProtectionSystemList(com.emc.storageos.model.protection.ProtectionSystemList) MapProtectionSystem(com.emc.storageos.api.mapper.functions.MapProtectionSystem) ProtectionSystem(com.emc.storageos.db.client.model.ProtectionSystem) URI(java.net.URI) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

MapProtectionSystem (com.emc.storageos.api.mapper.functions.MapProtectionSystem)1 ProtectionSystem (com.emc.storageos.db.client.model.ProtectionSystem)1 ProtectionSystemList (com.emc.storageos.model.protection.ProtectionSystemList)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