Search in sources :

Example 1 with CinderQosDetail

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

the class QosService method getQosDetails.

/**
 * Get the details of given Qos for the given tenant
 *
 * @prereq none
 *
 * @param openstackTenantId the URN of the tenant
 * @param qosId the URN of the QoS
 *
 * @brief List Qos in detail
 * @return Qos detailed list
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{qos_id}")
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.ANY })
public CinderQosDetail getQosDetails(@PathParam("tenant_id") String openstackTenantId, @PathParam("qos_id") String qosId) {
    CinderQosDetail qosDetailed = new CinderQosDetail();
    _log.debug("START get QoS specs detailed");
    URI qosURI = URIUtil.createId(QosSpecification.class, qosId);
    QosSpecification qosSpecification = _dbClient.queryObject(QosSpecification.class, qosURI);
    if (qosSpecification != null && hasTenantUsageAclOnQos(qosSpecification)) {
        _log.debug("Fetched Qos Specification, id: {}", qosSpecification.getId());
        qosDetailed.qos_spec = getDataFromQosSpecification(qosSpecification);
        // Self link points on a Virtual Pool assigned to Qos
        VirtualPool virtualPool = _dbClient.queryObject(VirtualPool.class, qosSpecification.getVirtualPoolId());
        if (virtualPool != null) {
            qosDetailed.setLink(DbObjectMapper.toLink(virtualPool));
        }
    }
    _log.debug("END get QoS specs detailed");
    return qosDetailed;
}
Also used : CinderQosDetail(com.emc.storageos.cinder.model.CinderQosDetail) QosSpecification(com.emc.storageos.db.client.model.QosSpecification) VirtualPool(com.emc.storageos.db.client.model.VirtualPool) 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

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