Move over the API docs from pcbsd repo

This commit is contained in:
Kris Moore
2015-12-08 14:44:47 -05:00
parent d542ba201d
commit 611b5f45cc
15 changed files with 1474 additions and 0 deletions

154
api/Makefile Normal file
View File

@@ -0,0 +1,154 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/FreeNAS.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/FreeNAS.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/FreeNAS"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/FreeNAS"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

View File

@@ -0,0 +1,7 @@
.. _bootenvironments:
bootenvironments
================
Some intro text here...

7
api/classes/disk.rst Normal file
View File

@@ -0,0 +1,7 @@
.. _disk:
disk
====
Some intro text here...

8
api/classes/index.rst Normal file
View File

@@ -0,0 +1,8 @@
=========
Classes
=========
.. toctree::
:glob:
*

7
api/classes/iocage.rst Normal file
View File

@@ -0,0 +1,7 @@
.. _iocage:
iocage
======
Some intro text here...

View File

@@ -0,0 +1,6 @@
.. _lifepreserver:
lifepreserver
=============
Some intro text here...

427
api/classes/network.rst Normal file
View File

@@ -0,0 +1,427 @@
.. _network:
network
*******
The network class is used to manage and retrieve information from Ethernet and wireless network devices.
Every network class request contains the following parameters:
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| **Parameter** | **Value** | **Description** |
| | | |
+=================================+===============+======================================================================================================================+
| id | | any unique value for the request; examples include a hash, checksum, or uuid |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| name | sysadm | |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| namespace | rpc | |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| args | | values vary by type of request |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
The rest of this section provides examples of the available *args* for each type of request, along with their responses.
.. _Network Devices:
Network Devices
===============
The requests in this section work for both Ethernet and wireless devices. When specifying the *nic*, use the FreeBSD Ethernet device name, or
*wlan#* for wireless devices (where
*#* is the wireless device number).
.. _Get Interface Information:
Get Interface Information
-------------------------
**Request**
.. code-block:: json
{
"id": "someUniqueID",
"name": "sysadm",
"namespace": "rpc",
"args": {
"getNicSettings": {
nic: "em0"
}
}
}
**Response**
.. code-block:: json
{
"id": "someUniqueID",
"name": "response",
"namespace": "rpc",
"args": {
"getNicSettings": {
nic: "em0",
nic_desc: "Intel(R) Pro/100 Connection 7.4.2",
nic_mac: "<foo>"
nic_status: "active"
nic_media: "1000baseT <full-duplex>",
is_wired: true,
ip4_addr: "192.168.0.50",
ip4_netmask: "255.255.255.0",
ip4_dhcp: false,
ip6_addr: "<foo>",
ip6_auto: false,
}
}
}
.. _Set Interface Configuration:
Set Interface Configuration
---------------------------
**Request**
.. code-block:: json
{
"id": "someUniqueID",
"name": "sysadm",
"namespace": "rpc",
"args": {
"saveNicSettings": {
nic: "em0",
nic_mac: "<foo>"
ip4_addr: "192.168.0.50",
ip4_netmask: "255.255.255.0",
ip4_dhcp: false,
ip6_addr: "<foo>",
ip6_auto: false
}
}
}
**Response**
.. code-block:: json
{
"id": "someUniqueID",
"name": "response",
"namespace": "rpc",
"args": {
"setNicSettings": {
nic: "em0",
nic_desc: "Intel(R) Pro/100 Connection 7.4.2",
nic_mac: "<foo>"
nic_status: "active"
nic_media: "1000baseT <full-duplex>",
is_wired: true,
ip4_addr: "192.168.0.50",
ip4_netmask: "255.255.255.0",
ip4_dhcp: false,
ip6_addr: "<foo>",
ip6_auto: false,
}
}
}
.. _Get System Network Configuration:
Get System Network Configuration
--------------------------------
**Request**
.. code-block:: json
{
"id": "someUniqueID",
"name": "sysadm",
"namespace": "rpc",
"args": {
"getSystemNetworkConfig": ""
}
}
**Response**
.. code-block:: json
{
"id": "someUniqueID",
"name": "response",
"namespace": "rpc",
"args": {
"getSystemNetworkConfig": {
ip4_gateway: "192.168.0.1",
ip4_dns1: "208.26.222.222",
ip4_dns2: "8.8.8.8",
ip6_gateway: "",
ip6_dns1: "",
ip6_dns2: "",
domain: "example.org",
hostname: "mydesktop"
proxy: false,
proxy_addr: "fooproxy.org",
proxy_port: 8080
proxy_type: "(basic/digest)"
proxy_user: "myusername",
proxy_pass: "mypass"
}
}
}
.. _Set System Network Configuration:
Set System Network Configuration
--------------------------------
**Request**
.. code-block:: json
{
"id": "someUniqueID",
"name": "sysadm",
"namespace": "rpc",
"args": {
"setSystemNetworkConfig": {
ip4_gateway: "192.168.0.1",
ip4_dns1: "208.26.222.222",
ip4_dns2: "8.8.8.8",
ip6_gateway: "",
ip6_dns1: "",
ip6_dns2: "",
domain: "example.org",
hostname: "mydesktop"
proxy: false,
proxy_addr: "fooproxy.org",
proxy_port: 8080
proxy_type: "(basic/digest)"
proxy_user: "myusername",
proxy_pass: "mypass"
}
}
}
**Response**
.. code-block:: json
{
"id": "someUniqueID",
"name": "response",
"namespace": "rpc",
"args": {
"setSystemNetworkConfig": {
ip4_gateway: "192.168.0.1",
ip4_dns1: "208.26.222.222",
ip4_dns2: "8.8.8.8",
ip6_gateway: "",
ip6_dns1: "",
ip6_dns2: "",
domain: "example.org",
hostname: "mydesktop"
proxy: false,
proxy_addr: "fooproxy.org",
proxy_port: 8080
proxy_type: "(basic/digest)"
proxy_user: "myusername",
proxy_pass: "mypass"
}
}
}
.. _Wireless Settings:
Wireless Settings
=================
This section describes the additional requests available for wireless devices.
.. _List Available APs:
List Available APs
------------------
**Request**
.. code-block:: json
{
"id": "someUniqueID",
"name": "sysadm",
"namespace": "rpc",
"args": {
"getWifiAPs": {
}
}
}
**Response**
.. code-block:: json
{
"id": "someUniqueID",
"name": "response",
"namespace": "rpc",
"args": {
"getWifiAPs": {
"myap": {
ssid: "myap",
bssid: "",
security: "(wep|wpa|wpae)",
key: ""
},
"workap": {
ssid: "workap",
bssid: "",
security: "(wep|wpa|wpae)",
key: ""
},
}
}
}
.. _List APs Within Range:
List APs Within Range
---------------------
**Request**
.. code-block:: json
{
"id": "someUniqueID",
"name": "sysadm",
"namespace": "rpc",
"args": {
"scanWifiAPs": {
}
}
}
**Response**
.. code-block:: json
{
"id": "someUniqueID",
"name": "response",
"namespace": "rpc",
"args": {
"scanWifiAPs": {
"myap": {
ssid: "myap",
bssid: "",
security: "(wep|wpa|wpae)",
rate: "",
signoise: "",
caps: "",
channel: "",
inte: "",
caps: "",
},
"workap": {
ssid: "workap",
bssid: "",
security: "(wep|wpa|wpae)",
rate: "",
signoise: "",
caps: "",
channel: "",
inte: "",
caps: "",
},
}
}
}
.. _Connect to Specified AP:
Connect to Specified AP
-----------------------
**Request**
.. code-block:: json
{
"id": "someUniqueID",
"name": "sysadm",
"namespace": "rpc",
"args": {
"addWifiAP": {
ssid: "myap",
bssid: "",
security: "(wep|wpa|wpae)",
key: "mywifikey",
wephex: false
}
}
}
**Response**
.. code-block:: json
{
"id": "someUniqueID",
"name": "response",
"namespace": "rpc",
"args": {
"addWifiAP": {
ssid: "myap",
bssid: "",
security: "(wep|wpa|wpae)",
key: "mywifikey",
wephex: false
}
}
}
.. _Remove Specified AP:
Remove Specified AP
-------------------
**Request**
.. code-block:: json
{
"id": "someUniqueID",
"name": "sysadm",
"namespace": "rpc",
"args": {
"delWifiAP": {
ssid: "myap",
bssid: ""
}
}
}
**Response**
.. code-block:: json
{
"id": "someUniqueID",
"name": "response",
"namespace": "rpc",
"args": {
"delWifiAP": {
ssid: "myap",
bssid: ""
}
}
}

