private String getRMUrlFromClusterConfig() {
    String url;

    String haEnabled = getYarnConfig(YARN_RESOURCEMANAGER_HA_ENABLED);
    String httpPolicy = getYarnConfig(YARN_HTTP_POLICY);

    if (!(HTTP_ONLY.equals(httpPolicy) || HTTPS_ONLY.equals(httpPolicy))) {
      LOG.error(String.format("RA030 Unknown value %s of yarn-site/yarn.http.policy. HTTP_ONLY assumed.", httpPolicy));
      httpPolicy = HTTP_ONLY;
    }

    if (haEnabled != null && haEnabled.equals("true")) {
      String[] urls = getRMHAUrls(httpPolicy);
      url = getActiveRMUrl(urls);
    } else {
      url =  (httpPolicy.equals(HTTPS_ONLY)) ? getYarnConfig(YARN_RESOURCEMANAGER_HTTPS_KEY)
        : getYarnConfig(YARN_RESOURCEMANAGER_HTTP_KEY);

      if (url == null || url.isEmpty()) {
        url = getYarnConfig(YARN_RESOURCEMANAGER_HOSTNAME_KEY).trim() + ":" + getDefaultRMPort(httpPolicy);
      }

      url = addProtocolIfMissing(url, getProtocol(httpPolicy));
    }
    return url;
  }
Returns URL to Resource Manager.
If cluster associated, returns HTTP or HTTPS address based on "yarn.http.policy" property value.
If not associated, retrieves RM URL from view instance properties by "yarn.resourcemanager.url" property.
@return url of RM
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java