Page MenuHomeVyOS Platform

Implement config write API for Python
Closed, ResolvedPublicENHANCEMENT

Description

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

Details

Difficulty level
Hard (possibly days)
Version
-
Why the issue appeared?
Other
Is it a breaking change?
Perfectly compatible

Related Objects

Event Timeline

dmbaturin triaged this task as High priority.Jun 12 2019, 8:01 AM
dmbaturin created this task.
runar added a subscriber: runar.Jun 12 2019, 2:49 PM
pasik added a subscriber: pasik.Jun 13 2019, 7:41 PM
syncer changed the subtype of this task from "Task" to "Enhancement".Mar 15 2020, 3:25 PM
dmbaturin closed this task as Resolved.Mar 15 2020, 3:27 PM
dmbaturin changed Difficulty level from Unknown (require assessment) to Hard (possibly days).
dmbaturin changed Why the issue appeared? from Will be filled on close to Other.
dmbaturin set Is it a breaking change? to Perfectly compatible.
c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.Mar 22 2020, 8:53 AM