Commit Graph

573 Commits

Author SHA1 Message Date
Ken Moore
aa055be7a2 Merge branch 'master' of github.com:pcbsd/sysadm 2016-04-29 10:04:57 -04:00
Ken Moore
caad04ece9 Add a new API call:
rpc/dispatcher -> "action":"list"
This will list all the currently running/pending processes within the dispatcher queues.
Possible Queues: "no_queue", "pkg_queue", "iocage_queue"

REST Request:
-------------------------------
PUT /rpc/dispatcher
{
   "action" : "list"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "list"
   },
   "namespace" : "rpc",
   "name" : "dispatcher",
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "jobs": {
      "pkg_queue": {
        "sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}": {
          "commands": [
            "pkg install -y --repository \"pcbsd-major\" misc/pcbsd-meta-mate"
          ],
          "queue_position": "0",
          "state": "running"
        }
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "rpc"
}
2016-04-29 10:00:43 -04:00
dlavigne
3131b73a5e Add new logs class. While here, fix a grammo. 2016-04-28 09:13:58 -04:00
Ken Moore
4cee9244e4 Add a new API call/class:
namespace: "sysadm"
name: "logs"
This is a class used for interacting with the log files created by the sysadm server.

"action":"read_logs"
Optional Arguments:
"logs" : array/string of log type(s) (valid types: "hostinfo", "dispatcher", "events-dispatcher","events-lifepreserver","events-state"
"time_format" : one of the following formats (required for custom start/end times below). Valid Formats: "time_t_seconds", "epoch_mseconds, "relative_[day/month/second]", or a QDateTime String code (see http://doc.qt.io/qt-5/qdatetime.html#fromString for details).
"start_time" : "<number/string corresponding to format above>"
"end_time" : "<number/string corresponding to format above>"

If the time_format is missing, or the start/end times are not defined, the end time will be the current date/time, and the start time will be 12 hours previous.
If the "logs" argument is missing/empty, then all logs matching the search parameters will be returned.

Example Input:
{
 "action" : "read_logs",
 "time_format" : "relative_second",
 "start_time" : "-3600"
}
This returns all log entries within the last hour.

Return Format:
"args" : {
  "<log_file_type>" : {
    "<date_time_stamp>" : <message>,
    "<date_timo_stamp2>" : <message>
  }
}
2016-04-27 16:41:17 -04:00
dlavigne
1d041b47f9 Update name of Guide. While here, fix a mangled table. 2016-04-27 14:37:39 -04:00
dlavigne
fe58a46838 Doc pkg_autoremove action. 2016-04-27 09:34:06 -04:00
Ken Moore
0acebe7435 Fix up a couple LP API calls. Now they function properly again. 2016-04-26 13:59:53 -04:00
Ken Moore
cd3078c708 Add a note about the day-codes for the lifepreserver scrub schedule: 01 is Monday, 07 is Sunday. 2016-04-26 13:45:45 -04:00
Ken Moore
1b29b2966f Merge branch 'master' of github.com:pcbsd/sysadm 2016-04-26 09:43:24 -04:00
Ken Moore
b07f11bfe3 API Change: Add a simple "pkg_autoremove" action for the sysadm/pkg subsystem (no additional inputs). This will queue up the pkg autoremove action which prunes all orphaned packages on the systems. 2016-04-26 09:41:58 -04:00
dlavigne
0cd90b3558 Doc new fs class. 2016-04-22 12:29:56 -04:00
Kris Moore
dd33e9648c Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-04-21 14:55:20 -04:00
Kris Moore
b2a4386c36 Add a new 'fs' class to sysadm API, along with the initial "dirlist"
command which will return a listing of the requested directory

REST Request:
-------------------------------
PUT /sysadm/fs
{
   "dir" : "/root",
   "action" : "dirlist"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "dir" : "/root",
      "action" : "dirlist"
   },
   "id" : "fooid",
   "name" : "fs",
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "dirlist": {
      "VirtualBox VMs": {
        "dir": true
      },
      "freenas-auto.iso": {
        "group": "wheel",
        "owner": "root",
        "size": 408049664
      },
      "ixbuild": {
        "dir": true
      },
      "pc-sysinstall.cfg": {
        "group": "wheel",
        "owner": "root",
        "size": 1741
      },
      "pc-sysinstall.log": {
        "group": "wheel",
        "owner": "root",
        "size": 125408
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-04-21 14:54:12 -04:00
dlavigne
cf1c16de27 Doc datasets action. 2016-04-21 13:45:16 -04:00
dlavigne
25eac09ce9 Doc createsnap action. 2016-04-21 13:37:59 -04:00
Ken Moore
e4db11a0f7 Fix a missing "ok=true" in the ZFS list_pools API call. 2016-04-21 13:09:48 -04:00
Kris Moore
f5d402108b Fix starting sysadm-server 2016-04-21 11:34:06 -04:00
Kris Moore
cff5baae47 Add new API call to return list of ZFS datasets on a particular pool
REST Request:
-------------------------------
PUT /sysadm/zfs
{
   "action" : "datasets",
   "zpool" : "tank"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "id" : "fooid",
   "args" : {
      "action" : "datasets",
      "zpool" : "tank"
   },
   "name" : "zfs"
}

Response:
-------------------------------
{
  "args": {
    "datasets": {
      "tank": {
        "avail": "320G",
        "mountpoint": "none",
        "refer": "96K",
        "used": "125G"
      },
      "tank/ROOT": {
        "avail": "320G",
        "mountpoint": "none",
        "refer": "96K",
        "used": "63.7G"
      },
      "tank/ROOT/11.0-CURRENTAPRIL2016-up-20160418_124146": {
        "avail": "320G",
        "mountpoint": "/",
        "refer": "34.7G",
        "used": "63.7G"
      },
      "tank/ROOT/11.0-CURRENTFEB2016-up-20160303_094216": {
        "avail": "320G",
        "mountpoint": "/",
        "refer": "29.7G",
        "used": "272K"
      },
      "tank/ROOT/11.0-CURRENTMAR2016-up-20160304_102405": {
        "avail": "320G",
        "mountpoint": "/",
        "refer": "30.5G",
        "used": "248K"
      },
      "tank/ROOT/11.0-CURRENTMAR2016-up-20160315_092952": {
        "avail": "320G",
        "mountpoint": "/",
        "refer": "31.2G",
        "used": "256K"
      },
      "tank/ROOT/11.0-CURRENTMAR2016-up-20160318_090405": {
        "avail": "320G",
        "mountpoint": "/",
        "refer": "34.7G",
        "used": "280K"
      },
      "tank/ROOT/initial": {
        "avail": "320G",
        "mountpoint": "/mnt",
        "refer": "5.60G",
        "used": "232K"
      },
      "tank/iocage": {
        "avail": "320G",
        "mountpoint": "/iocage",
        "refer": "152K",
        "used": "1.13G"
      },
      "tank/iocage/.defaults": {
        "avail": "320G",
        "mountpoint": "/iocage/.defaults",
        "refer": "96K",
        "used": "992K"
      },
      "tank/iocage/download": {
        "avail": "320G",
        "mountpoint": "/iocage/download",
        "refer": "96K",
        "used": "203M"
      },
      "tank/iocage/download/10.2-RELEASE": {
        "avail": "320G",
        "mountpoint": "/iocage/download/10.2-RELEASE",
        "refer": "202M",
        "used": "202M"
      },
      "tank/iocage/jails": {
        "avail": "320G",
        "mountpoint": "/iocage/jails",
        "refer": "104K",
        "used": "1000K"
      },
      "tank/iocage/releases": {
        "avail": "320G",
        "mountpoint": "/iocage/releases",
        "refer": "96K",
        "used": "953M"
      },
      "tank/iocage/releases/10.2-RELEASE": {
        "avail": "320G",
        "mountpoint": "/iocage/releases/10.2-RELEASE",
        "refer": "96K",
        "used": "952M"
      },
      "tank/iocage/releases/10.2-RELEASE/root": {
        "avail": "320G",
        "mountpoint": "/iocage/releases/10.2-RELEASE/root",
        "refer": "825M",
        "used": "951M"
      },
      "tank/iocage/templates": {
        "avail": "320G",
        "mountpoint": "/iocage/templates",
        "refer": "96K",
        "used": "992K"
      },
      "tank/iohyve": {
        "avail": "320G",
        "mountpoint": "/iohyve",
        "refer": "96K",
        "used": "22.8G"
      },
      "tank/iohyve/Firmware": {
        "avail": "320G",
        "mountpoint": "/iohyve/Firmware",
        "refer": "96K",
        "used": "992K"
      },
      "tank/iohyve/ISO": {
        "avail": "320G",
        "mountpoint": "/iohyve/ISO",
        "refer": "96K",
        "used": "453M"
      },
      "tank/iohyve/ISO/FreeBSD-10.1-RELEASE-amd64-bootonly.iso": {
        "avail": "320G",
        "mountpoint": "/iohyve/ISO/FreeBSD-10.1-RELEASE-amd64-bootonly.iso",
        "refer": "219M",
        "used": "220M"
      },
      "tank/iohyve/ISO/FreeBSD-10.2-RELEASE-amd64-bootonly.iso": {
        "avail": "320G",
        "mountpoint": "/iohyve/ISO/FreeBSD-10.2-RELEASE-amd64-bootonly.iso",
        "refer": "231M",
        "used": "232M"
      },
      "tank/iohyve/bsdguest": {
        "avail": "320G",
        "mountpoint": "/iohyve/bsdguest",
        "refer": "96K",
        "used": "22.4G"
      },
      "tank/iohyve/bsdguest/disk0": {
        "avail": "341G",
        "mountpoint": "-",
        "refer": "1.75G",
        "used": "22.4G"
      },
      "tank/tmp": {
        "avail": "320G",
        "mountpoint": "/tmp",
        "refer": "2.95M",
        "used": "18.3M"
      },
      "tank/usr": {
        "avail": "320G",
        "mountpoint": "none",
        "refer": "96K",
        "used": "37.5G"
      },
      "tank/usr/home": {
        "avail": "320G",
        "mountpoint": "/usr/home",
        "refer": "96K",
        "used": "27.8G"
      },
      "tank/usr/home/kris": {
        "avail": "320G",
        "mountpoint": "/usr/home/kris",
        "refer": "21.9G",
        "used": "27.8G"
      },
      "tank/usr/jails": {
        "avail": "320G",
        "mountpoint": "/usr/jails",
        "refer": "96K",
        "used": "992K"
      },
      "tank/usr/obj": {
        "avail": "320G",
        "mountpoint": "/usr/obj",
        "refer": "4.68G",
        "used": "4.75G"
      },
      "tank/usr/ports": {
        "avail": "320G",
        "mountpoint": "/usr/ports",
        "refer": "2.20G",
        "used": "2.96G"
      },
      "tank/usr/src": {
        "avail": "320G",
        "mountpoint": "/usr/src",
        "refer": "1.82G",
        "used": "2.01G"
      },
      "tank/var": {
        "avail": "320G",
        "mountpoint": "none",
        "refer": "96K",
        "used": "13.5M"
      },
      "tank/var/audit": {
        "avail": "320G",
        "mountpoint": "/var/audit",
        "refer": "96K",
        "used": "992K"
      },
      "tank/var/log": {
        "avail": "320G",
        "mountpoint": "/var/log",
        "refer": "1.43M",
        "used": "5.21M"
      },
      "tank/var/mail": {
        "avail": "320G",
        "mountpoint": "/var/mail",
        "refer": "120K",
        "used": "1.21M"
      },
      "tank/var/tmp": {
        "avail": "320G",
        "mountpoint": "/var/tmp",
        "refer": "3.20M",
        "used": "5.99M"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-04-21 11:28:37 -04:00
Kris Moore
4f8b78c361 Add new API call to create a new snapshot via Life-Preserver
REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "snap" : "mytestsnap",
   "dataset" : "tank",
   "comment" : "Testing",
   "action" : "createsnap"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "comment" : "Testing",
      "dataset" : "tank",
      "action" : "createsnap",
      "snap" : "mytestsnap"
   },
   "name" : "lifepreserver",
   "namespace" : "sysadm",
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "createsnap": {
      "comment": "Testing",
      "dataset": "tank",
      "snap": "mytestsnap"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-04-21 10:36:44 -04:00
Kris Moore
5f53dd4a4e Finish adding relaunchd services for sysadm server 2016-04-19 10:00:56 -04:00
Kris Moore
9153467480 Disable launchd support for now 2016-04-14 15:57:29 -04:00
Kris Moore
47428cef37 Detect if we get a 'cannot destroy' error from iohyve rmiso 2016-04-14 10:36:29 -04:00
Kris Moore
57cc4212bb Comments on sysadm server wrapper 2016-04-13 14:30:05 -04:00
Dru Lavigne
2860152c04 Merge pull request #14 from Mrt134/master
Additional dispatcher work
2016-04-12 17:04:15 -04:00
Kris Moore
fc55d22a9f Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-04-12 16:56:29 -04:00
Kris Moore
1f62042828 Add new relaunchd configuration files, but keep rc.d so both
can be used
2016-04-12 16:55:03 -04:00
Tim Moore II
81c4e91905 Content addition to connection.rst
-beginning to create content for the "getting started" section in connection.rst
-re-added events.rst to the index
-some json syntax corrections in connection.rst
2016-04-12 16:47:30 -04:00
Tim Moore II
224c7c8178 Additional dispatcher work
-updated dispatcher messaging to reflect current changes
-fixed some errors in formatting
-altered dispatcher sample responses in the necessary classes section to reflect a "finished" state.
2016-04-12 13:39:34 -04:00
Ken Moore
b257874672 Disable the rpc/syscache backend from the sysadm server. The new sysadm/pkg backend completely replaces it. 2016-04-12 07:38:52 -04:00
Ken Moore
ad26f68a76 Merge branch 'master' of github.com:pcbsd/sysadm 2016-04-11 10:41:10 -04:00
Ken Moore
f4c0bc632f (API CHANGE) Enhance the sysadm-pkg search functionality a bit:
1) Add a new optional argument to the pkg_search action: "search_excludes" (string or array of strings). This will exclude matches which contain a restricted string.
2) Add a new output field to the search results:
"pkg_search":{"results_order":[list of origins by priority], <other results/data> }
3) Adjust how the search is performed when the search term has multiple words. First look for any result which contains all the words, then if nothing is found look for any result which contains any of the words.
2016-04-11 10:34:28 -04:00
Dru Lavigne
74d28db8fa Merge pull request #13 from Mrt134/master
Events.rst work
2016-04-07 15:02:25 -04:00
Tim Moore II
e245ee9be4 Events.rst work
-Adding additional documentation of dispatcher subsystem and sample code blocks
2016-04-07 14:56:20 -04:00
Ken Moore
6cdf2c32ba Fix a bug with the new SQL database connections - the sub-queries needed the individual DB to use as well. 2016-04-05 14:37:03 -04:00
Ken Moore
b7273f7e19 Make sure that when starting updates via sysadm - it will remove the temporary/last update log file so the next check is forced to re-run. 2016-04-05 10:22:37 -04:00
Ken Moore
36b30e6c9c Finish cleaning up the new "pending" state for dispatcher processes. 2016-04-05 10:19:05 -04:00
Ken Moore
8ad8babafa Adjust the pkg search routine to also detect exact name matches. 2016-04-05 09:43:17 -04:00
Ken Moore
9409ef7908 Setup the dispatcher system to have "pending" processes send out regular pings about still being pending. 2016-04-05 09:38:39 -04:00
Ken Moore
d99e3443bd Merge branch 'master' of github.com:pcbsd/sysadm 2016-04-05 09:10:54 -04:00
Ken Moore
72e337f10b Fix up the SQL connection queue issues. Now it works a little faster and multiple threads accessing the same database will not cause crashes. 2016-04-05 09:10:04 -04:00
Dru Lavigne
f1fe85150e Merge pull request #12 from Mrt134/master
-Added tm to 'SysAdm'
2016-04-04 14:10:21 -04:00
Tim Moore II
b11281e2bc -Added tm to 'SysAdm' 2016-04-04 13:48:55 -04:00
Dru Lavigne
895821ad0e Merge pull request #11 from Mrt134/master
Content addition to the SysAdm server docs
2016-04-04 13:40:14 -04:00
Tim Moore II
185f064b34 Text addition to manage.rst
- added sysadm default config settings and the process to create custom configs to manage.rst
2016-04-04 13:34:52 -04:00
Tim Moore II
919457d54f Forgot to add the new files from the previous commit. 2016-04-04 13:11:32 -04:00
Tim Moore II
bfb99d34ce Content addition to the SysAdm server docs
-Added two new docs as chapters
-Bringing readme information over to .rst for downloading and building SysAdm
2016-04-04 13:06:12 -04:00
Ken Moore
89fbc1293c Merge branch 'master' of github.com:pcbsd/sysadm 2016-04-01 15:06:51 -04:00
Ken Moore
221b666262 Turn off some debugging, and switch the pkg database connection system over to a clone system so one request cannot interfere with another. 2016-04-01 15:06:10 -04:00
Dru Lavigne
070fa8578c Merge pull request #10 from Mrt134/master
A few error fixes
2016-03-31 15:14:35 -04:00
Tim Moore II
6cdd3d2cbf A few error fixes
- updated sysadm server documentation with correct title.
 - cleaned up a few json errors in dispatcher event reply messages.
2016-03-31 13:54:26 -04:00