diff options
author | John Estabrook <jestabro@vyos.io> | 2025-01-14 12:33:06 -0600 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2025-01-15 18:42:07 -0600 |
commit | 5cb1952f52a8a67905a9361364a0c0823d44ed03 (patch) | |
tree | 96217a1eaf38c910e183c30f2adab865b409e916 /src/vyconf_client.ml | |
parent | 41bb56f9a69001100c5a003f3a0abb03afd3bae2 (diff) | |
download | vyconf-5cb1952f52a8a67905a9361364a0c0823d44ed03.tar.gz vyconf-5cb1952f52a8a67905a9361364a0c0823d44ed03.zip |
T7046: add request reload_reftree
Diffstat (limited to 'src/vyconf_client.ml')
-rw-r--r-- | src/vyconf_client.ml | 9 |
1 files changed, 9 insertions, 0 deletions
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 |