@Override
  public Set<Resource> getResources(Request request, Predicate predicate)
      throws SystemException, UnsupportedPropertyException,
      NoSuchResourceException, NoSuchParentResourceException {

    final Set<StackVersionRequest> requests = new HashSet<>();
    Set<Resource> resources = new HashSet<>();

    if (predicate == null) {
      requests.add(getRequest(Collections.emptyMap()));
    } else {
      Map<String, Object> propertyMap = new HashMap<>(PredicateHelper.getProperties(predicate));
      if (propertyMap.containsKey(MPACK_RESOURCE_ID)) {
        Resource resource = new ResourceImpl(Resource.Type.StackVersion);
        Long mpackId = Long.valueOf((String) propertyMap.get(MPACK_RESOURCE_ID));
        StackEntity stackEntity = stackDAO.findByMpack(mpackId);
        requests.add(new StackVersionRequest(stackEntity.getStackName(), stackEntity.getStackVersion()));
        resource.setProperty(STACK_NAME_PROPERTY_ID,
                (String)stackEntity.getStackName());

        resource.setProperty(STACK_VERSION_PROPERTY_ID,
                (String)stackEntity.getStackVersion());

        resource.setProperty(MPACK_RESOURCE_ID, mpackId);

        resources.add(resource);

      } else {
        for (Map<String, Object> propertyMap1:
             getPropertyMaps(predicate)) {
          requests.add(getRequest(propertyMap1));
        }

    Set<String> requestedIds = getRequestPropertyIds(request, predicate);

    Set<StackVersionResponse> responses = getResources(new Command<Set<StackVersionResponse>>() {
      @Override
      public Set<StackVersionResponse> invoke() throws AmbariException {
        return getManagementController().getStackVersions(requests);
      }
    });


    for (StackVersionResponse response : responses) {
      Resource resource = new ResourceImpl(Resource.Type.StackVersion);

      setResourceProperty(resource, STACK_NAME_PROPERTY_ID,
          response.getStackName(), requestedIds);

      setResourceProperty(resource, STACK_VERSION_PROPERTY_ID,
          response.getStackVersion(), requestedIds);

      setResourceProperty(resource, STACK_ACTIVE_PROPERTY_ID,
          response.isActive(), requestedIds);

      setResourceProperty(resource, STACK_VALID_PROPERTY_ID,
          response.isValid(), requestedIds);

      setResourceProperty(resource, STACK_ERROR_SET,
          response.getErrors(), requestedIds);

      setResourceProperty(resource, STACK_PARENT_PROPERTY_ID,
        response.getParentVersion(), requestedIds);

      setResourceProperty(resource, STACK_CONFIG_TYPES,
          response.getConfigTypes(), requestedIds);

      setResourceProperty(resource, UPGRADE_PACKS_PROPERTY_ID,
          response.getUpgradePacks(), requestedIds);

      setResourceProperty(resource, STACK_MIN_JDK,
              response.getMinJdk(), requestedIds);

      setResourceProperty(resource, STACK_MAX_JDK,
              response.getMaxJdk(), requestedIds);

        resources.add(resource);
      }
      }
    }

      return resources;
    }
The key property ids for a mpack resource.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackVersionResourceProvider.java