Commit Graph

9 Commits

Author SHA1 Message Date
Ken Moore
c5bf944017 [API CHANGE] Add a new API call for sysadm/update: action="applyupdate".
This takes no other inputs, and returns the following:
{
"applyupdate" : {
  "result" : "rebooting to apply updates"
  }
}
2017-11-17 15:58:37 -05:00
Ken Moore
ce53715265 Make sure the system update check is done via a DISPATCHER process.
This prevent possible hangs in the main server thread from the health check, and also ensures that the system update check API call can now return a new "checkingforupdates" status.
2017-10-27 13:35:42 -04:00
Ken Moore
311bd579f3 API CHANGE:
Two new actions for the sysadm/update class: "listlogs" and "readlogs";

REST Request (example):
-------------------------------
PUT /sysadm/update
{
   "action" : "listlogs"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "name" : "update",
   "args" : {
      "action" : "listlogs"
   },
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "listlogs": {
      "pc-updatemanager.log": {
        "finished": "1484127618",
        "name": "pc-updatemanager.log",
        "started": "1484127618"
      },
      "pc-updatemanager.log.prev": {
        "finished": "1484109171",
        "name": "pc-updatemanager.log.prev",
        "started": "1484109171"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}

===================================

REST Request (example):
-------------------------------
PUT /sysadm/update
{
   "logs" : [
      "pc-updatemanager.log"
   ],
   "action" : "readlogs"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "update",
   "args" : {
      "logs" : [
         "pc-updatemanager.log"
      ],
      "action" : "readlogs"
   }
}

Response:
-------------------------------
{
  "args": {
    "readlogs": {
      "pc-updatemanager.log": "pc-updatemanager: Tue Jan 10 23:32:51 EST 2017\nChecking for updates to ports-mgmt/pkg..\nUpdating the package repo database...\nCleaning old pkg upgrade cache...\n<Shortened For Example>\nDetermine new BE name...\nCleanup mounts..."
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2017-01-12 12:57:40 -05:00
Ken Moore
8da65605c2 Add a new setting to the update manager specifically for SysAdm:
"auto_update_reboot" = "0"-"23" (hour of the day)
If this is set (to a valid number), then SysAdm will automatically reboot the system to finish performing updates at the specified hour. Any other setting (or the value not being set) disables this option.
2016-10-25 14:02:26 -04:00
Ken Moore
2099f39d58 Add the auto-update hooks directly into the sysadm server.
Now the automatic 15 minute health checks will startup the update process if the autoupdate option is set rather than relying on anacrontab.
2016-10-25 12:41:06 -04:00
Ken Moore
4457397733 API CHANGE
Add a new API call to the sysadm/update class for reading all the current settings.

REST Request (example):
-------------------------------
PUT /sysadm/update
{
   "action" : "listsettings"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "listsettings"
   },
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "update"
}

Response:
-------------------------------
{
  "args": {
    "listsettings": {
      "maxbe": " 5",
      "package_set": " EDGE"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-08-09 12:45:27 -04:00
Ken Moore
06c71afa4a API CHANGE: Add a new "stopupdate" action for the sysadm/update class. (no additional inputs required).
This will look for any currently-running pc-updatemanager processes and kill/stop them as needed.

Example:
{
 "id":"dummy",
 "namespace":"sysadm",
 "name":"update",
 "args": {
    "action":"stopupdate"
 }
}

Output arguments:
"args":{
  "stopupdate":{
    "result":"success" or "error:<error text>"
  }
}
2016-08-09 11:27:08 -04:00
Ken Moore
7566f1396e Add a new "fast" mode to the sysadm-update check for updates (re-use previous update info), and setup the regular health check to report update information using this fast mode. 2016-03-24 08:58:29 -04:00
Ken Moore
1146b14917 Cleanup the library/server interactions for sysadm: Now the "library" directory is just an internal collection of classes/files, rather than an actual library of system calls. This allows for in-server globals usage (such as the dispatcher/events systems) within the library files as needed. 2016-02-01 12:29:25 -05:00