Right now we only have config read API for Python, and no write API. If used with care, it can be implemented by saving the environment variables given by cli-shell-api getSessionEnv and using it for calls to my_set, my_delete etc.
s = vyos.configsession.ConfigSession(os.getpid(), app="vyos-http-api") s.set(["system", "host-name"], value="vyos") s.delete(["system", "options", "reboot-on-panic"]) s.comment(["system", "host-name"], value="Haha, I can change host-name via an API") s.commit()