diff options
author | John Estabrook <jestabro@vyos.io> | 2025-04-04 20:00:39 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2025-04-11 13:32:31 -0500 |
commit | 8ac435cac62f20a9c8bfa2d1671332843af66c33 (patch) | |
tree | c6e020d7319781e183b13384ded6b1e3417a21fb /src/vyconfd.ml | |
parent | aa6b3e603b3ee8e70b5a2e5625711b5da082d076 (diff) | |
download | vyconf-8ac435cac62f20a9c8bfa2d1671332843af66c33.tar.gz vyconf-8ac435cac62f20a9c8bfa2d1671332843af66c33.zip |
T7321: add load config operation: load to proposed config
Diffstat (limited to 'src/vyconfd.ml')
-rw-r--r-- | src/vyconfd.ml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vyconfd.ml b/src/vyconfd.ml index a5117b6..960e523 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -163,6 +163,14 @@ let delete world token (req: request_delete) = response_tmpl with Session.Session_error msg -> {response_tmpl with status=Fail; error=(Some msg)} +let load world token (req: request_load) = + try + let session = Session.load world (find_session token) req.location + in + Hashtbl.replace sessions token session; + 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 @@ -251,6 +259,7 @@ let rec handle_connection world ic oc () = | Some t, Validate r -> validate world t r | Some t, Set r -> set world t r | Some t, Delete r -> delete world t r + | Some t, Load r -> load world t r | _ -> failwith "Unimplemented" ) |> Lwt.return end |