@Override
  public ObjectNode execute(final HttpServletRequest request) throws Exception {

    // get cluster object
    Cluster cluster = repository.getCluster();

    // json object to be sent as response
    ObjectNode responseJSON = mapper.createObjectNode();

    // members list
    ArrayNode memberListJson = mapper.createArrayNode();
    Cluster.Member[] memberSet = cluster.getMembers();

    for (Cluster.Member member : memberSet) {
      ObjectNode memberJSON = mapper.createObjectNode();
      memberJSON.put("memberId", member.getId());
      memberJSON.put("name", member.getName());
      memberJSON.put("host", member.getHost());

      memberListJson.add(memberJSON);
    }

    // Response JSON
    responseJSON.set("clusterMembers", memberListJson);
    responseJSON.put("clusterName", cluster.getServerName());

    // Send json response
    return responseJSON;
  }
Class MembersListService

This class contains implementations of getting list of Cluster Members.

@since GemFire version 7.5
geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/service/MembersListService.java