public Map<String, UpgradePack> getUpgradePacks(String stackName, String stackVersion) {
    try {
      StackInfo stack = getStack(stackName, stackVersion);
      return stack.getUpgradePacks() == null ?
          Collections.emptyMap() : stack.getUpgradePacks();

    } catch (AmbariException e) {
      LOG.debug("Cannot load upgrade packs for non-existent stack {}-{}", stackName, stackVersion, e);
    }

    return Collections.emptyMap();
  }
Get all upgrade packs available for a stack.

@param stackName the stack name
@param stackVersion the stack version
@return a map of upgrade packs, keyed by the name of the upgrade pack
ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java