From 5cb1952f52a8a67905a9361364a0c0823d44ed03 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Tue, 14 Jan 2025 12:33:06 -0600 Subject: T7046: add request reload_reftree --- src/vyconf_client.ml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/vyconf_client.ml') diff --git a/src/vyconf_client.ml b/src/vyconf_client.ml index 94348b2..5437428 100644 --- a/src/vyconf_client.ml +++ b/src/vyconf_client.ml @@ -117,3 +117,12 @@ let validate client path = | Success -> Lwt.return (Ok "") | Fail -> Error (Option.value resp.error ~default:"") |> Lwt.return | _ -> Error (Option.value resp.error ~default:"") |> Lwt.return + +let reload_reftree ?(on_behalf_of=None) client = + let id = on_behalf_of |> (function None -> None | Some x -> (Some (Int32.of_int x))) in + let req = Reload_reftree {on_behalf_of=id} in + let%lwt resp = do_request client req in + match resp.status with + | Success -> Ok "" |> Lwt.return + | Fail -> Error (Option.value resp.error ~default:"") |> Lwt.return + | _ -> Error (Option.value resp.error ~default:"") |> Lwt.return -- cgit v1.2.3