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>
}
}
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.
This will remove the given packages from the system.
Required arguments:
"pkg_origins" = (single origin string or array of origin strings).
Optional arguments:
"recursive" = "true" or "false" (default: "true"). If true, other packages which depend on this package will also be removed (no broken dependencies).
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
{
"recursive" : "false",
"action" : "pkg_remove",
"pkg_origins" : "games/angband"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"name" : "pkg",
"namespace" : "sysadm",
"args" : {
"action" : "pkg_remove",
"recursive" : "false",
"pkg_origins" : "games/angband"
}
}
Response:
-------------------------------
{
"args": {
"pkg_remove": {
"proc_cmd": "pkg delete -y games/angband",
"proc_id": "sysadm_pkg_remove-{2aa844aa-f6a8-4e8f-ae71-b56af735ccb8}",
"status": "pending"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
This will install the given packages on the system.
Required arguments:
"pkg_origins" = (single origin string or array of origin strings).
Optional arguments:
"repo": Name of the remote repository to use (if not supplied, pkg will automatically determine repository).
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
{
"pkg_origins" : "games/angband",
"action" : "pkg_install",
"repo" : "pcbsd-major"
}
WebSocket Request:
-------------------------------
{
"name" : "pkg",
"namespace" : "sysadm",
"id" : "fooid",
"args" : {
"action" : "pkg_install",
"pkg_origins" : "games/angband",
"repo" : "pcbsd-major"
}
}
Response:
-------------------------------
{
"args": {
"pkg_install": {
"proc_cmd": "pkg install -y --repository \"pcbsd-major\" games/angband",
"proc_id": "sysadm_pkg_install-{ae444472-47df-4a65-91eb-013cc82ce4ad}",
"status": "pending"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
This will have pkg update it's databases if necessary (not typically used).
Optional argument: "force" = "true" or "false" (default: "false"). If true, this will force pkg to completely re-sync all databases with all known repos (may take some time).
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
{
"force" : "true",
"action" : "pkg_update"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"name" : "pkg",
"namespace" : "sysadm",
"args" : {
"force" : "true",
"action" : "pkg_update"
}
}
Response:
-------------------------------
{
"args": {
"pkg_update": {
"proc_cmd": "pkg update -f",
"proc_id": "sysadm_pkg_update-{8d65bbc5-fefc-4f34-8743-167e61a54c4c}",
"status": "pending"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
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"
}
This will have pkg upgrade all currently-installed packages.
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_upgrade"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "pkg_upgrade"
},
"name" : "pkg",
"namespace" : "sysadm",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"pkg_upgrade": {
"proc_cmd": "pkg upgrade -y",
"proc_id": "sysadm_pkg_upgrade-{19ace7c9-0d83-4a0d-9249-0b56cb105762}",
"status": "pending"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
This will perform an audit of all installed packages and report any vulnerable packages and which other packages these impact. 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_audit"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "pkg_audit"
},
"name" : "pkg",
"id" : "fooid",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"pkg_audit": {
"proc_cmd": "pkg audit -qr",
"proc_id": "sysadm_pkg_audit-{257cc46b-9178-4990-810a-12416ddfad79}",
"status": "pending"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
1) "action"="list_categories" (optional argument: "repo"). This will list all the known categories within the given repository (local repository used by default if none specified). WARNING: Just because a category is listed from here does not mean there are packages existing within that category. This might be corrected later on to only return categories where packages reside.
2) "action"="list_repos" (no other arguments). This will scan the pkg repo config files and return any repos that pkg is currently aware of. NOTE: All of the repos returns by this function are valid as the optional "repo" argument for the other sysadm/pkg API calls.
API Call #1:
REST Request:
-------------------------------
PUT /sysadm/pkg
{
"repo" : "local",
"action" : "list_categories"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"args" : {
"action" : "list_categories",
"repo" : "local"
},
"namespace" : "sysadm",
"name" : "pkg"
}
Response:
-------------------------------
{
"args": {
"list_categories": [
"ports-mgmt",
"x11",
"gnome",
"textproc",
"devel",
"python",
"misc",
"print",
"graphics",
"security",
"x11-fonts",
"lang",
"ipv6",
"perl5",
"converters",
"math",
"x11-toolkits",
"sysutils",
"dns",
"net",
"accessibility",
"databases",
"shells",
"x11-themes",
"multimedia",
"audio",
"www",
"ftp",
"net-im",
"archivers",
"comms",
"java",
"deskutils",
"kde",
"mail",
"editors",
"emulators",
"games",
"irc",
"japanese",
"news",
"x11-servers",
"tk",
"net-mgmt",
"ruby",
"x11-drivers",
"x11-wm",
"x11-clocks",
"kld",
"tcl",
"enlightenment",
"linux"
]
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
API Call #2
REST Request:
-------------------------------
PUT /sysadm/pkg
{
"action" : "list_repos"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"name" : "pkg",
"args" : {
"action" : "list_repos"
}
}
Response:
-------------------------------
{
"args": {
"list_repos": [
"local",
"pcbsd-major"
]
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
1) Add a new optional argument: "category". This option will be used if the "pkg_origins" argument is not, and limits the results to packages within the designated category.
2) Add a new optional argument: "result". This option may be set to anything other than "full" to restrict the information output to just the basic/simple information (no sub-categories of info such as "dependencies","requires","depends","options", etc...)
Example JSON request:
{"action":"pkg_info","category":"x11","result":"simple"}
These argument will result in a basic listing of all the packages within the x11 category. (name, version, origin, www, arch, comment, etc....)
{
This system reads the pkg database directly and returns any relevant information about the pkgs requested.
Note: The "repo" input is optional (defaults to "local"), and the "pkg_origins" will become optional here soon as well (going to make it default to listing all pkgs if the pkg_origins variable is missing/empty).
REST Request:
-------------------------------
PUT /sysadm/pkg
{
"pkg_origins" : [
"x11/lumina"
],
"repo" : "local",
"action" : "pkg_info"
}
WebSocket Request:
-------------------------------
{
"name" : "pkg",
"namespace" : "sysadm",
"args" : {
"repo" : "local",
"action" : "pkg_info",
"pkg_origins" : [
"x11/lumina"
]
},
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"pkg_info": {
"x11/lumina": {
"arch": "FreeBSD:11:amd64",
"automatic": "0",
"comment": "Lumina Desktop Environment",
"dep_formula": "",
"dependencies": [
"x11-toolkits/qt5-gui",
"x11/qt5-x11extras",
"x11-wm/fluxbox",
"x11/libXdamage",
"devel/qt5-linguist",
"x11/numlockx",
"devel/qt5-buildtools",
"multimedia/qt5-multimedia",
"graphics/qt5-svg",
"x11/xbrightness",
"x11/xorg",
"devel/desktop-file-utils",
"devel/qt5-concurrent",
"x11/libX11",
"net/qt5-network",
"x11-themes/fluxbox-tenr-styles-pack",
"x11-themes/kde4-icons-oxygen",
"devel/qt5-core",
"x11/xscreensaver",
"multimedia/gstreamer1-plugins-core",
"graphics/qt5-imageformats"
],
"desc": "Lumina-DE is a lightweight, BSD licensed desktop environment,\ndesigned specifically for use on FreeBSD\n\nWWW: http://lumina-desktop.org",
"files": [
"/usr/local/share/licenses/lumina-0.8.8_2,1/catalog.mk",
"/usr/local/share/licenses/lumina-0.8.8_2,1/LICENSE",
"/usr/local/share/licenses/lumina-0.8.8_2,1/BSD3CLAUSE",
"/usr/local/bin/Lumina-DE",
"/usr/local/bin/lumina-config",
"/usr/local/bin/lumina-fileinfo",
"/usr/local/bin/lumina-fm",
"/usr/local/bin/lumina-info",
"/usr/local/bin/lumina-open",
"/usr/local/bin/lumina-screenshot",
"/usr/local/bin/lumina-search",
"/usr/local/bin/lumina-xconfig",
"/usr/local/etc/luminaDesktop.conf.dist",
"/usr/local/include/LuminaOS.h",
"/usr/local/include/LuminaSingleApplication.h",
"/usr/local/include/LuminaThemes.h",
"/usr/local/include/LuminaUtils.h",
"/usr/local/include/LuminaX11.h",
"/usr/local/include/LuminaXDG.h",
"/usr/local/lib/libLuminaUtils.so",
"/usr/local/lib/libLuminaUtils.so.1",
"/usr/local/lib/libLuminaUtils.so.1.0",
"/usr/local/lib/libLuminaUtils.so.1.0.0",
"/usr/local/share/Lumina-DE/Login.ogg",
"/usr/local/share/Lumina-DE/Logout.ogg",
"/usr/local/share/Lumina-DE/colors/Black.qss.colors",
"/usr/local/share/Lumina-DE/colors/Blue-Light.qss.colors",
"/usr/local/share/Lumina-DE/colors/Grey-Dark.qss.colors",
"/usr/local/share/Lumina-DE/colors/Lumina-Glass.qss.colors",
"/usr/local/share/Lumina-DE/colors/Lumina-Gold.qss.colors",
"/usr/local/share/Lumina-DE/colors/Lumina-Green.qss.colors",
"/usr/local/share/Lumina-DE/colors/Lumina-Purple.qss.colors",
"/usr/local/share/Lumina-DE/colors/Lumina-Red.qss.colors",
"/usr/local/share/Lumina-DE/colors/PCBSD10-Default.qss.colors",
"/usr/local/share/Lumina-DE/colors/Solarized-Dark.qss.colors",
"/usr/local/share/Lumina-DE/colors/Solarized-Light.qss.colors",
"/usr/local/share/Lumina-DE/desktop-background.jpg",
"/usr/local/share/Lumina-DE/fluxbox-init-rc",
"/usr/local/share/Lumina-DE/fluxbox-keys",
"/usr/local/share/Lumina-DE/luminaDesktop.conf",
"/usr/local/share/Lumina-DE/quickplugins/quick-sample.qml",
"/usr/local/share/Lumina-DE/themes/Lumina-default.qss.template",
"/usr/local/share/Lumina-DE/themes/None.qss.template",
"/usr/local/share/applications/lumina-fm.desktop",
"/usr/local/share/applications/lumina-info.desktop",
"/usr/local/share/applications/lumina-screenshot.desktop",
"/usr/local/share/applications/lumina-search.desktop",
"/usr/local/share/applications/lumina-support.desktop",
"/usr/local/share/pixmaps/Insight-FileManager.png",
"/usr/local/share/pixmaps/Lumina-DE.png",
"/usr/local/share/wallpapers/Lumina-DE/Lumina_Wispy_gold.jpg",
"/usr/local/share/wallpapers/Lumina-DE/Lumina_Wispy_green.jpg",
"/usr/local/share/wallpapers/Lumina-DE/Lumina_Wispy_purple.jpg",
"/usr/local/share/wallpapers/Lumina-DE/Lumina_Wispy_red.jpg",
"/usr/local/share/xsessions/Lumina-DE.desktop"
],
"flatsize": "12324767",
"icon": "\\\"http://www.pcbsd.org/appcafe/icons/x11_lumina.png\\\"",
"id": "2541",
"licenselogic": "1",
"licenses": [
"BSD3CLAUSE"
],
"locked": "0",
"maintainer": "kmoore@FreeBSD.org",
"manifestdigest": "2$0$4ypg5zrco9upyuioczmo3uwbtdd5yart7xuit6fx3gjrn1k979qb",
"message": "[{\"message\":\"The Lumina Desktop Environment has been installed!\\n\\nAn entry for for launching Lumina from a graphical login manager has already been added to the system, but if you with to start Lumina manually, you will need to do one of the following:\\n1) Put the line \\\"exec Lumina-DE\\\" at the end of your user's \\\"~/.xinitrc\\\" file before running startx\\n2) Wrap the Lumina binary call with an X initialization call: \\nExample: \\\"xinit ${PREFIX}/bin/Lumina-DE -- :0\\\"\\n\\nAlso note that the system-wide default settings for Lumina are contained in ${PREFIX}/etc/luminaDesktop.conf[.dist]. While it is possible to customize the desktop to the user's liking after logging in, you may want to adjust the default settings as necessary if there are multiple user accounts on this system.\"}]",
"mtree_id": "",
"name": "lumina",
"options": {
"MULTIMEDIA": "on",
"PCBSD": "on"
},
"origin": "x11/lumina",
"pkg_format_version": "",
"prefix": "/usr/local",
"repo_type": "binary",
"repository": "pcbsd-major",
"screen1": "\\\"http://www.pcbsd.org/appcafe/screenshots/x11/lumina/screen1.png\\\"",
"shlibs_provided": [
"libLuminaUtils.so.1"
],
"shlibs_required": [
"libxcb.so.1",
"libxcb-composite.so.0",
"libxcb-damage.so.0",
"libXdamage.so.1",
"libxcb-util.so.1",
"libGL.so.1",
"libQt5Core.so.5",
"libxcb-image.so.0",
"libxcb-icccm.so.4",
"libxcb-ewmh.so.2",
"libQt5Gui.so.5",
"libQt5Network.so.5",
"libQt5Widgets.so.5",
"libQt5Concurrent.so.5",
"libQt5Multimedia.so.5",
"libQt5MultimediaWidgets.so.5",
"libQt5Svg.so.5",
"libQt5X11Extras.so.5"
],
"time": "1458334158",
"version": "0.8.8_2,1",
"www": "http://lumina-desktop.org"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}