Search in sources :

Example 1 with QosAssociationsRestResp

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

the class QosService method getQosAssociations.

/**
 * Get the detailed list of all associations for a given qos
 *
 * @prereq none
 *
 * @param openstackTenantId the URN of the tenant
 *
 * @brief List volumes in detail
 * @return Volume detailed list
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{qos_id}/associations")
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.ANY })
public QosAssociationsRestResp getQosAssociations(@PathParam("tenant_id") String openstackTenantId, @PathParam("qos_id") String qosId) {
    _log.debug("START get qos associations");
    QosAssociationsRestResp objQosRestResp = new QosAssociationsRestResp();
    URI qosURI = URIUtil.createId(QosSpecification.class, qosId);
    QosSpecification qosSpecification = _dbClient.queryObject(QosSpecification.class, qosURI);
    if (qosSpecification != null && hasTenantUsageAclOnQos(qosSpecification)) {
        objQosRestResp.getAssociation().add(getQosAssociation(qosSpecification));
    }
    _log.debug("END get qos association");
    return objQosRestResp;
}
Also used : QosAssociationsRestResp(com.emc.storageos.cinder.model.QosAssociationsRestResp) QosSpecification(com.emc.storageos.db.client.model.QosSpecification) URI(java.net.URI) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

QosAssociationsRestResp (com.emc.storageos.cinder.model.QosAssociationsRestResp)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 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1