code: @CLIMethod(name="safe-restart")
      public HttpResponse doSafeRestart(StaplerRequest req) throws IOException, ServletException, RestartNotSupportedException {
          checkPermission(ADMINISTER);
          if (req != null && req.getMethod().equals("GET"))
              return HttpResponses.forwardToView(this,"_safeRestart.jelly");
  
          if (req == null || req.getMethod().equals("POST")) {
              safeRestart();
          }
  
          return HttpResponses.redirectToDot();
      }
docs: Queues up a restart of Jenkins for when there are no builds running, if we can.
  
  This first replaces "app" to {@link HudsonIsRestarting}
  
  @since 1.332