Ken Moore 8680d309a5 Add a new API call: sysadm/pkg, "action"="pkg_check_upgrade".
This will have pkg check to see if there are any package updates available.
NOTE: The actual information will be returned as a Dispatcher event - this API call just queues up the pkg operation (limitation of pkg - only one process call at a time)

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "action" : "pkg_check_upgrade"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "pkg_check_upgrade"
   },
   "namespace" : "sysadm",
   "name" : "pkg",
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "pkg_check_upgrade": {
      "proc_cmd": "pkg upgrade -n",
      "proc_id": "sysadm_pkg_check_upgrade-{c5e9d9a1-7c49-4a70-9d7c-4a84277c83b0}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-28 11:00:59 -04:00
2016-03-28 10:39:55 -04:00
2015-12-08 14:37:18 -05:00
2016-02-23 13:56:02 -05:00
2016-03-12 05:27:55 -05:00

Table of Contents generated with DocToc

SysAdm

Official repo for PC-BSD's sysadm middleware WebSocket & REST server

This middleware acts as the core for controlling a PC-BSD or FreeBSD
system either locally or remotely via WebSockets or REST. It is also the
server component to PC-BSD's SysAdm GUI client.

Required Qt Modules

Qt5 Core (pkg install qt5-core)
Qt5 Concurrent (pkg install qt5-concurrent)
Qt5 Websockets (pkg install qt5-websockets)

Building SysAdm

% git clone https://github.com/pcbsd/sysadm.git
% cd sysadm/src
% /usr/local/lib/qt5/bin/qmake -recursive
% make && sudo make install

Starting SysAdm

(For WebSockets - Required for SysAdm Client)
% sudo sysrc -f /etc/rc.conf sysadm_enable="YES"
% sudo service sysadm start

(Optional for REST)
% sudo sysrc -f /etc/rc.conf sysadm_rest_enable="YES"
% sudo service sysadm-rest start

API Documentation

https://api.pcbsd.org

Contributing new API calls

SysAdm is written using the Qt toolkit, which has excellent reference documentation.

All Qt Core classes (I.E. non-gui) can be used in SysAdm server.

Adding new API calls to the middleware is very straight-forward, simply
add a new function which accepts JSON in, and returns JSON, then connect
it to the backend.

Example: 4d3b590f46

Adding new Classes for API calls

Adding a new API class requires tweaking a few more files than a new API call only.

Example: 1ba65b3388

Testing new API calls / classes

Before committing or sending a pull request, you'll need to run our
"api-test.sh" script and confirm it works properly. To do so, first add
your new call and restart the websocket server. Next do the following:

% cd sysadm/tests
% ./api-test.sh

The api-test script will prompt you to enter username, password, and some
information about which class / API call to run. When that is done, and you
have verified the functionality of your new call you should add the output
of the test script (either from copy-n-paste, or from the file /tmp/api-response)
to your commit. (This will allow us to document the new call / class)

Description
No description provided
Readme BSD-2-Clause 5.2 MiB
Languages
C++ 85.6%
Shell 12.7%
C 0.8%
QMake 0.6%
JavaScript 0.2%