diff options
author | John Estabrook <jestabro@vyos.io> | 2025-04-04 22:48:30 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2025-04-11 13:32:31 -0500 |
commit | ad2d932768734b492a54c728b459437056460668 (patch) | |
tree | e935ec8ec33af3aa64c2bd1a134526533cc026ee /src/vyconfd.ml | |
parent | 8ac435cac62f20a9c8bfa2d1671332843af66c33 (diff) | |
download | vyconf-ad2d932768734b492a54c728b459437056460668.tar.gz vyconf-ad2d932768734b492a54c728b459437056460668.zip |
T7321: add save config operation
Diffstat (limited to 'src/vyconfd.ml')
-rw-r--r-- | src/vyconfd.ml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vyconfd.ml b/src/vyconfd.ml index 960e523..e531278 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -171,6 +171,13 @@ let load world token (req: request_load) = response_tmpl with Session.Session_error msg -> {response_tmpl with status=Fail; error=(Some msg)} +let save world token (req: request_save) = + try + let _ = Session.save world (find_session token) req.location + in + response_tmpl + with Session.Session_error msg -> {response_tmpl with status=Fail; error=(Some msg)} + let commit world token (req: request_commit) = let s = find_session token in let at = world.Session.running_config in @@ -260,6 +267,7 @@ let rec handle_connection world ic oc () = | Some t, Set r -> set world t r | Some t, Delete r -> delete world t r | Some t, Load r -> load world t r + | Some t, Save r -> save world t r | _ -> failwith "Unimplemented" ) |> Lwt.return end |