File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -122,11 +122,16 @@ module Upstream = struct
122122 let list ng =
123123 do_api8_get_req ng [ " http" ; " upstreams" ] (fun resp -> List. map snd (Nginx_j. upstream_collection_of_string resp))
124124
125+ (* * Fetch a list of all upstreams configured (with names) *)
126+ let list_with_names ng =
127+ let to_upstream (nm , us ) = (upstream_id nm, us) in
128+ do_api8_get_req ng [ " http" ; " upstreams" ] (fun resp -> List. map to_upstream (Nginx_j. upstream_collection_of_string resp))
129+
125130 (* val get : nginx -> upstream_id -> t r *)
126131
127132 (* * Fetch state and configuration of the given upstream *)
128133 let get ng upstr_id =
129- do_api8_get_req ng [ " http" ; " upstreams" ; upstr_id ] ( fun ( str : string ) -> Nginx_j. upstream_of_string str)
134+ do_api8_get_req ng [ " http" ; " upstreams" ; upstr_id ] Nginx_j. upstream_of_string
130135
131136 (* val reset : nginx -> upstream_id -> unit r *)
132137
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ module Upstream : sig
4444
4545 val upstream_id : string -> upstream_id
4646
47+ (* * Fetch a list of all upstreams configured (with names) *)
48+ val list_with_names : nginx -> (upstream_id * t ) list r
49+
4750 (* * Fetch a list of all upstreams configured *)
4851 val list : nginx -> t list r
4952
You can’t perform that action at this time.
0 commit comments