429
api/classes/packages.rst Normal file
View File

@@ -0,0 +1,429 @@
========
packages
========
Resources related to the packages class.
webclient
---------
The webclient resource is used to...
For up-to-date request options, use :command:`help [pkg | pbi | jail | search]` to query the syscache daemon for the available options for the specified parameter. This section covers most
of the common queries and replies.
.. _note: whenever *<jail>* is used in a query, it can be replaced by
*#system* to probe the local system or by a jail ID for to specify a particular jail on the system.
Event Notifications
+++++++++++++++++++
The client may subscribe to per-connection event notifications.
**JSON Request: Subscribe to Dispatcher Events**
.. code-block:: json
{
"namespace" : "events",
"name" : "subscribe",
"id" : "sampleID",
"args" : ["dispatcher"]
}
**JSON Request: Unsubscribe to Dispatcher Events**
.. code-block:: json
{
"namespace" : "events",
"name" : "unsubscribe",
"id" : "sampleID",
"args" : ["dispatcher"]
}
**JSON Reply: Dispatcher Event Occured**
.. code-block:: json
{
"namespace" : "events",
"name" : "event",
"id" : "",
"args" : {
"name" : "dispatcher",
"args" : "<message"
}
}
Dispatcher Usage
++++++++++++++++
**JSON flags for Dispatcher Interaction**
.. code-block:: json
"namespace": "rpc"
"name": "dispatcher"
Usage (possible "args"):
--------------------------------
iocage {cmd} [args]
queue {pkg|pbi} {origin} {install/delete/info} {__system__|<jailname>}
pkgupdate {__system__|<jailname>}
service {start|stop|restart} {servicetag} {servicerc} {__system__|<jid>}
getcfg {pbicdir} {__system__|<jid>} {key}
setcfg {pbicdir} {__system__|<jid>} {key} {value}
donecfg {pbicdir} {__system__|<jid>}
daemon
status
results
log {hash}
General syscache Information
++++++++++++++++++++++++++++
For a query of the syscache information daemon, the *"name"* field of the input JSON object needs to be set to
*"syscache"*.
The *"app-summary"* and
*"cage-summary"* options are specifically designed for getting enough information for lots of small app icons in fewer syscache requests.
The *"app-summary"* return array is:
*[pkg origin, name, version, icon path, rating (out of 5), type, comment, config dir, isInstalled, canRemove]*.
The *"cage-summary"* return array is:
*[origin, name, icon, architecture, FreeBSD version]*.
**Possible Input Queries for General System Information**
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| **Query** | **Value** | **Description** |
| | | |
+=================================+===============+======================================================================================================================+
| startsync | | Manually start a system information sync (usually unnecessary) |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| needsreboot | [true/false] | Check if the system needs to reboot to finish updates |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| isupdating | [true/false] | Check if the system is currently performing updates |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| hasupdates | [true/false] | Check if system updates are available |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| updatelog | | Raw text output from the check for system updates |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| hasmajorupdates | [true/false] | Check if FreeBSD system updates are available |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| majorupdatelog | | Details about the major update(s) |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| hassecurityupdates | [true/false] | Check if FreeBSD security updates are available |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| securityupdatelog | | Details about any security update(s) |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| haspcbsdupdates | [true/false] | Check if any PC-BSD hotfixes are available |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| pcbsdupdatelog | | Details about any PC-BSD hotfixes |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| <jail> app-summary <pkg origin> | | Summary of information for an application |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| cage-summary <origin> | | Summary of information for a PBI cage |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
**Example JSON Request**
.. code-block:: json
{
"namespace" : "rpc",
"name" : "syscache",
"id" : "someUniqueID",
"args" : ["needsreboot", "hasupdates", "updatelog", "#system app-summary mail/thunderbird", "cage-summary multimedia/plexmediaserver"]
}
**Example JSON Reply**
.. code-block:: json
{
"args": {
"#system app-summary mail/thunderbird": [
"mail/thunderbird",
"Thunderbird",
"38.2.0_1",
"/var/db/pbi/index/mail/thunderbird/icon.png",
"5.00",
"Graphical",
"Mozilla Thunderbird is standalone mail and news that stands above ",
"/var/db/pbi/index/mail/thunderbird",
"true",
"true"
],
"cage-summary multimedia/plexmediaserver": [
"multimedia/plexmediaserver",
"Plex Media Server",
"/var/db/pbi/cage-index/multimedia/plexmediaserver/icon.png",
"amd64",
"10.1-RELEASE"
],
"hasupdates": "false",
"needsreboot": "false",
"updatelog": "Checking for FreeBSD updates...<br>Your system is up to date!"
},
"id": "someUniqueID",
"name": "response",
"namespace": "rpc"
}
PBI Database Queries
++++++++++++++++++++
The following type of queries are supported:
* **List Queries:** "pbi list <info>" where <info> can be: "[all/server/graphical/text]apps", "[all/server/graphical/text]cats", or "cages"
* **App Queries:** "pbi app <pkg origin> <info>" where <info> can be: "author", "category", "confdir", "dependencies", "origin", "plugins, "rating", "relatedapps", "screenshots", "type",
"tags", "comment", "description", "license", "maintainer", "name", "options", or "website"
* **Cage Queries:** "pbi cage <origin> <info>" where <info> can be: "icon", "name", "description", "arch" fbsdver", "git", "gitbranch", "screenshots", "tags", "website"
* **Category Queries:** "pbi cat <pkg category> <info>"
**Example JSON Query**
.. code-block:: json
{
"namespace" : "rpc",
"name" : "syscache",
"id" : "someUniqueID",
"args" : ["pbi list graphicalapps", "pbi list cages", "pbi app www/firefox author", "pbi app www/firefox category", "pbi list graphicalcats" ]
}
**Example JSON Reply**
.. code-block:: json
{
"args": {
"pbi app www/firefox author": "Mozilla",
"pbi app www/firefox category": "Web",
"pbi list cages": [
"archivers/elephantdrive",
"multimedia/plexmediaserver"
],
"pbi list graphicalapps": [
"math/R",
"www/WebMagick",
"editors/abiword",
"audio/abraca",
(SHORTENED FOR BREVITY - THIS IS USUALLY QUITE LONG)
"x11/zenity",
"security/zenmap",
"games/zephulor",
"www/zope213"
],
"pbi list graphicalcats": [
"accessibility",
"archivers",
"astro",
"audio",
(SHORTENED FOR BREVITY - THIS IS USUALLY QUITE LONG)
"x11-themes",
"x11-toolkits",
"x11-wm"
]
},
"id": "someUniqueID",
"name": "response",
"namespace": "rpc"
}
PBI Category Information Retrieval
++++++++++++++++++++++++++++++++++
**JSON Query**
.. code-block:: json
{
"namespace" : "rpc",
"name" : "syscache",
"id" : "someUniqueID",
"args" : ["pbi cat www name", "pbi cat www icon", "pbi cat www comment", "pbi cat www origin" ]
}
**JSON Reply**
.. code-block:: json
{
"args": {
"pbi cat www comment": "Web browsers, and other applications used for the web such as RSS readers",
"pbi cat www icon": "/var/db/pbi/index/PBI-cat-icons/www.png",
"pbi cat www name": "Web",
"pbi cat www origin": "www"
},
"id": "someUniqueID",
"name": "response",
"namespace": "rpc"
}
PBI Cage Examples
+++++++++++++++++
DB Request format: "pbi cage <origin> <info>"
Possible <info>: "icon", "name", "description", "arch", "fbsdver", "git", "gitbranch", "screenshots", "tags", "website"
**JSON Query**
.. code-block:: json
{
"namespace" : "rpc",
"name" : "syscache",
"id" : "someUniqueID",
"args" : ["pbi cage multimedia/plexmediaserver tags", "pbi cage multimedia/plexmediaserver website", "pbi cage multimedia/plexmediaserver description", "pbi cage multimedia/plexmediaserver name"]
}
**JSON Reply**
.. code-block:: json
{
"args": {
"pbi cage multimedia/plexmediaserver description": "Plex stores all of your audio, video, and photo files in your free Plex Media Server so you can access them from all your devices and stream from anywhere.",
"pbi cage multimedia/plexmediaserver name": "Plex Media Server",
"pbi cage multimedia/plexmediaserver tags": "streaming, multimedia, server",
"pbi cage multimedia/plexmediaserver website": "https://plex.tv"
},
"id": "someUniqueID",
"name": "response",
"namespace": "rpc"
}
PKG Database Information
++++++++++++++++++++++++
General Queries: "pkg <jail> <info>" where <info> can be: "remotelist", "installedlist", "hasupdates" (true/false returned), or "updatemessage".
Individual pkg queries: "pkg <jail> <local/remote> <pkg origin> <info>"
.. _note: "local" is used for installed applications while "remote" is for information available on the global repository and might not match what is currently installed.
<info> may be: "origin", "name", "version", "maintainer", "comment", "description", "website", "size", "arch", "message", "dependencies", "rdependencies", "categories", "options", "license"
For "local" pkgs, there are some additional <info> options: "timestamp", "isOrphan", "isLocked", "files", "users", and "groups"
**JSON Query**
.. code-block:: json
{
"namespace" : "rpc",
"name" : "syscache",
"id" : "someUniqueID",
"args" : ["pkg #system installedlist", "pkg #system local mail/thunderbird version", "pkg #system remote mail/thunderbird version", "pkg #system local mail/thunderbird files" ]
}
**JSON Reply**
.. code-block:: json
{
"args": {
"pkg #system installedlist": [
"graphics/ImageMagick",
"devel/ORBit2",
"graphics/OpenEXR",
(SHORTENED FOR BREVITY - THIS GETS QUITE LONG)
"archivers/zip",
"devel/zziplib"
],
"pkg #system local mail/thunderbird files": [
"/usr/local/bin/thunderbird",
"/usr/local/lib/thunderbird/application.ini",
"/usr/local/lib/thunderbird/blocklist.xml",
"/usr/local/lib/thunderbird/chrome.manifest",
(SHORTENED FOR BREVITY - THIS GETS QUITE LONG)
"/usr/local/share/applications/thunderbird.desktop",
"/usr/local/share/pixmaps/thunderbird.png"
],
"pkg #system local mail/thunderbird version": "38.2.0_1",
"pkg #system remote mail/thunderbird version": "38.2.0_1"
},
"id": "someUniqueID",
"name": "response",
"namespace": "rpc"
}
Search Capabilities
+++++++++++++++++++
Query Syntax: "<pkg/pbi> search <search term> [<pkg jail>/<pbi filter>] [result minimum]
The search always returns an array of <pkg origin>, organized in order of priority where the first element is highest priority and the last element is the lowest priority.
"pbi" probes the PBI database of end-user applications (independent of what is actually available/installed), whereas "pkg" searches all available/installed packages. whether they are
designed for end-users or not.
The "<pkg jail>" option may only be used for pkg searches and corresponds to normal <jail> syntax (using "#system" or jail ID). If it is not supplied, it assumes a search for the local
system (#system).
The "<pbi filter>" option may only be used for PBI searches to restrict the type of application being looked for, and may be: "all" "[not]graphical", "[not]server", and "[not]text". The
default value is "all" (if that option is not supplied).
The "result minimum" is the number of results the search should try to return (10 by default). The search is done by putting all the apps into various "priority groups", and only the
highest-priority groups which result in the minimum desired results will be used. For example: if the search comes up with grouping of 3-highest priority, 5-medium priority, and 20-low
priority, then a minimum search of 2 will only return the "highest" priority group, a minimum search of 4 will return the highest and medium priority groups, and a minimum of 9+ will result
in all the groups getting returned.
**JSON Query**
.. code-block:: json
{
"namespace" : "rpc",
"name" : "syscache",
"id" : "someUniqueID",
"args" : ["pbi search \"thun\" ", "pbi search \"thun\" text", "pkg search \"thun\""]
}
**JSON Reply**
.. code-block:: json
{
"args": {
"pbi search \"thun\" ": [
"x11-fm/thunar",
"mail/thunderbird",
"www/thundercache",
"www/thundersnarf",
"x11/alltray",
"deskutils/gbirthday",
"audio/gtkpod",
"www/libxul"
],
"pbi search \"thun\" text": "www/thundersnarf",
"pkg search \"thun\"": " "
},
"id": "someUniqueID",
"name": "response",
"namespace": "rpc"
}

6
api/classes/screen.rst Normal file
View File

@@ -0,0 +1,6 @@
.. _screen:
screen
=======
Some intro text here...

6
api/classes/sound.rst Normal file
View File

@@ -0,0 +1,6 @@
.. _sound:
sound
=====
Some intro text here...

6
api/classes/updates.rst Normal file
View File

@@ -0,0 +1,6 @@
.. _updates:
updates
=======
Some intro text here...

243
api/conf.py Normal file
View File

@@ -0,0 +1,243 @@
# -*- coding: utf-8 -*-
#
# FreeNAS documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 9 10:34:28 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinxcontrib.httpdomain']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'PC-BSD API'
copyright = u'2015, iXsystems'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'classic'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'PC-BSD API'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'PC-BSD.tex', u'PC-BSD API',
u'iXsystems', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pc-bsd', u'PC-BSD Documentation',
[u'iXsystems'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'PC-BSD', u'PC-BSD Documentation',
u'iXsystems', 'PC-BSD', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

123
api/connection.rst Normal file
View File

@@ -0,0 +1,123 @@
.. _Connection:
Connection
==========
Some intro text here...
.. _Getting Started:
Getting Started
---------------
Add some links to docs on websockets and json....
.. _Authentication:
Authentication
--------------
Describe how to authenticate to websockets via Local / Remote, local connections do not need username / password...
Once a websocket connection is made to the server, the client needs to use the authentication class to authenticate itself to obtain access to the sysadm service. Every authentciation class
request contains the following parameters:
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| **Parameter** | **Value** | **Description** |
| | | |
+=================================+===============+======================================================================================================================+
| id | | any unique value for the request; examples include a hash, checksum, or uuid |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| name | auth | |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| namespace | rpc | |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| args | | values vary by type of authentication request |
| | | |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
Several methods are available for authentication. Here is an example of a login using a username and password:
**Request**
.. code-block:: json
{
"namespace" : "rpc",
"name" : "auth",
"id" : "sampleID",
"args" : {
"username" : "myuser",
"password" : "mypassword"
}
}
Here is an example of using token authentication, where the token is invalidated after 5 minutes of inactivity:
**Request**
.. code-block:: json
{
"namespace" : "rpc",
"name" : "auth_token",
"id" : "sampleID",
"args" : {
"token" : "MySavedAuthToken"
}
}
A successful authentication will provide a reply similar to this:
**Reply**
.. code-block:: json
{
"args": [
"SampleAuthenticationToken",
300
],
"id": "sampleID",
"name": "response",
"namespace": "rpc"
}
.. _note: the first element of the *"args"* array is the authentication token for use later as necessary, while the second element is the number of seconds for which that token is valid.
The token is reset after every successful communication with the websocket. In this example, it is set to 5 minutes of inactivity before the token is invalidated. The websocket server is
currently set to close any connection to a client after 10 minutes of inactivity.
An invalid authentication, or a system request after the user session has timed out due to inactivity, looks like this:
**Reply**
.. code-block:: json
{
"args": {
"code": 401,
"message": "Unauthorized"
},
"id": "sampleID",
"name": "error",
"namespace": "rpc"
}
To clear a pre-saved authentication token, such as signing out, use this request:
**Request**
.. code-block:: json
{
"namespace" : "rpc",
"name" : "auth_clear",
"id" : "sampleID",
"args" : "junk argument"
}

17
api/index.rst Normal file
View File

@@ -0,0 +1,17 @@
PC-BSD® API Reference
=====================
.. toctree::
:numbered:
:maxdepth: 4
connection
users
classes/index
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

28
api/users.rst Normal file
View File

@@ -0,0 +1,28 @@
.. _Users:
Users
=====
Some intro text here...
.. _listUsers:
listUsers
---------
.. _addUser:
addUser
-------
Optional args to "pw" used for all the following commands, sent via json
.. _rmUser:
rmUser
------
.. _modUser:
modUser
-------