code: @Restricted(DoNotUse.class)
      public HttpResponse doConnectionStatus(StaplerRequest request) {
          try {
              String siteId = request.getParameter("siteId");
              if (siteId == null) {
                  siteId = ID_DEFAULT;
              } else if (siteId.equals("default")) {
                  // If the request explicitly requires the default ID, ship it
                  siteId = ID_DEFAULT;
              }
              ConnectionCheckJob checkJob = getConnectionCheckJob(siteId);
              if (checkJob == null) {
                  UpdateSite site = getSite(siteId);
                  if (site != null) {
                      checkJob = addConnectionCheckJob(site);
                  }
              }
              if (checkJob != null) {
                  boolean isOffline = false;
                  for (ConnectionStatus status : checkJob.connectionStates.values()) {
                      if(ConnectionStatus.FAILED.equals(status)) {
                          isOffline = true;
                          break;
                      }
                  }
                  if (isOffline) {
                      // retry connection states if determined to be offline
                      checkJob.run();
                      isOffline = false;
                      for (ConnectionStatus status : checkJob.connectionStates.values()) {
                          if(ConnectionStatus.FAILED.equals(status)) {
                              isOffline = true;
                              break;
                          }
                      }
                      if(!isOffline) { // also need to download the metadata
                          updateAllSites();
                      }
                  }
                  return HttpResponses.okJSON(checkJob.connectionStates);
              } else {
                  return HttpResponses.errorJSON(String.format("Cannot check connection status of the update site with ID='%s'"
                          + ". This update center cannot be resolved", siteId));
              }
          } catch (Exception e) {
              return HttpResponses.errorJSON(String.format("ERROR: %s", e.getMessage()));
          }
      }
docs: Get the current connection status.
  <p>
  Supports a "siteId" request parameter, defaulting to {@link #ID_DEFAULT} for the default
  update site.
  
  @return The current connection status.