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
.
nix
dataplaneapi --apache-common-log-format '%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i" %{us}T'
nix
dataplaneapi --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.
nix
dataplaneapi --api-address 10.2.3.4
nix
dataplaneapi --api-address 10.2.3.4
--api-port Jump to heading
The advertised API port. Overrides the dataplaneapi.advertised.api_port
option.
nix
dataplaneapi --api-port 80
nix
dataplaneapi --api-port 80
--backups-dir Jump to heading
Path to directory in which to place backup files. Overrides the dataplaneapi.transaction.backups_dir
option.
nix
dataplaneapi --backups-dir /tmp/backups
nix
dataplaneapi --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.
nix
dataplaneapi --backups-number 10
nix
dataplaneapi --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
.
nix
dataplaneapi --cleanup-timeout 10s
nix
dataplaneapi --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.
nix
dataplaneapi --cluster-tls-dir /etc/haproxy/
nix
dataplaneapi --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
.
nix
dataplaneapi --config-file /etc/haproxy/haproxy.cfg
nix
dataplaneapi --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
.
nix
dataplaneapi --dataplane-storage-dir /etc/haproxy/dataplane
nix
dataplaneapi --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.
nix
dataplaneapi --debug-socket-path /var/run/dataplane-debug.sock
nix
dataplaneapi --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
.
nix
dataplaneapi --delayed-start-max 30s
nix
dataplaneapi --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
.
nix
dataplaneapi --delayed-start-tick 500ms
nix
dataplaneapi --delayed-start-tick 500ms
--disable-inotify Jump to heading
Disables the inotify watcher for the configuration file. Overrides the dataplaneapi.disable_inotify
option.
nix
dataplaneapi --disable-inotify false
nix
dataplaneapi --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.
nix
dataplaneapi --fid /etc/haproxy/fid
nix
dataplaneapi --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
.
nix
dataplaneapi --general-storage-dir /etc/haproxy/general
nix
dataplaneapi --general-storage-dir /etc/haproxy/general
--gid Jump to heading
Group id value to set on start. Overrides the dataplaneapi.gid
option.
nix
dataplaneapi --gid 1000
nix
dataplaneapi --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
.
nix
dataplaneapi --graceful-timeout 15s
nix
dataplaneapi --graceful-timeout 15s
--haproxy-bin, -b Jump to heading
Path to the HAProxy binary file. Overrides the haproxy.haproxy_bin
option. Defaults to haproxy
.
nix
dataplaneapi --haproxy-bin /usr/sbin/haproxy
nix
dataplaneapi --haproxy-bin /usr/sbin/haproxy
--help, -h Jump to heading
Shows the help message.
nix
dataplaneapi --help
nix
dataplaneapi --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
.
nix
dataplaneapi --host localhost
nix
dataplaneapi --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
.
nix
dataplaneapi --keep-alive 3m
nix
dataplaneapi --keep-alive 3m
--listen-limit Jump to heading
The limit on the number of outstanding requests. Overrides the dataplaneapi.listen_limit
option.
nix
dataplaneapi --listen-limit 1024
nix
dataplaneapi --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
.
nix
dataplaneapi --log-file /var/log/dataplaneapi/dataplaneapi.log
nix
dataplaneapi --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
.
nix
dataplaneapi --log-format text
nix
dataplaneapi --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
.
nix
dataplaneapi --log-level info
nix
dataplaneapi --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
.
nix
dataplaneapi --log-to syslog
nix
dataplaneapi --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
.
nix
dataplaneapi --maps-dir /etc/haproxy/maps
nix
dataplaneapi --maps-dir /etc/haproxy/maps
--master-runtime, -m Jump to heading
Path to the master Runtime API socket. Overrides the haproxy.master_runtime
option.
nix
dataplaneapi --master-runtime /var/run/haproxy/master.sock
nix
dataplaneapi --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.
nix
dataplaneapi --master-worker-mode true
nix
dataplaneapi --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
.
nix
dataplaneapi --max-header-size 1MiB
nix
dataplaneapi --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.
nix
dataplaneapi --max-open-transactions 20
nix
dataplaneapi --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.
nix
dataplaneapi --pid-file /tmp/dataplane.pid
nix
dataplaneapi --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
.
nix
dataplaneapi --port 80
nix
dataplaneapi --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
.
nix
dataplaneapi --read-timeout 30s
nix
dataplaneapi --read-timeout 30s
--reload-cmd, -r Jump to heading
Reload command. Overrides the haproxy.reload.reload_cmd
option.
nix
dataplaneapi --reload-cmd "systemctl reload haproxy"
nix
dataplaneapi --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.
nix
dataplaneapi --reload-delay 5
nix
dataplaneapi --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.
nix
dataplaneapi --reload-retention 1
nix
dataplaneapi --reload-retention 1
--reload-strategy Jump to heading
Either systemd, s6 or custom. Overrides the haproxy.reload.reload_strategy
option. Defaults to custom.
nix
dataplaneapi --reload-strategy systemd
nix
dataplaneapi --reload-strategy systemd
--restart-cmd, -s Jump to heading
Restart command. Overrides the haproxy.reload.restart_cmd
option.
nix
dataplaneapi --restart-cmd "systemctl restart haproxy"
nix
dataplaneapi --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.
nix
dataplaneapi --scheme http
nix
dataplaneapi --scheme http
--service Jump to heading
Name of the HAProxy service. Overrides the haproxy.reload.service_name
option.
nix
dataplaneapi --service haproxy.service
nix
dataplaneapi --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.
nix
dataplaneapi --show-system-info false
nix
dataplaneapi --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
.
nix
dataplaneapi --socket-path /var/run/data-plane.sock
nix
dataplaneapi --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
.
nix
dataplaneapi --spoe-dir /etc/haproxy/spoe
nix
dataplaneapi --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
.
nix
dataplaneapi --spoe-transaction-dir /tmp/spoe-haproxy
nix
dataplaneapi --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
.
nix
dataplaneapi --ssl-certs-dir /etc/haproxy/ssl
nix
dataplaneapi --ssl-certs-dir /etc/haproxy/ssl
--status-cmd Jump to heading
Status command. Overrides the haproxy.reload.status_cmd
option.
nix
dataplaneapi --status-cmd "systemctl status haproxy"
nix
dataplaneapi --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.
nix
dataplaneapi --syslog-address 127.0.0.1
nix
dataplaneapi --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
.
nix
dataplaneapi --syslog-facility local0
nix
dataplaneapi --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
.
nix
dataplaneapi --syslog-level debug
nix
dataplaneapi --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
.
nix
dataplaneapi --syslog-protocol tcp
nix
dataplaneapi --syslog-protocol tcp
--syslog-tag Jump to heading
String to tag the syslog messages. Overrides the log.syslog.syslog_tag
option. Defaults to dataplaneapi
.
nix
dataplaneapi --syslog-tag dataplaneapi
nix
dataplaneapi --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
.
nix
dataplaneapi --time-suffix s
nix
dataplaneapi --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
.
nix
dataplaneapi --tls-ca /etc/ssl/frontends/default/ca.pem
nix
dataplaneapi --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
.
nix
dataplaneapi --tls-certificate /etc/ssl/frontends/default/crt.pem
nix
dataplaneapi --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
.
nix
dataplaneapi --tls-host 0.0.0.0
nix
dataplaneapi --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.
nix
dataplaneapi --tls-keep-alive 1m
nix
dataplaneapi --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
.
nix
dataplaneapi --tls-key /etc/ssl/frontends/default/key.pem
nix
dataplaneapi --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.
nix
dataplaneapi --tls-listen-limit 10
nix
dataplaneapi --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
.
nix
dataplaneapi --tls-port 5555
nix
dataplaneapi --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.
nix
dataplaneapi --tls-read-timeout 10s
nix
dataplaneapi --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.
nix
dataplaneapi --tls-write-timeout 10s
nix
dataplaneapi --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
.
nix
dataplaneapi --transaction-dir /etc/haproxy/transactions
nix
dataplaneapi --transaction-dir /etc/haproxy/transactions
--uid Jump to heading
User id value to set on start. Overrides the dataplaneapi.uid
option.
nix
dataplaneapi --uid 1000
nix
dataplaneapi --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.
nix
dataplaneapi --update-map-files false
nix
dataplaneapi --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.
nix
dataplaneapi --update-map-files-period 10
nix
dataplaneapi --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
.
nix
dataplaneapi --userlist myuserlist
nix
dataplaneapi --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.
nix
dataplaneapi --userlist-file /etc/haproxy/userlist.cfg
nix
dataplaneapi --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.
nix
dataplaneapi --validate-cmd /usr/local/bin/validate-haproxy.sh
nix
dataplaneapi --validate-cmd /usr/local/bin/validate-haproxy.sh
--version, -v Jump to heading
Displays version and build information.
nix
dataplaneapi --version
nix
dataplaneapi --version
--write-timeout Jump to heading
Maximum duration before timing out write of the response. Overrides the dataplaneapi.write_timeout
option. Defaults to 30s
.
nix
dataplaneapi --write-timeout 30s
nix
dataplaneapi --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?