Search in sources :

Example 1 with CinderQosListRestResp

use of com.emc.storageos.cinder.model.CinderQosListRestResp in project coprhd-controller by CoprHD.

the class QosService method getQosList.

/**
 * Get the summary list of all Qos for the given tenant
 *
 * @prereq none
 *
 * @param openstackTenantId the URN of the tenant
 *
 * @brief List Qos
 * @return Qos list
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.ANY })
public CinderQosListRestResp getQosList(@PathParam("tenant_id") String openstackTenantId) {
    CinderQosListRestResp qosListResp = new CinderQosListRestResp();
    _log.debug("START get QoS list");
    List<URI> qosSpecsURI = _dbClient.queryByType(QosSpecification.class, true);
    Iterator<QosSpecification> qosIter = _dbClient.queryIterativeObjects(QosSpecification.class, qosSpecsURI);
    while (qosIter.hasNext()) {
        QosSpecification activeQos = qosIter.next();
        if (activeQos != null && hasTenantUsageAclOnQos(activeQos)) {
            _log.debug("Qos Specification found, id: {}", activeQos.getId());
            qosListResp.getQos_specs().add(getDataFromQosSpecification(activeQos));
        }
    }
    _log.debug("END get QoS list");
    return qosListResp;
}
Also used : CinderQosListRestResp(com.emc.storageos.cinder.model.CinderQosListRestResp) QosSpecification(com.emc.storageos.db.client.model.QosSpecification) URI(java.net.URI) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

CinderQosListRestResp (com.emc.storageos.cinder.model.CinderQosListRestResp)1 QosSpecification (com.emc.storageos.db.client.model.QosSpecification)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