Added subsections to section 3: dispatcher, life preserver, and system state.
Added examples of dispatcher messaging to parts of section 4: Classes.
Added further examples of messaging to section 3 in the subsections.
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"
}