Ken Moore
34b388277d
[API CHANGE] Add a new "action" for sysadm/systemmanager
...
"action"="deviceinfo" will return the full information about all devices attached to the system (via `pciconf -lv`)
-------------------
REST Request (example):
-------------------------------
PUT /sysadm/systemmanager
{
"action" : "deviceinfo"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"name" : "systemmanager",
"namespace" : "sysadm",
"args" : {
"action" : "deviceinfo"
}
}
Response:
-------------------------------
{
"args": {
"deviceinfo": {
"ahci0": {
"class": "mass storage",
"device": "8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode]",
"subclass": "SATA",
"vendor": "Intel Corporation"
},
"ehci0": {
"class": "serial bus",
"device": "8 Series/C220 Series Chipset Family USB EHCI",
"subclass": "USB",
"vendor": "Intel Corporation"
},
"ehci1": {
"class": "serial bus",
"device": "8 Series/C220 Series Chipset Family USB EHCI",
"subclass": "USB",
"vendor": "Intel Corporation"
},
"hdac0": {
"class": "multimedia",
"subclass": "HDA",
"vendor": "NVIDIA Corporation"
},
"hdac1": {
"class": "multimedia",
"device": "8 Series/C220 Series Chipset High Definition Audio Controller",
"subclass": "HDA",
"vendor": "Intel Corporation"
},
"hostb0": {
"class": "bridge",
"device": "4th Gen Core Processor DRAM Controller",
"subclass": "HOST-PCI",
"vendor": "Intel Corporation"
},
"isab0": {
"class": "bridge",
"device": "B85 Express LPC Controller",
"subclass": "PCI-ISA",
"vendor": "Intel Corporation"
},
"none0": {
"class": "simple comms",
"device": "8 Series/C220 Series Chipset Family MEI Controller",
"vendor": "Intel Corporation"
},
"none1": {
"class": "serial bus",
"device": "8 Series/C220 Series Chipset Family SMBus Controller",
"subclass": "SMBus",
"vendor": "Intel Corporation"
},
"pcib1": {
"class": "bridge",
"device": "Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller",
"subclass": "PCI-PCI",
"vendor": "Intel Corporation"
},
"pcib2": {
"class": "bridge",
"device": "8 Series/C220 Series Chipset Family PCI Express Root Port",
"subclass": "PCI-PCI",
"vendor": "Intel Corporation"
},
"pcib3": {
"class": "bridge",
"device": "8 Series/C220 Series Chipset Family PCI Express Root Port",
"subclass": "PCI-PCI",
"vendor": "Intel Corporation"
},
"pcib4": {
"class": "bridge",
"device": "8 Series/C220 Series Chipset Family PCI Express Root Port",
"subclass": "PCI-PCI",
"vendor": "Intel Corporation"
},
"pcib5": {
"class": "bridge",
"device": "82801 PCI Bridge",
"subclass": "PCI-PCI",
"vendor": "Intel Corporation"
},
"re0": {
"class": "network",
"device": "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller",
"subclass": "ethernet",
"vendor": "Realtek Semiconductor Co., Ltd."
},
"vgapci0": {
"class": "display",
"device": "GM206 [GeForce GTX 960]",
"subclass": "VGA",
"vendor": "NVIDIA Corporation"
},
"xhci0": {
"class": "serial bus",
"device": "8 Series/C220 Series Chipset Family USB xHCI",
"subclass": "USB",
"vendor": "Intel Corporation"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-08-02 11:14:38 -04:00
Ken Moore
00251895a3
[API CHANGE] Add a new "pkg_install_verify" action to sysadm/pkg
...
Add an "action" = "pkg_install_verify" option to the sysadm/pkg API call.
REQUIRED: "pkg_origins" - string or array of pkg origins
"repo" - remote repository that the package will be installed from.
----------
REST Request (example):
-------------------------------
PUT /sysadm/pkg
{
"repo" : "trueos-major",
"action" : "pkg_install_verify",
"pkg_origins" : [
"www/qupzilla-qt5-webkit"
]
}
WebSocket Request:
-------------------------------
{
"name" : "pkg",
"namespace" : "sysadm",
"id" : "fooid",
"args" : {
"action" : "pkg_install_verify",
"pkg_origins" : [
"www/qupzilla-qt5-webkit"
],
"repo" : "trueos-major"
}
}
Response:
-------------------------------
{
"args": {
"pkg_install_verify": {
"conflicts": [],
"install": {
"qupzilla-qt5-webkit": {
"comment": "Web browser based on WebKit engine and Qt Framework",
"flatsize": "13380132",
"name": "qupzilla-qt5-webkit",
"origin": "www/qupzilla-qt5-webkit",
"pkgsize": "2574460",
"version": "1.8.9_3"
}
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-08-01 13:08:51 -04:00
Ken Moore
3276b32f80
NEW API: sysadm/iocage "action"="cleantemplates"
...
This will delete all templates which have been cached on the local system.
-----------
REST Request (example):
-------------------------------
PUT /sysadm/iocage
{
"action" : "cleantemplates"
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"args" : {
"action" : "cleantemplates"
},
"id" : "fooid",
"name" : "iocage"
}
Response:
-------------------------------
{
"args": {
"cleantemplates": {
"success": "All templates have been cleaned."
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-06-02 11:13:29 -04:00
Ken Moore
c744785115
New API: sysadm/iocage "action"="cleanreleases"
...
This will remove all the RELEASE's which have been downloaded/cached on the local system.
----------
REST Request (example):
-------------------------------
PUT /sysadm/iocage
{
"action" : "cleanreleases"
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"args" : {
"action" : "cleanreleases"
},
"id" : "fooid",
"name" : "iocage"
}
Response:
-------------------------------
{
"args": {
"cleanreleases": {
"success": "All RELEASEs have been cleaned."
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-06-02 11:11:46 -04:00
Ken Moore
b428fb531a
NEW API: sysadm/iocage "action"="createplugin"
...
This will fetch/create a new plugin jail.
Required Arguements:
"action"="createplugin"
"plugin"="name_of_plugin"
"net_device"="network_device_to_use"
"ip4" *or* "ip6" with the address to assign to the new jail (IPv4 or IPv6 address)
Changelog: yes
------------
REST Request (example):
-------------------------------
PUT /sysadm/iocage
{
"plugin" : "gitlab",
"net_device" : "re0",
"action" : "createplugin",
"ip4" : "10.20.0.130"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"name" : "iocage",
"args" : {
"ip4" : "10.20.0.130",
"plugin" : "gitlab",
"net_device" : "re0",
"action" : "createplugin"
},
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"createplugin": {
"started_dispatcher_id": "sysadm_iocage_fetch_plugin_gitlab"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-06-02 09:52:53 -04:00
Ken Moore
737e90c42a
NEW API CALL: sysadm/iocage "action"="fetchreleases"
...
This will fetch any remotely-available FreeBSD releases and update/cache them on the local system for use when spinning up jails.
REQUIRED ARGUMENTS:
"action" = "fetchreleases"
"releases": String *or* Array of strings containing the version/release to fetch.
Changelog: yes
-----------------
REST Request (example):
-------------------------------
PUT /sysadm/iocage
{
"action" : "fetchreleases",
"releases" : [
"10.3-RELEASE",
"10.2-RELEASE"
]
}
WebSocket Request:
-------------------------------
{
"args" : {
"releases" : [
"10.3-RELEASE",
"10.2-RELEASE"
],
"action" : "fetchreleases"
},
"name" : "iocage",
"namespace" : "sysadm",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"fetchreleases": {
"started_dispatcher_id": [
"sysadm_iocage_fetch_release_10.3-RELEASE",
"sysadm_iocage_fetch_release_10.2-RELEASE"
]
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-06-02 08:24:45 -04:00
Ken Moore
a3c44a5f5b
NEW API: sysadm/iocage "action"="listjails"
...
This will list all the current jails on the system.
Output syntax is almost exactly the same as the listtemplates action:
{
"listjails":{
"jails:{
"jid_1":{
[same 10 fields: jid, uuid, boot, state, tag, type, release, ip4, ip6, template]
},
"jid_2":{
[same 10 fields]
}
}
}
}
2017-06-01 16:13:34 -04:00
Ken Moore
fdd864e298
NEW API: sysadm/iocage "action"="listtemplates"
...
This will list all the jail templates currently available on the local system.
Example Arguments Reply:
{
"listtemplates":{
"templates" : {
"template_1" : {
"jid" : "jail_id",
"uuid": "unique_id_string",
"boot": "on/off",
"state":"jail_state",
"tag":"jail_tag",
"type":"jail_type",
"release":"freebsd_release",
"ip4":"ipv4_address",
"ip6":"ipv6_address",
"template":"template_1"
}
}
}
}
2017-06-01 16:04:01 -04:00
Ken Moore
859b441ae2
New API Call: sysadm/iocage "action"="activatestatus"
...
This will list the current pool which is activated for iocage to use.
Example API return (arguments):
{
"activatestatus":{
"activated":"true",
"pool":"my_zpool"
}
}
Changelog: yes
2017-06-01 13:50:10 -04:00
Ken Moore
2bf23b8aaf
API Change: sysadm/iocage - "action"="listreleases"
...
Add an API call for listing all the FreeBSD releases supported for iocage jails
REST Request (example):
-------------------------------
PUT /sysadm/iocage
{
"action" : "listreleases"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "listreleases"
},
"name" : "iocage",
"id" : "fooid",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"listreleases": {
"local": [
""
],
"remote": [
"9.3-RELEASE (EOL)",
"10.1-RELEASE (EOL)",
"10.2-RELEASE (EOL)",
"10.3-RELEASE",
"11.0-RELEASE"
]
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
Changelog: yes
2017-05-31 14:24:21 -04:00
Ken Moore
f1c3651ba5
API CHANGE: sysadm/iocage - "action"="listplugins"
...
Add this API call to list all the available plugins for iocage.
REST Request (example):
-------------------------------
PUT /sysadm/iocage
{
"action" : "listplugins"
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"args" : {
"action" : "listplugins"
},
"name" : "iocage",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"listplugins": {
"remote": {
"btsync": {
"description": "Resilient, fast and scalable file sync software for enterprises and individuals.",
"id": "btsync",
"name": "BitTorrent Sync"
},
"couchpotato": {
"description": "CouchPotato is an automatic NZB and torrent downloader.",
"id": "couchpotato",
"name": "CouchPotato"
},
"crashplan": {
"description": "Computer backup and data storage made simple.",
"id": "crashplan",
"name": "Crashplan"
},
"deluge": {
"description": "Bittorrent client using Python, and libtorrent-rasterbar",
"id": "deluge",
"name": "Deluge"
},
"emby": {
"description": "Home media server built using mono and other open source technologies",
"id": "emby",
"name": "Emby"
},
"gitlab": {
"description": "Powerful features for modern software development",
"id": "gitlab",
"name": "GitLab"
},
"jenkins": {
"description": "Jenkins CI",
"id": "jenkins",
"name": "Jenkins"
},
"jenkins-lts": {
"description": "Jenkins CI (Long Term Support Version)",
"id": "jenkins-lts",
"name": "Jenkins (LTS)"
},
"madsonic": {
"description": "Open-source web-based media streamer and jukebox.",
"id": "madsonic",
"name": "MadSonic"
},
"nextcloud": {
"description": "Access, share and protect your files, calendars, contacts, communication & more at home and in your enterprise.",
"id": "nextcloud",
"name": "NextCloud"
},
"plexmediaserver": {
"description": "The Plex media server system",
"id": "plexmediaserver",
"name": "Plex Media Server"
},
"plexmediaserver-plexpass": {
"description": "The Plex media server system",
"id": "plexmediaserver-plexpass",
"name": "Plex Media Server (PlexPass)"
},
"quasselcore": {
"description": "Quassel Core is a daemon/headless IRC client, part of Quassel, that supports 24/7 connectivity. Quassel Client can be attached to it to.",
"id": "quasselcore",
"name": "Quasselcore"
},
"sickrage": {
"description": "Automatic Video Library Manager for TV Shows",
"id": "sickrage",
"name": "SickRage"
},
"sonarr": {
"description": "PVR for Usenet and BitTorrent users",
"id": "sonarr",
"name": "Sonarr"
},
"subsonic": {
"description": "Open-source web-based media streamer and jukebox.",
"id": "subsonic",
"name": "SubSonic"
},
"syncthing": {
"description": "Personal cloud sync",
"id": "syncthing",
"name": "Syncthing"
},
"transmission": {
"description": "Fast and lightweight daemon BitTorrent client",
"id": "transmission",
"name": "Transmission"
}
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
Changelog: yes
2017-05-31 14:19:10 -04:00
Ken Moore
b446bef363
Update some more of the iocage API backend. These changes not tied to front-facing API calls yet.
2017-02-17 13:03:18 -05:00
Ken Moore
9cb26f211e
API CHANGE:
...
Re-enable the sysadm/iocage "deactivatepool" API call.
Description: This will deactivate a ZFS pool from being used by iocage (may result in loss of data regarding iocage-created jails).
Required arguments: "pool" = "zfs pool to deactivate"
-----------
REST Request (example):
-------------------------------
PUT /sysadm/iocage
{
"pool" : "tank1",
"action" : "deactivatepool"
}
WebSocket Request:
-------------------------------
{
"name" : "iocage",
"args" : {
"action" : "deactivatepool",
"pool" : "tank1"
},
"id" : "fooid",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"deactivatepool": {
"success": "pool tank1 deactivated."
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-02-17 11:55:31 -05:00
Ken Moore
2047491544
API CHANGE:
...
Re-enable the sysadm/iocage "activatepool" API call:
Description: This will activate a specific ZFS pool so iocage can use it.
Required arguments: "pool" = "name of ZFS pool to activate"
------------------
REST Request (example):
-------------------------------
PUT /sysadm/iocage
{
"action" : "activatepool",
"pool" : "tank1"
}
WebSocket Request:
-------------------------------
{
"name" : "iocage",
"args" : {
"pool" : "tank1",
"action" : "activatepool"
},
"id" : "fooid",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"activatepool": {
"success": "pool tank1 activated."
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-02-17 11:49:14 -05:00
Ken Moore
4fe277350a
API CHANGE:
...
De-activate the entire sysadm/iocage class of API calls. There is enough changes in the move to the new version of iocage, and the old API class was disused enough, that it is probably best to just scrap it and start from scratch.
I will start re-enabling the individual API calls one per commit tomorrow probably (backend changes getting close to being finished).
Also finish of the conversion of a bunch more backend funtions to work with the new version of iocage.
2017-02-16 14:28:49 -05:00
Ken Moore
8d479b4061
Another large batch of work on the new sysadm/iocage API backend. Not yet attached to API calls yet.
2017-02-16 12:21:48 -05:00
Ken Moore
f7d5e99010
API Change:
...
Remove the sysadm/iocage "getdefaultsettings" action from the available API calls. This action is not longer supported by the newer version of iocage.
2017-02-14 09:46:36 -05:00
Kris Moore
4c118796dc
Merge branch 'master' of http://github.com/trueos/sysadm
2017-02-13 16:19:39 -05:00
Kris Moore
487e9d7655
Fix iocage detection
2017-02-13 16:19:27 -05:00
Ken Moore
de9b9af3c0
API CHANGE: New class - sysadm/powerd
...
This is a class for managing the "powerd" service on the system.
Available "action"s:
"list_options": List all the available options and possible settings for each.
"read_options": Show all the current settings.
"set_options": Modify any settings.
"list_status": List the current state of the service (running, enabled)
"set_active": Enable this device for starting on bootup.
"set_inactive": Disable this device from starting on bootup.
"start": Start this service now.
"stop": Stop this service now.
Example API Calls:
==================
REST Request (example):
-------------------------------
PUT /sysadm/powerd
{
"action" : "list_options"
}
WebSocket Request:
-------------------------------
{
"name" : "powerd",
"namespace" : "sysadm",
"args" : {
"action" : "list_options"
},
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"list_options": {
"ac_power_mode": [
"maximum",
"hiadaptive",
"adaptive",
"minumum"
],
"adaptive_lower_threshold_percent": "int min=1 max=100",
"adaptive_raise_threshold_percent": "int min=1 max=100",
"battery_power_mode": [
"maximum",
"hiadaptive",
"adaptive",
"minumum"
],
"max_cpu_freq": "int frequency(hz)>0",
"min_cpu_freq": "int frequency(hz)>0",
"polling_interval_ms": "int milliseconds>0",
"unknown_power_mode": [
"maximum",
"hiadaptive",
"adaptive",
"minumum"
]
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
===============================
REST Request (example):
-------------------------------
PUT /sysadm/powerd
{
"action" : "read_options"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"name" : "powerd",
"args" : {
"action" : "read_options"
},
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"read_options": {
"ac_power_mode": "maximum",
"adaptive_lower_threshold_percent": "50",
"adaptive_raise_threshold_percent": "75",
"battery_power_mode": "adaptive",
"max_cpu_freq": "-1",
"min_cpu_freq": "-1",
"polling_interval_ms": "250",
"unknown_power_mode": "adaptive"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
===========================
REST Request (example):
-------------------------------
PUT /sysadm/powerd
{
"action" : "list_status"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"name" : "powerd",
"namespace" : "sysadm",
"args" : {
"action" : "list_status"
}
}
Response:
-------------------------------
{
"args": {
"list_status": {
"enabled": "true",
"running": "true"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
===================
REST Request (example):
-------------------------------
PUT /sysadm/powerd
{
"action" : "stop"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "stop"
},
"id" : "fooid",
"namespace" : "sysadm",
"name" : "powerd"
}
Response:
-------------------------------
{
"args": {
"stop": {
"stopped": "true"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
==================
REST Request (example):
-------------------------------
PUT /sysadm/powerd
{
"battery_power_mode" : "minimum",
"action" : "set_options"
}
WebSocket Request:
-------------------------------
{
"name" : "powerd",
"args" : {
"action" : "set_options",
"battery_power_mode" : "minimum"
},
"id" : "fooid",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"set_options": {
"ac_power_mode": "maximum",
"adaptive_lower_threshold_percent": "50",
"adaptive_raise_threshold_percent": "75",
"battery_power_mode": "minimum",
"max_cpu_freq": "-1",
"min_cpu_freq": "-1",
"polling_interval_ms": "250",
"unknown_power_mode": "adaptive"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-02-07 12:34:33 -05:00
Ken Moore
26557e3756
API CHANGE (new action)
...
sysadm/moused, "action"="set_device_active" : This will enable/activate a device so that it can be used.
REQUIRED ARGUMENTS: "device":"<device_id>"
-------------
REST Request (example):
-------------------------------
PUT /sysadm/moused
{
"device" : "ums0",
"action" : "set_device_active"
}
WebSocket Request:
-------------------------------
{
"args" : {
"device" : "ums0",
"action" : "set_device_active"
},
"namespace" : "sysadm",
"name" : "moused",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"set_device_active": {
"started": "ums0"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-01-19 08:54:48 -05:00
Ken Moore
7ca9766234
API CHANGE (new action)
...
sysadm/moused, "action" = "set_device_inactive" : Turn off a mouse device
REQUIRED ARGUMENTS: "device":"<device id>"
--------------
REST Request (example):
-------------------------------
PUT /sysadm/moused
{
"device" : "ums0",
"action" : "set_device_inactive"
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"args" : {
"action" : "set_device_inactive",
"device" : "ums0"
},
"name" : "moused",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"set_device_inactive": {
"stopped": "ums0"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-01-19 08:49:07 -05:00
Ken Moore
be87daf81d
API CHANGE (new action):
...
sysadm/moused, "action"="list_devices_active": This will return a list of all the devices which are currently active.
-------------
REST Request (example):
-------------------------------
PUT /sysadm/moused
{
"action" : "list_devices_active"
}
WebSocket Request:
-------------------------------
{
"name" : "moused",
"namespace" : "sysadm",
"id" : "fooid",
"args" : {
"action" : "list_devices_active"
}
}
Response:
-------------------------------
{
"args": {
"list_devices_active": {
"active_devices": [
"ums0"
]
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-01-19 08:35:16 -05:00
Ken Moore
238af76dbd
API Change (new action):
...
New "action" for the sysadm/moused class:
"set_device_options" - Change the options for a particular device.
REQUIRED ARGUMENTS: "device":"<device_id>", and at least 1 of the available options for device configuration (multiple options may be changed in a single API request).
------------
REST Request (example):
-------------------------------
PUT /sysadm/moused
{
"accel_exponential" : "1.5",
"action" : "set_device_options",
"device" : "psm0"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"name" : "moused",
"args" : {
"accel_exponential" : "1.5",
"device" : "psm0",
"action" : "set_device_options"
}
}
Response:
-------------------------------
{
"args": {
"set_device_options": {
"accel_exponential": "1.5",
"accel_linear": "1.0",
"device": "psm0",
"emulate_button_3": "false",
"hand_mode": "right",
"resolution": "medium-low",
"terminate_drift_threshold_pixels": "0",
"virtual_scrolling": "false"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-01-18 16:24:31 -05:00
Ken Moore
47d5c73dba
API Change (new "action"):
...
New Action for the sysadm/moused class:
"read_device_options" - This will list all the current settings for a given device.
REQUIRED ARGUMENTS: "device":"<device_id>"
----------------
REST Request (example):
-------------------------------
PUT /sysadm/moused
{
"device" : "psm0",
"action" : "read_device_options"
}
WebSocket Request:
-------------------------------
{
"name" : "moused",
"id" : "fooid",
"namespace" : "sysadm",
"args" : {
"action" : "read_device_options",
"device" : "psm0"
}
}
Response:
-------------------------------
{
"args": {
"read_device_options": {
"accel_exponential": "1.0",
"accel_linear": "1.0",
"device": "psm0",
"emulate_button_3": "false",
"hand_mode": "right",
"resolution": "medium-low",
"terminate_drift_threshold_pixels": "0",
"virtual_scrolling": "false"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-01-18 16:16:52 -05:00
Ken Moore
c876af3cc3
API Change: (sysadm/moused - new "action")
...
New Action: "list_device_options" - This will list all the per-device options which can be changed, with lists of possible settings or a description of the setting type that can be used.
----------
REST Request (example):
-------------------------------
PUT /sysadm/moused
{
"action" : "list_device_options"
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"name" : "moused",
"args" : {
"action" : "list_device_options"
},
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"list_device_options": {
"accel_exponential": "float min=1.0 max=2.0",
"accel_linear": "float min=0.01 max=100.00",
"emulate_button_3": [
"true",
"false"
],
"hand_mode": [
"left",
"right"
],
"resolution": [
"low",
"medium-low",
"medium-high",
"high"
],
"terminate_drift_threshold_pixels": "int min=0 max=1000",
"virtual_scrolling": [
"true",
"false"
]
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-01-18 16:07:32 -05:00
Ken Moore
d1cfc02465
API Change (New Class: sysadm/moused)
...
Add a new class: sysadm/moused
This class handles all the settings for the moused daemon on the system and provides per-device input device management.
First API "action":
"list_devices": This will list all the devices detected on the system with relevant information about them.
----------------
REST Request (example):
-------------------------------
PUT /sysadm/moused
{
"action" : "list_devices"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"name" : "moused",
"args" : {
"action" : "list_devices"
}
}
Response:
-------------------------------
{
"args": {
"list_devices": {
"psm0": {
"description": "PS/2 Mouse",
"device": "psm0",
"driver": "psm",
"parent": "atkbdc0"
},
"ums0": {
"description": "YSTEK G Mouse, class 0/0, rev 1.10/0.01, addr 1",
"device": "ums0",
"driver": "ums",
"parent": "uhub1"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-01-18 16:03:00 -05: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
c9f227eebc
API CHANGE: last sysadm/firewall action
...
Final action for the sysadm/firewall class: "action" = "reset-defaults"
This will reset all the firewall settings back to defaults and restart the firewall.
NOTE: This will only work on TrueOS - plain FreeBSD does not have any concept of default firewall settings and this API call will return an error in that case.
REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
"action" : "reset-defaults"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"args" : {
"action" : "reset-defaults"
},
"namespace" : "sysadm",
"name" : "firewall"
}
Response:
-------------------------------
{
"args": {
"result": "success"
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-09-13 08:07:31 -04:00
Ken Moore
c089525bf7
API CHANGE: 5 simple "actions" for sysadm/firewall
...
Add five new "actions" for managing the firewall:
"start" - turn on the firewall
"stop" - turn off the firewall
"restart" - reload the firewall (catches any settings changes - not generally needed)
"enable" - automatically start the firewall on bootup
"disable" - do not start the firewall on bootup
They all use the same input/output syntax, just the "action" input field is different
REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
"action" : "restart"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"args" : {
"action" : "restart"
},
"namespace" : "sysadm",
"name" : "firewall"
}
Response:
-------------------------------
{
"args": {
"result": "success"
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-09-13 07:39:27 -04:00
Ken Moore
aca7bbc7b0
API CHANGE: new action for sysadm/firewall
...
"action":"close"
REQUIRED: "ports":["<number>/<type>", "<number2>"/"<type2>"]
This will close the designated ports in the firewall
REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
"action" : "close",
"ports" : [
"12151/tcp"
]
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"name" : "firewall",
"args" : {
"ports" : [
"12151/tcp"
],
"action" : "close"
}
}
Response:
-------------------------------
{
"args": {
"result": "success"
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-09-12 15:52:56 -04:00
Ken Moore
ed3296eaf3
API CHANGE: New action for sysadm/firewall
...
"action":"open"
REQUIRES: "ports":[<number>/<type>, <number2>/<type2>]
REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
"action" : "open",
"ports" : [
"12151/tcp"
]
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"name" : "firewall",
"args" : {
"ports" : [
"12151/tcp"
],
"action" : "open"
},
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"result": "success"
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-09-12 15:47:54 -04:00
Ken Moore
108a2da675
API CHANGE: New action for sysadm/firewall
...
"action":"status"
Returns the current status of the firewall
REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
"action" : "status"
}
WebSocket Request:
-------------------------------
{
"name" : "firewall",
"args" : {
"action" : "status"
},
"id" : "fooid",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"is_enabled": "true",
"is_running": "true"
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-09-12 15:29:24 -04:00
Ken Moore
6b348c3940
API CHANGE:
...
Add a new "action" for the new sysadm/firewall class:
"action":"list_open"
Returns an array of all the open port/type combinations for the firewall.
REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
"action" : "list_open"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "list_open"
},
"id" : "fooid",
"name" : "firewall",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"openports": [
"5353/udp"
]
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-09-12 15:21:02 -04:00
Ken Moore
45bb83a05f
API CHANGE:
...
Add a new class to sysadm: sysadm/firewall
This is the new firewall manager (ipfw), for setting options for the system firewall.
Initial API Call: "action":"known_ports"
This will return a list of all known ports and any names/descriptions for them (this is a static list - it does not reflect which ports are in-use or opened on the system. It is just for matching a port to a name/description)
REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
"action" : "known_ports"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"args" : {
"action" : "known_ports"
},
"name" : "firewall"
}
Response:
-------------------------------
{
"args": {
"1/tcp": {
"description": "#TCP Port Service Multiplexer",
"name": "tcpmux",
"port": "1/tcp"
},
"1/udp": {
"description": "#TCP Port Service Multiplexer",
"name": "tcpmux",
"port": "1/udp"
},
"100/tcp": {
"description": "#[unauthorized use]",
"name": "newacct",
"port": "100/tcp"
}
}
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-09-12 13:18:32 -04:00
Ken Moore
75f21cfe1b
API CHANGE
...
Last round of new "action"s for the sysadm/services class,
"action":"[enable/disable]"
Required input arguments:
"services":["service1","service2","etc"]
Exactly the same syntax as the start/stop/restart API calls, just a different action and the output field is "services_[enabled/disabled]" as well.
2016-08-30 14:22:33 -04:00
Ken Moore
0408f61f4c
API CHANGE
...
Add the "is_running" output field to the sysadm/services "list_services" output.
This also cleans up the is_enabled detection routine so it should be more reliable.
2016-08-30 13:32:53 -04:00
Ken Moore
8a594044bb
API CHANGE
...
Add 3 new API calls (all almost the same - just different "actions" and the return message will be slightly different)
"action":"start" OR "stop" OR "restart"
This will [start/stop/restart] services on the system.
REQUIRED ARGUMENTS:
"services" : <string with a single service, or array of services>
EXAMPLE "start" command (change "services_started" in responce to "services_[started/stopped/restarted]" as needed to match the action:
REST Request (example):
-------------------------------
PUT /sysadm/services
{
"action" : "start",
"services" : [
"cupsd"
]
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "start",
"services" : [
"cupsd"
]
},
"name" : "services",
"id" : "fooid",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"services_started": [
"cupsd"
]
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-08-30 11:27:51 -04:00
Kris Moore
cd959daa3f
Ken missed a }
2016-08-29 22:54:04 -04:00
Ken Moore
ce86331f1e
Clean up the new sysadm/services class just a bit more. Getting ready to add all the start/stop/restart API calls.
2016-08-29 16:09:30 -04:00
Ken Moore
2f7bfe06aa
API CHANGE
...
Modify the output fields for the sysadm/services, "list_services" action:
Now each service entry will look like this:
"accounting": {
"description": "",
"is_enabled": "false",
"name": "accounting",
"path": "/etc/rc.d/accounting",
"tag": "accounting_enable"
}
I will probably be adding an "is_running" [true/false] field here soon as well - the backend for that still needs to be written first.
2016-08-29 14:09:20 -04:00
Ken Moore
1bf0ec425f
API CHANGE
...
Add a new API class/call to sysadm:
namespace: sysadm
name: services
This class is for managing all the background daemons on the system.
Initial API call:
args : {"action" : "list_services" }
This will return a list of all services available on the system.
*Note: return message shortened for example purposes - there are usually tons of services available
REST Request (example):
-------------------------------
PUT /sysadm/services
{
"action" : "list_services"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "list_services"
},
"id" : "fooid",
"namespace" : "sysadm",
"name" : "services"
}
Response:
-------------------------------
{
"args": {
"services": {
"accounting": {
"name": "accounting",
"tag": "accounting_enable"
},
"addswap": {
"name": "addswap",
"tag": "addswap_enable"
},
"amd": {
"name": "amd",
"tag": "amd_enable"
},
"apm": {
"name": "apm",
"tag": "apm_enable"
},
"apmd": {
"name": "apmd",
"tag": "apmd_enable"
},
"atm": {
"name": "atm",
"tag": "atm_enable"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-08-29 11:41:15 -04:00
Ken Moore
1fd947f5b4
API CHANGE:
...
Add a new action to the sysadm/users class: "groupmod"
This action allows for modifying a given group on the system
REQUIRED: "name"="<name of group to modify>"
and any one of these options is also required:
"users":["array of users"] (will set the list of users for this group)
"add_users":["array of users"] (will add the listed users to the current users)
"remove_users":["array of users"] (will remove the listed users from the current users)
Example API Request (JSON)
{
"id":"sample",
"namespace":"sysadm",
"name":"users",
"args":{
"action":"groupmod",
"name":"operator",
"users":["user1","user2"]
}
}
2016-08-17 12:15:48 -04:00
Ken Moore
216ca5a9f2
Oops - fix a true/false reversal in the sysadm/users "userdelete" "clean_home" optional argument.
2016-08-16 09:32:14 -04:00
Ken Moore
dac91284c8
API CHANGE
...
Add a new option to the sysadm/users class:
"action":"groupdelete"
"name":"groupToDelete"
Returns:
"args"{ "result":"success" } on success action
2016-08-11 10:01:21 -04:00
Ken Moore
373a28c4f5
API CHANGE
...
Add a new optional input argument to the sysadm/updates, "checkupdates" action:
"force":"[true/false]" (default is false)
This tells the check system to skip all previous checks for updates and re-run the update routines to look for new updates (if force==true), otherwise it might return the previous result of the update check if not enough time has passed since the other check.
2016-08-10 11:51:22 -04:00
Ken Moore
a2bba87315
API CHANGE
...
Add a new API call to the sysadm/update class:
"action":"changesettings"
This allows for changing the various updatemanager settings (maxbe, package_set, package_url, auto_update)
REST Request (example):
-------------------------------
PUT /sysadm/update
{
"action" : "changesettings",
"maxbe" : "6"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"name" : "update",
"namespace" : "sysadm",
"args" : {
"maxbe" : "6",
"action" : "changesettings"
}
}
Response:
-------------------------------
{
"args": {
"changesettings": {
"result": "success"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-08-09 13:22:46 -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
4a260b66e2
API CHANGE
...
Add a "groupadd" action to the sysadm/users class.
This will create a new group on the system
REQUIRED: "name"
OPTIONAL: "gid","users"
REST Request (example):
-------------------------------
PUT /sysadm/users
{
"action" : "groupadd",
"name" : "testgroup"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"args" : {
"action" : "groupadd",
"name" : "testgroup"
},
"name" : "users"
}
Response:
-------------------------------
{
"args": {
"result": "success"
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-07-28 16:11:35 -04:00