Adding a server with FQDN and resolvers via Data Plane API

Hi, I have a question regarding the usage of some Data Plane API APIs that wrap the Runtime API. I’m using HAProxy 3.2.6.

I specified a resolvers section in my HAProxy configuration similarly to the following example, along with an empty backend section:

resolvers mydns
  nameserver dns1 192.168.50.30:53
  accepted_payload_size 8192

backend webservers

I would like to add a new server to the backend section by specifying only the FQDN and linking that server to the configured resolvers section. In a normal HAProxy configuration, I would add something like this and restart the service:

backend webservers
  server s1 s1.example.com:8080 check resolvers mydns

However, I want to use the Runtime API through the Data Plane API, since I do not know the servers in advance.

If I understood correctly, this is not possible with the add server (doc here) and set server (doc here) Runtime API commands. I see that set server can update an existing server, but in principle, how can I add a new server with an FQDN linked to a resolver if add server does not seem to support an fqdn parameter or a way to reference a resolvers section?

The mapped commands in the Data Plane API are: POST /services/haproxy/runtime/backends/{parent_name}/servers (doc here), and PUT /services/haproxy/runtime/backends/{parent_name}/servers/{name} (doc here). It does not seem possible to pass the FQDN and resolvers instead of the IP address of a new server.

Thank you in advance.

Quoting the reference manual about add server (link here):

Currently a dynamic server is statically initialized with the none init-addr method. This means that no resolution will be undertaken if a FQDN is specified as an address, even if the server creation will be validated.

And for set server <backend>/<server> fqdn <FQDN> (link here):

Change a server’s FQDN to the value passed in argument. This requires the internal run-time DNS resolver to be configured and enabled for this server.

So this seems to confirm that add server does not support FQDN resolution, while set server supports it only for servers that already exist. Is this correct?