@GET
  @Produces(MediaType.APPLICATION_JSON)
  @Path("/nodeLabels")
  public Response getNodeLabels() {
    LOG.debug("reading nodeLables");
    Response response;

    try {
      String url = String.format(RM_GET_NODE_LABEL_URL, getRMUrl());

      InputStream rmResponse = context.getURLStreamProvider().readFrom(
          url, "GET", (String) null, new HashMap<String, String>());
      String nodeLabels = IOUtils.toString(rmResponse);

      response = Response.ok(nodeLabels).build();
    } catch (ConnectException ex) {
      LOG.error("Exception occurred : ", ex);
      throw new ServiceFormattedException("Connection to Resource Manager refused", ex);
    } catch (WebApplicationException ex) {
      LOG.error("Exception occurred : ", ex);
      throw ex;
    } catch (Exception ex) {
      LOG.error("Exception occurred : ", ex);
      throw new ServiceFormattedException(ex.getMessage(), ex);
    }

    return response;
  }
Gets node labels from RM

@return node labels
contrib/views/capacity-scheduler/src/main/java/org/apache/ambari/view/capacityscheduler/ConfigurationService.java