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.

--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. Overrides the dataplaneapi.transaction.backups_number option.

nix
dataplaneapi --backups-number 10
nix
dataplaneapi --backups-number 10

--config-file, -c Jump to heading

Path to the HAProxy configuration file. Overrides the haproxy.config_file option.

nix
dataplaneapi --configmap-file /etc/haproxy/haproxy.cfg
nix
dataplaneapi --configmap-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.

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.

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.

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. 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.

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

--haproxy-bin, -b Jump to heading

Path to the HAProxy binary file. Overrides the haproxy.haproxy_bin option.

nix
dataplaneapi --haproxy-bin /usr/sbin/haproxy
nix
dataplaneapi --haproxy-bin /usr/sbin/haproxy

--log-file Jump to heading

Location of the log file. Overrides the log.log_file option.

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.

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.

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.

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.

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-open-transactions Jump to heading

Limit for active transaction in pending state. Overrides the dataplaneapi.transaction.max_open_transactions option.

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 APIs PID will be written. Overrides the dataplaneapi.pid_file` option.

nix
dataplaneapi --pid-file /tmp/dataplane.pid
nix
dataplaneapi --pid-file /tmp/dataplane.pid

--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.

nix
dataplaneapi --reload-delay 5
nix
dataplaneapi --reload-delay 5

--reload-retention Jump to heading

Reload retention in days. Overrides the haproxy.reload.reload_retention option.

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.

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"

--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

--spoe-dir Jump to heading

Path to SPOE directory. Overrides the dataplaneapi.resources.spoe_dir option.

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.

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.

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.

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.

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.

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.

nix
dataplaneapi --syslog-tag dataplaneapi
nix
dataplaneapi --syslog-tag dataplaneapi

--transaction-dir, -t Jump to heading

Path to the transaction directory. Overrides the dataplaneapi.transaction.transaction_dir option.

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.

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.

nix
dataplaneapi --userlist myuserlist
nix
dataplaneapi --userlist myuserlist

--userlist-file Jump to heading

Path to the Data Plane API userlist 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

Do you have any suggestions on how we can improve the content of this page?