Reference
CLI reference
At startup, you can pass arguments to the Data Plane API. Use these arguments to override values set in the dataplaneapi.yml configuration file. This allows for flexibility in deployment and testing. When a configuration option is set both in the YAML file and via a command-line argument, the command-line argument takes precedence.
List of arguments Jump to heading
The HAProxy Data Plane API supports the following command-line arguments at startup.
--apache-common-log-format Jump to heading
Apache Common Log Format to format the access log entries. Defaults to %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i" %{us}T.
nixdataplaneapi --apache-common-log-format '%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i" %{us}T'
nixdataplaneapi --apache-common-log-format '%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i" %{us}T'
--api-address Jump to heading
The advertised API address. Overrides the dataplaneapi.advertised.api_address option.
nixdataplaneapi --api-address 10.2.3.4
nixdataplaneapi --api-address 10.2.3.4
--api-port Jump to heading
The advertised API port. Overrides the dataplaneapi.advertised.api_port option.
nixdataplaneapi --api-port 80
nixdataplaneapi --api-port 80
--backups-dir Jump to heading
Path to directory in which to place backup files. Overrides the dataplaneapi.transaction.backups_dir option.
nixdataplaneapi --backups-dir /tmp/backups
nixdataplaneapi --backups-dir /tmp/backups
--backups-number, -n Jump to heading
Number of backup configuration files to keep, stored in the config dir with version number suffix. Overrides the dataplaneapi.transaction.backups_number option. Defaults to 0.
nixdataplaneapi --backups-number 10
nixdataplaneapi --backups-number 10
--cleanup-timeout Jump to heading
The grace period to wait before killing idle connections. Overrides the dataplaneapi.cleanup_timeout option. Defaults to 10s.
nixdataplaneapi --cleanup-timeout 10s
nixdataplaneapi --cleanup-timeout 10s
--cluster-tls-dir Jump to heading
Path where the cluster TLS certificates will be stored. Defaults to the same directory as the Data Plane API configuration file.
nixdataplaneapi --cluster-tls-dir /etc/haproxy/
nixdataplaneapi --cluster-tls-dir /etc/haproxy/
--config-file, -c Jump to heading
Path to the HAProxy configuration file. Overrides the haproxy.config_file option. Defaults to /etc/haproxy/haproxy.cfg.
nixdataplaneapi --config-file /etc/haproxy/haproxy.cfg
nixdataplaneapi --config-file /etc/haproxy/haproxy.cfg
--dataplane-storage-dir Jump to heading
Path to Data Plane API internal storage directory. Overrides the dataplaneapi.resources.dataplane_storage_dir option. Defaults to /etc/haproxy/dataplane.
nixdataplaneapi --dataplane-storage-dir /etc/haproxy/dataplane
nixdataplaneapi --dataplane-storage-dir /etc/haproxy/dataplane
--debug-socket-path Jump to heading
Defines the path for the debugging command socket. Overrides the dataplaneapi.debug_socket_path option.
nixdataplaneapi --debug-socket-path /var/run/dataplane-debug.sock
nixdataplaneapi --debug-socket-path /var/run/dataplane-debug.sock
--delayed-start-max Jump to heading
Maximum duration to wait for the haproxy runtime socket to be ready. Overrides the haproxy.delayed_start_max option. Defaults to 30s.
nixdataplaneapi --delayed-start-max 30s
nixdataplaneapi --delayed-start-max 30s
--delayed-start-tick Jump to heading
Duration between checks for the haproxy runtime socket to be ready. Overrides the haproxy.delayed_start_tick option. Defaults to 500ms.
nixdataplaneapi --delayed-start-tick 500ms
nixdataplaneapi --delayed-start-tick 500ms
--disable-inotify Jump to heading
Disables the inotify watcher for the configuration file. Overrides the dataplaneapi.disable_inotify option.
nixdataplaneapi --disable-inotify false
nixdataplaneapi --disable-inotify false
--fid Jump to heading
Path to file that the Data Plane API will use to write its ID (not a PID) that was given to it after joining a cluster. Overrides the haproxy.fid option.
nixdataplaneapi --fid /etc/haproxy/fid
nixdataplaneapi --fid /etc/haproxy/fid
--general-storage-dir Jump to heading
Path to general storage directory. Overrides the dataplaneapi.resources.general_storage_dir option. Defaults to /etc/haproxy/general.
nixdataplaneapi --general-storage-dir /etc/haproxy/general
nixdataplaneapi --general-storage-dir /etc/haproxy/general
--gid Jump to heading
Group id value to set on start. Overrides the dataplaneapi.gid option.
nixdataplaneapi --gid 1000
nixdataplaneapi --gid 1000
--graceful-timeout Jump to heading
The grace period to wait before shutting down the server. Overrides the dataplaneapi.graceful_timeout option. Defaults to 15s.
nixdataplaneapi --graceful-timeout 15s
nixdataplaneapi --graceful-timeout 15s
--haproxy-bin, -b Jump to heading
Path to the HAProxy binary file. Overrides the haproxy.haproxy_bin option. Defaults to haproxy.
nixdataplaneapi --haproxy-bin /usr/sbin/haproxy
nixdataplaneapi --haproxy-bin /usr/sbin/haproxy
--help, -h Jump to heading
Shows the help message.
nixdataplaneapi --help
nixdataplaneapi --help
--host Jump to heading
The IP address on which to listen. Defaults to localhost. Overrides the dataplaneapi.host option. You can also set it via the environment variable $HOST.
nixdataplaneapi --host localhost
nixdataplaneapi --host localhost
--keep-alive Jump to heading
The TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections, for example when the client closes their laptop mid-download. Overrides the dataplaneapi.keep_alive option. Defaults to 3m.
nixdataplaneapi --keep-alive 3m
nixdataplaneapi --keep-alive 3m
--listen-limit Jump to heading
The limit on the number of outstanding requests. Overrides the dataplaneapi.listen_limit option.
nixdataplaneapi --listen-limit 1024
nixdataplaneapi --listen-limit 1024
--log-file Jump to heading
Location of the log file. Overrides the log.log_file option. Defaults to /var/log/dataplaneapi/dataplaneapi.log.
nixdataplaneapi --log-file /var/log/dataplaneapi/dataplaneapi.log
nixdataplaneapi --log-file /var/log/dataplaneapi/dataplaneapi.log
--log-format Jump to heading
Logging format, allowed values are text, JSON. Overrides the log.log_format option. Defaults to text.
nixdataplaneapi --log-format text
nixdataplaneapi --log-format text
--log-level Jump to heading
Logging level, allowed values are trace, debug, info, warning, error. Overrides the log.log_level option. Defaults to warning.
nixdataplaneapi --log-level info
nixdataplaneapi --log-level info
--log-to Jump to heading
Log target, can be stdout, file, or syslog. Overrides the log.log_to option. Defaults to stdout.
nixdataplaneapi --log-to syslog
nixdataplaneapi --log-to syslog
--maps-dir, -p Jump to heading
Path to directory of map files managed by the Data Plane API. Overrides the dataplaneapi.resources.maps_dir option. Defaults to /etc/haproxy/maps.
nixdataplaneapi --maps-dir /etc/haproxy/maps
nixdataplaneapi --maps-dir /etc/haproxy/maps
--master-runtime, -m Jump to heading
Path to the master Runtime API socket. Overrides the haproxy.master_runtime option.
nixdataplaneapi --master-runtime /var/run/haproxy/master.sock
nixdataplaneapi --master-runtime /var/run/haproxy/master.sock
--master-worker-mode Jump to heading
Flag to enable helpers when running HAProxy in master worker mode. Overrides the haproxy.master_worker_mode option.
nixdataplaneapi --master-worker-mode true
nixdataplaneapi --master-worker-mode true
--max-header-size Jump to heading
Controls the maximum number of bytes the server will read when parsing the request header’s keys and values, including the request line. It doesn’t limit the size of the request body. Overrides the dataplaneapi.max_header_size option. Defaults to 1MiB.
nixdataplaneapi --max-header-size 1MiB
nixdataplaneapi --max-header-size 1MiB
--max-open-transactions Jump to heading
Limit for active transaction in pending state. Overrides the dataplaneapi.transaction.max_open_transactions option. Defaults to 20.
nixdataplaneapi --max-open-transactions 20
nixdataplaneapi --max-open-transactions 20
--pid-file Jump to heading
Specifies the path to the file where the API’s PID will be written. Overrides the dataplaneapi.pid_file option.
nixdataplaneapi --pid-file /tmp/dataplane.pid
nixdataplaneapi --pid-file /tmp/dataplane.pid
--port Jump to heading
The port on which to listen for non-secure connections. Overrides the dataplaneapi.port option. Defaults to a random value. You can also set it via the environment variable $PORT.
nixdataplaneapi --port 80
nixdataplaneapi --port 80
--read-timeout Jump to heading
Maximum duration before timing out read of the request. Overrides the dataplaneapi.read_timeout option. Defaults to 30s.
nixdataplaneapi --read-timeout 30s
nixdataplaneapi --read-timeout 30s
--reload-cmd, -r Jump to heading
Reload command. Overrides the haproxy.reload.reload_cmd option.
nixdataplaneapi --reload-cmd "systemctl reload haproxy"
nixdataplaneapi --reload-cmd "systemctl reload haproxy"
--reload-delay, -d Jump to heading
Minimum delay between two reloads (in seconds). Overrides the haproxy.reload.reload_delay option. Defaults to 5.
nixdataplaneapi --reload-delay 5
nixdataplaneapi --reload-delay 5
--reload-retention Jump to heading
Reload retention in days; every older reload ID will be deleted. Overrides the haproxy.reload.reload_retention option. Defaults to 1.
nixdataplaneapi --reload-retention 1
nixdataplaneapi --reload-retention 1
--reload-strategy Jump to heading
Either systemd, s6 or custom. Overrides the haproxy.reload.reload_strategy option. Defaults to custom.
nixdataplaneapi --reload-strategy systemd
nixdataplaneapi --reload-strategy systemd
--restart-cmd, -s Jump to heading
Restart command. Overrides the haproxy.reload.restart_cmd option.
nixdataplaneapi --restart-cmd "systemctl restart haproxy"
nixdataplaneapi --restart-cmd "systemctl restart haproxy"
--scheme Jump to heading
The listeners to enable. This can be repeated and it defaults to the schemes in the OpenAPI specification. Overrides the dataplaneapi.scheme option.
nixdataplaneapi --scheme http
nixdataplaneapi --scheme http
--service Jump to heading
Name of the HAProxy service. Overrides the haproxy.reload.service_name option.
nixdataplaneapi --service haproxy.service
nixdataplaneapi --service haproxy.service
--show-system-info, -i Jump to heading
Enables or disables the display of system information on the info endpoint. Overrides the dataplaneapi.show_system_info option.
nixdataplaneapi --show-system-info false
nixdataplaneapi --show-system-info false
--socket-path Jump to heading
The UNIX domain socket on which to listen. Overrides the dataplaneapi.socket_path option. Defaults to /var/run/data-plane.sock.
nixdataplaneapi --socket-path /var/run/data-plane.sock
nixdataplaneapi --socket-path /var/run/data-plane.sock
--spoe-dir Jump to heading
Path to SPOE directory. Overrides the dataplaneapi.resources.spoe_dir option. Defaults to /etc/haproxy/spoe.
nixdataplaneapi --spoe-dir /etc/haproxy/spoe
nixdataplaneapi --spoe-dir /etc/haproxy/spoe
--spoe-transaction-dir Jump to heading
Path to the SPOE transaction directory. Overrides the dataplaneapi.resources.spoe_transaction_dir option. Defaults to /tmp/spoe-haproxy.
nixdataplaneapi --spoe-transaction-dir /tmp/spoe-haproxy
nixdataplaneapi --spoe-transaction-dir /tmp/spoe-haproxy
--ssl-certs-dir Jump to heading
Path to SSL certificates directory. Overrides the dataplaneapi.resources.ssl_certs_dir option. Defaults to /etc/haproxy/ssl.
nixdataplaneapi --ssl-certs-dir /etc/haproxy/ssl
nixdataplaneapi --ssl-certs-dir /etc/haproxy/ssl
--status-cmd Jump to heading
Status command. Overrides the haproxy.reload.status_cmd option.
nixdataplaneapi --status-cmd "systemctl status haproxy"
nixdataplaneapi --status-cmd "systemctl status haproxy"
--syslog-address Jump to heading
Syslog address (with port declaration in case of TCP type) where logs should be forwarded. It accepts a socket path in case of unix or unixgram. Overrides the log.syslog.syslog_address option.
nixdataplaneapi --syslog-address 127.0.0.1
nixdataplaneapi --syslog-address 127.0.0.1
--syslog-facility Jump to heading
Define the Syslog facility number, allowed values are kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, authpriv, ftp, local0, local1, local2, local3, local4, local5, local6, local7. Overrides the log.syslog.syslog_facility option. Defaults to local0.
nixdataplaneapi --syslog-facility local0
nixdataplaneapi --syslog-facility local0
--syslog-level Jump to heading
Define the required syslog messages level, allowed values are debug, info, notice, warning, error, critical, alert, emergency. Overrides the log.syslog.syslog_level option. Defaults to debug.
nixdataplaneapi --syslog-level debug
nixdataplaneapi --syslog-level debug
--syslog-protocol Jump to heading
Syslog server protocol, allowed values are tcp, tcp4, tcp6, unix, unixgram. Overrides the log.syslog.syslog_protocol option. Defaults to tcp.
nixdataplaneapi --syslog-protocol tcp
nixdataplaneapi --syslog-protocol tcp
--syslog-tag Jump to heading
String to tag the syslog messages. Overrides the log.syslog.syslog_tag option. Defaults to dataplaneapi.
nixdataplaneapi --syslog-tag dataplaneapi
nixdataplaneapi --syslog-tag dataplaneapi
--time-suffix Jump to heading
Preferred time unit to use when writing time values in the configuration (nearest, none, ms, s, m, h, d). Defaults to nearest.
nixdataplaneapi --time-suffix s
nixdataplaneapi --time-suffix s
--tls-ca Jump to heading
TLS certificate authority file to be used with mutual TLS authentication. Overrides the dataplaneapi.tls.tls_ca option. You can also set the environment variable $TLS_CA_CERTIFICATE.
nixdataplaneapi --tls-ca /etc/ssl/frontends/default/ca.pem
nixdataplaneapi --tls-ca /etc/ssl/frontends/default/ca.pem
--tls-certificate Jump to heading
TLS certificate to use for secure connections. Overrides the dataplaneapi.tls.tls_certificate option. You can also set this with the environment variable $TLS_CERTIFICATE.
nixdataplaneapi --tls-certificate /etc/ssl/frontends/default/crt.pem
nixdataplaneapi --tls-certificate /etc/ssl/frontends/default/crt.pem
--tls-host Jump to heading
IP address on which to listen for TLS. When not specified, it’s the same as --host. Overrides the dataplaneapi.tls.tls_host option. You can also this with the environment variable $TLS_HOST.
nixdataplaneapi --tls-host 0.0.0.0
nixdataplaneapi --tls-host 0.0.0.0
--tls-keep-alive Jump to heading
The TCP keep-alive timeout on accepted TLS connections. It prunes dead TCP connections, for example, when a user closes their laptop mid-download. Overrides the dataplaneapi.tls.tls_keep_alive option.
nixdataplaneapi --tls-keep-alive 1m
nixdataplaneapi --tls-keep-alive 1m
--tls-key Jump to heading
TLS private key to use for secure connections. Overrides the dataplaneapi.tls.tls_key option. You can also set the environment variable $TLS_PRIVATE_KEY.
nixdataplaneapi --tls-key /etc/ssl/frontends/default/key.pem
nixdataplaneapi --tls-key /etc/ssl/frontends/default/key.pem
--tls-listen-limit Jump to heading
Limit on the number of outstanding TLS requests. Overrides the dataplaneapi.tls.tls_listen_limit option.
nixdataplaneapi --tls-listen-limit 10
nixdataplaneapi --tls-listen-limit 10
--tls-port Jump to heading
Port on which to listen for secure connections. Defaults to a random value. Overrides the dataplaneapi.tls.tls_port option. You can also set this with the environment variable $TLS_PORT.
nixdataplaneapi --tls-port 5555
nixdataplaneapi --tls-port 5555
--tls-read-timeout Jump to heading
Maximum duration before timing out read of the request. Overrides the dataplaneapi.tls.tls_read_timeout option.
nixdataplaneapi --tls-read-timeout 10s
nixdataplaneapi --tls-read-timeout 10s
--tls-write-timeout Jump to heading
Maximum duration before timing out write of the response. Overrides the dataplaneapi.tls.tls_write_timeout option.
nixdataplaneapi --tls-write-timeout 10s
nixdataplaneapi --tls-write-timeout 10s
--transaction-dir, -t Jump to heading
Path to the transaction directory. Overrides the dataplaneapi.transaction.transaction_dir option. Defaults to /tmp/haproxy.
nixdataplaneapi --transaction-dir /etc/haproxy/transactions
nixdataplaneapi --transaction-dir /etc/haproxy/transactions
--uid Jump to heading
User id value to set on start. Overrides the dataplaneapi.uid option.
nixdataplaneapi --uid 1000
nixdataplaneapi --uid 1000
--update-map-files Jump to heading
Flag used for syncing map files with runtime maps values. Overrides the dataplaneapi.resources.update_map_files option.
nixdataplaneapi --update-map-files false
nixdataplaneapi --update-map-files false
--update-map-files-period Jump to heading
Elapsed time in seconds between two maps syncing operations. Overrides the dataplaneapi.resources.update_map_files_period option. Defaults to 10.
nixdataplaneapi --update-map-files-period 10
nixdataplaneapi --update-map-files-period 10
--userlist, -u Jump to heading
Userlist in HAProxy configuration to use for API Basic Authentication. Overrides the dataplaneapi.userlist.userlist option. Defaults to controller.
nixdataplaneapi --userlist myuserlist
nixdataplaneapi --userlist myuserlist
--userlist-file Jump to heading
Path to the Data Plane API userlist file. By default, the API reads the userlist from the HAProxy configuration. When specified, the API will read the userlist from this file. Overrides the dataplaneapi.userlist.userlist_file option.
nixdataplaneapi --userlist-file /etc/haproxy/userlist.cfg
nixdataplaneapi --userlist-file /etc/haproxy/userlist.cfg
--validate-cmd Jump to heading
Executes a custom command to perform the HAProxy configuration check. Overrides the haproxy.reload.validate_cmd option.
nixdataplaneapi --validate-cmd /usr/local/bin/validate-haproxy.sh
nixdataplaneapi --validate-cmd /usr/local/bin/validate-haproxy.sh
--version, -v Jump to heading
Displays version and build information.
nixdataplaneapi --version
nixdataplaneapi --version
--write-timeout Jump to heading
Maximum duration before timing out write of the response. Overrides the dataplaneapi.write_timeout option. Defaults to 30s.
nixdataplaneapi --write-timeout 30s
nixdataplaneapi --write-timeout 30s
-f Jump to heading
Path to the Data Plane API configuration file. Defaults to /etc/haproxy/dataplaneapi.yaml.
Do you have any suggestions on how we can improve the content of this page?