private Set<Resource> getRequestResources(String clusterName,
                                            Long requestId,
                                            String requestStatus,
                                            Integer maxResults,
                                            Boolean ascOrder,
                                            Set<String> requestedPropertyIds)
      throws NoSuchResourceException, NoSuchParentResourceException {

    Set<Resource> response = new HashSet<>();
    ActionManager actionManager = getManagementController().getActionManager();

    Long clusterId = null;

    if (clusterName != null) {
      Clusters clusters = getManagementController().getClusters();
      //validate that cluster exists, throws exception if it doesn't.
      try {
        Cluster cluster = clusters.getCluster(clusterName);
        clusterId = cluster.getClusterId();
      } catch (AmbariException e) {
        throw new NoSuchParentResourceException(e.getMessage(), e);
      }
    }

    List<Long> requestIds = Collections.emptyList();

    if (requestId == null) {
      org.apache.ambari.server.actionmanager.RequestStatus status = null;
      if (requestStatus != null) {
        status = org.apache.ambari.server.actionmanager.RequestStatus.valueOf(requestStatus);
      }
      if (LOG.isDebugEnabled()) {
        LOG.debug("Received a Get Request Status request, requestId=null, requestStatus={}", status);
      }

      maxResults = (maxResults != null) ? maxResults : BaseRequest.DEFAULT_PAGE_SIZE;
      ascOrder = (ascOrder != null) ? ascOrder : false;

      if (null == status) {
        if (null != clusterId) {
          // !!! don't mix results of cluster vs non-cluster
          requestIds = s_requestDAO.findAllRequestIds(maxResults, ascOrder, clusterId);
        } else {
          // !!! not a cluster, so get all requests NOT affiliated with a cluster
          requestIds = s_requestDAO.findAllRequestIds(maxResults, ascOrder, null);
        }
      } else {
        // !!! this call will result in mixed results of cluster and non-cluster.  this
        // will get fixed in a future iteration, as the host_role_command table does not
        // currently have direct cluster affinity, and changing that is a tad destructive.
        requestIds = actionManager.getRequestsByStatus(status, maxResults, ascOrder);
      }

      LOG.debug("List<Long> requestIds = actionManager.getRequestsByStatus = {}", requestIds.size());

      response.addAll(getRequestResources(clusterId, clusterName, requestIds,
          requestedPropertyIds));
    } else {
      Collection<Resource> responses = getRequestResources(
          clusterId, clusterName, Collections.singletonList(requestId), requestedPropertyIds);

      if (responses.isEmpty()) {
        throw new NoSuchResourceException("Request resource doesn't exist.");
      }
      response.addAll(responses);
    }
    return response;
  }
Gets all of the request resources for the given properties.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java