Improve documentation of api v3
[src/app-framework-binder.git] / docs / afb-daemon-options.md
index 84f7ce9..b3a6a18 100644 (file)
-
-Launching options of afb-daemon
----------------------
+# Launching options of afb-daemon
 
 The launch options for binder **afb-daemon** are:
 
-         --help
+```
+ -v, --verbose           Verbose Mode, repeat to increase verbosity
+ -q, --quiet             Quiet Mode, repeat to decrease verbosity
+ -l, --log=xxxx          Tune log level
+     --foreground        Get all in foreground mode
+     --daemon            Get all in background mode
+ -n, --name=xxxx         Set the visible name
+ -p, --port=xxxx         HTTP listening TCP port  [default 1234]
+     --roothttp=xxxx     HTTP Root Directory [default no root http (files not served but apis still available)]
+     --rootbase=xxxx     Angular Base Root URL [default /opa]
+     --rootapi=xxxx      HTML Root API URL [default /api]
+     --alias=xxxx        Multiple url map outside of rootdir [eg: --alias=/icons:/usr/share/icons]
+     --apitimeout=xxxx   Binding API timeout in seconds [default 20]
+     --cntxtimeout=xxxx  Client Session Context Timeout [default 32000000]
+     --cache-eol=xxxx    Client cache end of live [default 100000]
+ -w, --workdir=xxxx      Set the working directory [default: $PWD or current working directory]
+ -u, --uploaddir=xxxx    Directory for uploading files [default: workdir]
+     --rootdir=xxxx      Root Directory of the application [default: workdir]
+     --ldpaths=xxxx      Load bindings from dir1:dir2:... [default = /opt/jobol/lib64/afb]
+ -b, --binding=xxxx      Load the binding of path
+     --weak-ldpaths=xxxx Same as --ldpaths but ignore errors
+     --no-ldpaths        Discard default ldpaths loading
+ -t, --token=xxxx        Initial Secret [default=random, use --token= to allow any token]
+ -r, --random-token      Enforce a random token
+ -V, --version           Display version and copyright
+ -h, --help              Display this help
+     --ws-client=xxxx    Bind to an afb service through websocket
+     --ws-server=xxxx    Provide an afb service through websockets
+ -A, --auto-api=xxxx     Automatic load of api of the given directory
+     --session-max=xxxx  Max count of session simultaneously [default 200]
+     --tracereq=xxxx     Log the requests: no, common, extra, all
+     --traceditf=xxxx    Log the daemons: no, common, all
+     --tracesvc=xxxx     Log the services: no, all
+     --traceevt=xxxx     Log the events: no, common, extra, all
+     --traceses=xxxx     Log the sessions: no, all
+     --traceapi=xxxx     Log the apis: no, common, api, event, all
+ -c, --call=xxxx         call at start format of val: API/VERB:json-args
+     --no-httpd          Forbid HTTP service
+ -e, --exec              Execute the remaining arguments
+ -M, --monitoring        Enable HTTP monitoring at <ROOT>/monitoring/
+```
+
+## help
+
+Prints help with available options
+
+## version
 
-               Prints help with available options
+Display version and copyright
 
-         --version
+## verbose
 
-               Display version and copyright
+Increases the verbosity, can be repeated
 
-         --verbose
+## quiet
 
-               Increases the verbosity, can be repeated
+Decreases the verbosity, can be repeated
 
-         --quiet
+## log=xxxx
 
-               Decreases the verbosity, can be repeated
+Tune the log level mask. The levels are:
 
-         --port=xxxx
+ - error
+ - warning
+ - notice
+ - info
+ - debug
 
-               HTTP listening TCP port  [default 1234]
+The level can be set using + or -.
 
-         --workdir=xxxx
+| Examples | descritpion
+|-----------------|-------------------
+| error,warning   | selects only the levels error and warning
+| +debug          | adds level debug to the current verbosity
+| -warning        | remove the level warning from the current verbosity
+| +warning-debug,info | Adds error and remove errors and warnings
 
-               Directory where the daemon must run [default: $PWD if defined
-               or the current working directory]
+## port=xxxx
 
-         --uploaddir=xxxx
+HTTP listening TCP port  [default 1234]
 
