private String getConfigResourceManagerId(Map<String, String> yarnConfig, String hostName) {

    for (String id : yarnConfig.get(PROPERTY_HA_RM_IDS).split(",")) {

      String hostNameProperty = String.format(PROPERTY_HOSTNAME_TEMPLATE, id);
      String hostNameById = yarnConfig.get(hostNameProperty);

      if (hostNameById.equals(hostName)) {
        return id;
      }
    }
    return null;
  }
Resource manager specific HTTP property request.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ResourceManagerHttpPropertyRequest.java