From 8ac435cac62f20a9c8bfa2d1671332843af66c33 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Fri, 4 Apr 2025 20:00:39 -0500 Subject: T7321: add load config operation: load to proposed config --- src/vyconfd.ml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/vyconfd.ml') 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 -- cgit v1.2.3