I see there are many new features released in latest ejabberd 19.* Like rest APIs, is it plausible to dynamically add virtual via REST APIs.
I don't see any new command to execute to add a new host.
Is it possible to add a virtual host programmatically to ejabberd, without manually editing ejabberd.cfg and restart the server?
Well, you can edit configuration file programmatically. You probably will prefer to put the hosts option in another file. Example:
In ejabberd.yml
include_config_file: /etc/ejabberd/hosts.yml
# hosts
# - example.org
...
In the new file hosts.yml put:
hosts:
- example.org
And now you can add new hosts to that config file, and reload all it:
$ echo " - example.net" >> /etc/ejabberd/hosts.yml
$ ejabberdctl reload_config