@Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    // admin check -
    // allows when hadoop.security.instrumentation.requires.admin is set to false
    // when hadoop.security.instrumentation.requires.admin is set to true, checks if hadoop.security.authorization
    // is true and if the logged in user (via PAM or SPNEGO + kerberos) is in hive.users.in.admin.role list
    final ServletContext context = getServletContext();
    if (!HttpServer.isInstrumentationAccessAllowed(context, request, response)) {
      LOG.warn("Unauthorized to perform GET action. remoteUser: {}", request.getRemoteUser());
      return;
    }

    response.setContentType(HttpConstants.CONTENT_TYPE_JSON);
    response.setHeader(HttpConstants.ACCESS_CONTROL_ALLOW_METHODS, HttpConstants.METHOD_GET);
    response.setHeader(HttpConstants.ACCESS_CONTROL_ALLOW_ORIGIN, HttpConstants.WILDCARD);

    ServletContext ctx = getServletContext();
    HiveConf hiveConf = (HiveConf) ctx.getAttribute(HttpServer.CONF_CONTEXT_ATTRIBUTE);
    HS2ActivePassiveHARegistry hs2Registry = HS2ActivePassiveHARegistryClient.getClient(hiveConf);
    HS2Instances instances = new HS2Instances(hs2Registry.getAll());
    response.getWriter().write(instances.toJson());
    response.setStatus(HttpServletResponse.SC_OK);
    response.flushBuffer();
  }
Returns all HS2 instances in Active-Passive standy modes.
service/src/java/org/apache/hive/service/servlet/HS2Peers.java