@PUT
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  @Path("/saveAndRestart")
  public Response writeAndRestartConfiguration(JSONObject request) {
    LOG.debug("writeAndRestartConfiguration for request : {} ", request);
    try {

      if (isOperator() == false) {
        LOG.error("throwing 401 error as not an operator.");
        return Response.status(401).build();
      }

      String rmHosts = getRMHosts();
      JSONObject data = getJsonObject(String.format(RESTART_RM_REQUEST_DATA,
          context.getCluster().getName(), rmHosts, rmHosts));

      Map<String, String> headers = new HashMap<String, String>();
      headers.put("Content-Type", "application/x-www-form-urlencoded");
      ambariApi.requestClusterAPI("requests/", "POST", data.toJSONString(), headers);

    } catch (WebApplicationException ex) {
      LOG.error("Exception occured : ", ex);
      throw ex;
    } catch (Exception ex) {
      LOG.error("Exception occured : ", ex);
      throw new ServiceFormattedException(ex.getMessage(), ex);
    }
    return readLatestConfiguration();
  }
Sets capacity scheduler configuration and restart ResourceManager.

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