-               Directory where uploaded files are temporarily stored [default: workdir]
+## workdir=xxxx
 
-         --rootdir=xxxx
+Directory where the daemon must run [default: $PWD if defined
+or the current working directory]
 
-               Root directory of the application to serve [default: workdir]
+## uploaddir=xxxx
 
-         --roothttp=xxxx
+Directory where uploaded files are temporarily stored [default: workdir]
 
-               Directory of HTTP served files. If not set, files are not served
-               but apis are still accessible.
+## rootdir=xxxx
 
-         --rootbase=xxxx
+Root directory of the application to serve [default: workdir]
 
-               Angular Base Root URL [default /opa]
+## roothttp=xxxx
 
-               This is used for any application of kind OPA (one page application).
-               When set, any missing document whose url has the form /opa/zzz
-               is translated to /opa/#!zzz
+Directory of HTTP served files. If not set, files are not served
+but apis are still accessible.
 
-         --rootapi=xxxx
+## rootbase=xxxx
 
-               HTML Root API URL [default /api]
+Angular Base Root URL [default /opa]
 
-               The bindings are available within that url.
+This is used for any application of kind OPA (one page application).
+When set, any missing document whose url has the form /opa/zzz
+is translated to /opa/#!zzz
 
-         --alias=xxxx
+## rootapi=xxxx
 
-               Maps a path located anywhere in the file system to the
-               a subdirectory. The syntax for mapping a PATH to the
-               subdirectory NAME is: --alias=/NAME:PATH.
+HTML Root API URL [default /api]
 
-               Example: --alias=/icons:/usr/share/icons maps the
-               content of /usr/share/icons within the subpath /icons.
+The bindings are available within that url.
 
-               This option can be repeated.
+## alias=xxxx
 
-         --apitimeout=xxxx
+Maps a path located anywhere in the file system to the
+a subdirectory. The syntax for mapping a PATH to the
+subdirectory NAME is: --alias=/NAME:PATH.
 
-               binding API timeout in seconds [default 20]
+Example: --alias=/icons:/usr/share/icons maps the
+content of /usr/share/icons within the subpath /icons.
 
-               Defines how many seconds maximum a method is allowed to run.
-               0 means no limit.
+This option can be repeated.
 
-         --cntxtimeout=xxxx
+## apitimeout=xxxx
 
-               Client Session Timeout in seconds [default 3600]
+binding API timeout in seconds [default 20]
 
-         --cache-eol=xxxx
+Defines how many seconds maximum a method is allowed to run.
+0 means no limit.
 
-               Client cache end of live [default 100000 that is 27,7 hours]
+## cntxtimeout=xxxx
 
-         --session-max=xxxx
+Client Session Timeout in seconds [default 32000000 that is 1 year]
 
-               Maximum count of simultaneous sessions [default 10]
+## cache-eol=xxxx
 
-         --ldpaths=xxxx
+Client cache end of live [default 100000 that is 27,7 hours]
 
-               Load bindings from given paths separated by colons
-               as for dir1:dir2:binding1.so:... [default = $libdir/afb]
+## session-max=xxxx
 
-               You can mix path to directories and to bindings.
-               The sub-directories of the given directories are searched
-               recursively.
+Maximum count of simultaneous sessions [default 200]
 
-               The bindings are the files terminated by '.so' (the extension
-               so denotes shared object) that contain the public entry symbol.
+## ldpaths=xxxx
 
-         --binding=xxxx
+Load bindings from given paths separated by colons
+as for dir1:dir2:binding1.so:... [default = $libdir/afb]
 
-               Load the binding of given path.
+You can mix path to directories and to bindings.
+The sub-directories of the given directories are searched
+recursively.
 
-         --token=xxxx
+The bindings are the files terminated by '.so' (the extension
+so denotes shared object) that contain the public entry symbol.
 
-               Initial Secret token to authenticate.
+## weak-ldpaths=xxxx
 
-               If not set, no client can authenticate.
+Same as --ldpaths but instead of stopping on error, ignore errors and continue.
 
-               If set to the empty string, then any initial token is accepted.
+## binding=xxxx
 
-         --random-token
+Load the binding of given path.
 
