-- --docker-init - is automatically used by Docker when building the images to install modules and enable features. Described in the next chapter. **Do not run manually**
-- the two main modes:
-
- \- \-\-manager \- runs in manager mode
-
- \- \-\-network\-function \- runs in network function mode
-
- - global settings, which can be used with **ANY** of the other operating modes:
-
- \- \-\-operational\-only \- used in testing. do not use the RUNNING datastore, only do the population on OPERATIONAL datastore
-
- \- \-\-fixed\-rand \- used in testing. specify a fixed value seed for the randomness
-
- \- \-\-verbose \- set the verbose level. can range from 0 to 2, default is 1
-
- \- \-\-workspace \- set the current working workspace. the workspace must contain the \*config\* and \*log\* folders
-
-- test modes - do not use
-
-- utilitary functions:
-
- \- \-\-ls \- list all modules in the datastore with their attributes
-
- \- \-\-schema \- list the schema of an xpath given as parameter
-
- \- \-\-populate \- populate the datastore upon starting
-
- \- \-\-enable\-features \- enable all features upon starting, after (if requested) the populating was done
-
- \- \-\-nc\-server\-init \- initialize netconf server
-
- \- \-\-loop \- after everything is done, run an endless loop
-
-### Docker container initialization
-===================================
+- --version - describes ntsng version and build time
+- **main modes**:
+
+ - --container-init - is automatically used by Docker when building the images to install modules and enable features. Described in the next chapter. **Do not run manually**
+ - --supervisor - runs in supervisor mode (configuration is done via config.json)
+ - --manager - runs in manager mode
+ - --network-function - runs in network function mode
+ - --generate - generates data based on current settings and datastores, without commiting the data (saves to file)
+ - --test-mode - test mode for automated tests. **Do not use**
+
+- global settings changer:
+
+ - --fixed-rand - used in testing. specify a fixed value seed for the randomness
+ - --verbose - set the verbose level. can range from 0 (errors-only) to 2 (verbose), default is 1 (info)
+ - --workspace - set the current working workspace. the workspace **MUST** be writeable and should contain *config/config.json* file, otherwise a blank json file will be created
+- tools:
+
+ - --ls - list all modules in the datastore with their attributes
+ - --schema - list the schema of an xpath given as parameter
+
+Environment variables
+^^^^^^^^^^^^^^^^^^^^^
+
+Below all the available enviroment variables are listed. Please note that if a variable is not defined, it will have a default behaviour:
+
+- **NTS_MANUAL** - when defined, SUPERVISOR will not start any tasks marked as "nomanual"
+- **NTS_BUILD_VERSION** - defines build version, set by Dockerfile
+- **NTS_BUILD_DATE** - defines build date, set by Dockerfile
+- **NTS_NF_STANDALONE_START_FEATURES** - when value is not blank, it allows the network function to run in standalone mode; see "Network function standalone mode" sub-chapter for this
+
+- **DOCKER_ENGINE_VERSION** - Docker engine version, defaults to 1.40 if not set
+- **HOSTNAME** - Container hostname
+- **IPv6_ENABLED** - true/false whether IP v6 is enabled (default false)
+- **SSH_CONNECTIONS** - number of NETCONF SSH connections that should be enabled (default 1)
+- **TLS_CONNECTIONS** - number of NETCONF TLS connections that should be enabled (default 0)
+
+- **NTS_HOST_IP** - Docker host IP address
+- **NTS_HOST_BASE_PORT** - see "Starting the NTS Manager" sub-chapter
+- **NTS_HOST_NETCONF_SSH_BASE_PORT** - see "Starting the NTS Manager" sub-chapter
+- **NTS_HOST_NETCONF_TLS_BASE_PORT** - see "Starting the NTS Manager" sub-chapter
+- **NTS_HOST_TRANSFER_FTP_BASE_PORT** - see "Starting the NTS Manager" sub-chapter
+- **NTS_HOST_TRANSFER_SFTP_BASE_PORT** - see "Starting the NTS Manager" sub-chapter
+
+- **SDN_CONTROLLER_PROTOCOL** - protocol used for communication with the SDN controller (http or https, defaults to https)
+- **SDN_CONTROLLER_IP** - SDN controller IP address
+- **SDN_CONTROLLER_PORT** - SDN controller port
+- **SDN_CONTROLLER_CALLHOME_PORT** - SDN controller port for NETCONF call-home
+- **SDN_CONTROLLER_USERNAME** - SDN controller username
+- **SDN_CONTROLLER_PASSWORD** - SDN controller password
+
+- **VES_COMMON_HEADER_VERSION** - VES protocol version to report (defaults to 7.2)
+- **VES_ENDPOINT_PROTOCOL** - protocol used for communication with the VES endpoint (http or https, defaults to https)
+- **VES_ENDPOINT_IP** - VES endpoint IP address
+- **VES_ENDPOINT_PORT** - VES endpoint port
+- **VES_ENDPOINT_AUTH_METHOD** - VES endpoint auth method; see YANG definition for possible values
+- **VES_ENDPOINT_USERNAME** - VES endpoint username
+- **VES_ENDPOINT_PASSWORD** - VES endpoint password
+- **VES_ENDPOINT_CERTIFICATE** - VES endpoint certificate; not implemented at the moment of writing
+
+Supervisor functionality and configuration
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The NTS app tries to be very little dependent on other tools. Until v1.0.8 one of these tools was supervisord, and now its functionality is embedded inside the NTS app. Now the Docker image runs the NTS app with --supervisor parameter to start the supervisor. When supervisor is ran, other main modes and their options are unavailable for that instance (the supervisor will spawn another instance for the main functionalities). Configuration of the supervisor functionality is done via config.json:
+
+::
+
+ "supervisor-rules": {
+ "netopeer": {
+ "path": "/usr/local/bin/netopeer2-server",
+ "args": ["-d", "-v2"],
+ "autorestart": true,
+ "stdout": "log/netopeer-stdout.log",
+ "stderr": "log/netopeer-stderr.log"
+ },
+
+ "sshd": {
+ "path": "/usr/sbin/sshd",
+ "args": ["-D"],
+ "autorestart": true,
+ "stdout": "log/sshd-stdout.log",
+ "stderr": "log/sshd-stderr.log"
+ },
+
+ "ntsim-network-function": {
+ "path": "/opt/dev/ntsim-ng/ntsim-ng",
+ "args": ["-w/opt/dev/ntsim-ng", "-f"],
+ "nomanual": true,
+ "stdout": "",
+ "stderr": ""
+ }
+ }
+
+The example above is the default example for a network function. The *supervisor-rules* object contains a list of tasks to run, each with their own settings. Below is a description of all parameters:
+
+- path: *mandatory field* - full path to the the binary
+- args: a list of arguments to be passed to the binary, default is no arguments
+- autorestart: this is true or false, whether to autorestart the application on exit/kill, default is false
+- nomanual: when this is true, the task **won't** be automatically ran when the **NTS_MANUAL** environment variable is present. Default is false, and using this is usually good for debugging.
+- stdout and stderr: path to redirect stdout or stderr to; if **blank**, it will be replaced by **/dev/null** for discarding. If any of the fields are not present in configuration, default value will be used (actual stdout/stderr).
+
+Docker container initialization
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^