private static ReadableStreamChannel getResponseBody(Set<DataNodeId> dataNodeIds)
      throws JSONException, RestServiceException {
    JSONObject peers = new JSONObject();
    peers.put(PEERS_FIELD_NAME, new JSONArray());
    for (DataNodeId dataNodeId : dataNodeIds) {
      JSONObject peer = new JSONObject();
      peer.put(NAME_QUERY_PARAM, dataNodeId.getHostname());
      peer.put(PORT_QUERY_PARAM, dataNodeId.getPort());
      peers.append(PEERS_FIELD_NAME, peer);
    }
    return FrontendUtils.serializeJsonToChannel(peers);
  }
Constructs the response body as a JSON that contains the details of all the {@code dataNodeIds}.
@param dataNodeIds the {@link DataNodeId}s that need to be packaged as peers.
@return a {@link ReadableStreamChannel} containing the response.
@throws JSONException if there is any problem with JSON construction or manipulation.
ambry-frontend/src/main/java/com/github/ambry/frontend/GetPeersHandler.java