-               Generate a random starting token. See option --exec.
+## token=xxxx
 
-         --mode=xxxx
+Initial Secret token to authenticate.
 
-               Set the mode: either local, remote or global.
+If not set, no client can authenticate.
 
-               The mode indicate if the application is run locally on the host
-               or remotely through network.
+If set to the empty string, then any initial token is accepted.
 
-         --dbus-client=xxxx
+## random-token
 
-               Transparent binding to a binder afb-daemon service through dbus.
+Generate a random starting token. See option --exec.
 
-               It creates an API of name xxxx that is implemented remotely
-               and queried via DBUS.
+## ws-client=xxxx
 
-         --dbus-server=xxxx
+Transparent binding to a binder afb-daemon service through a WebSocket.
 
-               Provides a binder afb-daemon service through dbus.
+The value of xxxx is either a unix naming socket, of the form "unix:path/api",
+or an internet socket, of the form "host:port/api".
 
-               The name xxxx must be the name of an API defined by a binding.
-               This API is exported through DBUS.
+## ws-server=xxxx
 
-         --ws-client=xxxx
+Provides a binder afb-daemon service through WebSocket.
 
-               Transparent binding to a binder afb-daemon service through a WebSocket.
+The value of xxxx is either a unix naming socket, of the form "unix:path/api",
+or an internet socket, of the form "host:port/api".
 
-               The value of xxxx is either a unix naming socket, of the form "unix:path/api",
-               or an internet socket, of the form "host:port/api".
+## foreground
 
-         --ws-server=xxxx
+Get all in foreground mode (default)
 
-               Provides a binder afb-daemon service through WebSocket.
+## daemon
 
-               The value of xxxx is either a unix naming socket, of the form "unix:path/api",
-               or an internet socket, of the form "host:port/api".
+Get all in background mode
 
-         --foreground
+## no-httpd
 
-               Get all in foreground mode (default)
+Forbids HTTP serve
 
-         --daemon
+## exec
 
-               Get all in background mode
+Must be the last option for afb-daemon. The remaining
+arguments define a command that afb-daemon will launch.
+The sequences @p, @t and @@ of the arguments are replaced
+with the port, the token and @.
 
-         --no-httpd
+## tracereq=xxxx
 
-               Forbids HTTP serve
+Trace the processing of requests in the log file.
 
-         --exec
+Valid values are 'no' (default), 'common', 'extra' or 'all'.
 
-               Must be the last option for afb-daemon. The remaining
-               arguments define a command that afb-daemon will launch.
-               The sequences @p, @t and @@ of the arguments are replaced
-               with the port, the token and @.
+## traceapi=xxxx
 
-         --tracereq=xxxx
+Trace the accesses to functions of class api.
 
-               Trace the processing of requests in the log file.
+Valid values are 'no' (default), 'common', 'api', 'event' or 'all'.
 
-               Valid values are 'no' (default), 'common', 'extra' or 'all'.
+## traceevt=xxxx
 
-         --traceditf=xxxx
+Trace the accesses to functions of class event.
 
-               Trace the accesses to functions of class daemon.
+Valid values are 'no' (default), 'common', 'extra' or 'all'.
 
-               Valid values are 'no' (default), 'common', 'extra' or 'all'.
+## call=xxx
 
-         --tracesvc=xxxx
+Call a binding at start (can be be repeated).
+The values are given in the form API/VERB:json-args.
 
-               Trace the accesses to functions of class service.
+Example: --call 'monitor/set:{"verbosity":{"api":"debug"}}'
 
-               Valid values are 'no' (default) or 'all'.
+## monitoring
 
-         --traceevt=xxxx
+Enable HTTP monitoring at <ROOT>/monitoring/
 
-               Trace the accesses to functions of class event.
+## name=xxxx
 
-               Valid values are 'no' (default), 'common', 'extra' or 'all'.
+Set the visible name
 
-    --call=xxx
+## auto-api=xxxx
 
-               Call a binding at start (can be be repeated).
-               The values are given in the form API/VERB:json-args.
+Automatic activation of api of the given directory when the api is missing.
 
-               Example: --call 'monitor/set:{"verbosity":{"api":"debug"}}'