Skip to content

Latest commit

 

History

History
86 lines (75 loc) · 4.56 KB

SNAPD.md

File metadata and controls

86 lines (75 loc) · 4.56 KB

snapd

The snap daemon/agent (snapd) is a modular application that consists of a control module, a scheduler module, and a REST API. The control module is responsible for loading and unloading plugins, managing loaded plugins, and maintaining an available pool of running plugins for running tasks. The scheduler module is responsible for running the workflows in created tasks per the schedule stated. The REST API provides an interface for loading and unloading plugins, creating and removing tasks, starting and stopping tasks, and listing metrics available for collection.

Usage

$ $SNAP_PATH/bin/snapd [global options] command [command options] [arguments...]

Options

--disable-api, -d                            Disable the agent REST API
--api-port, -p '8181'                        API port (Default: 8181)
--log-level, -l '3'                          1-5 (Debug, Info, Warning, Error, Fatal) [$SNAP_LOG_LEVEL]
--log-path, -o                               Path for logs. Empty path logs to stdout. [$SNAP_LOG_PATH]
--max-procs, -c '1'                          Set max cores to use for snap Agent. Default is 1 core. [$GOMAXPROCS]
--auto-discover, -a                          Auto discover paths separated by colons. [$SNAP_AUTOLOAD_PATH]
--max-running-plugins, -m '3'                The maximum number of instances of a loaded plugin to run [$SNAP_MAX_PLUGINS]
--cache-expiration '500ms'                   The time limit for which a metric cache entry is valid [$SNAP_CACHE_EXPIRATION]
--plugin-trust, -t '1'                       0-2 (Disabled, Enabled, Warning) [$SNAP_TRUST_LEVEL]
--keyring-files, -k                          Keyring files for signing verification separated by colons [$SNAP_KEYRING_FILES]
--rest-cert                                  A path to a certificate to use for HTTPS deployment of snap's REST API
--config                                     A path to a config file
--rest-https                                 start snap's API as https
--rest-key                                   A path to a key file to use for HTTPS deployment of snap's REST API
--tribe-node-name 'tjerniga-mac01.local'     Name of this node in tribe cluster (default: hostname) [$SNAP_TRIBE_NODE_NAME]
--tribe                                      Enable tribe mode [$SNAP_TRIBE]
--tribe-seed                                 IP (or hostname) and port of a node to join (e.g. 127.0.0.1:6000) [$SNAP_TRIBE_SEED]
--tribe-addr '192.168.10.101'                Addr tribe gossips over to maintain membership [$SNAP_TRIBE_ADDR]
--tribe-port '6000'                          Port tribe gossips over to maintain membership [$SNAP_TRIBE_PORT]
--help, -h                                   show help
--version, -v                                print the version

Examples

Commands

$SNAP_PATH/bin/snapd
$SNAP_PATH/bin/snapd -log-level 4
$SNAP_PATH/bin/snapd -l 1 -t 2 -k <keyringPath>
$SNAP_PATH/bin/snapd -a $SNAP_PATH/plugins/
$SNAP_PATH/bin/snapd --version

Output

$ $SNAP_PATH/bin/snapd -l 1 -t 0
INFO[0000] Starting snapd (version: v0.9.0-beta)
INFO[0000] setting GOMAXPROCS to: 1 core(s)
INFO[0000] control started                               _block=start _module=control
INFO[0000] module started                                _module=snapd block=main snap-module=control
INFO[0000] scheduler started                             _block=start-scheduler _module=scheduler
INFO[0000] module started                                _module=snapd block=main snap-module=scheduler
INFO[0000] setting plugin trust level to: disabled
INFO[0000] auto discover path is disabled
INFO[0000] Configuring REST API with HTTPS set to: false  _module=_mgmt-rest
INFO[0000] Starting REST API on :8181                    _module=_mgmt-rest
INFO[0000] Rest API is enabled
INFO[0000] snapd started                                 _module=snapd block=main
INFO[0000] setting log level to: debug

More information