Skip to content

Commit 09aa2d9

Browse files
committed
Returns services in JSON format through the /config endpoint.
1 parent bd2890e commit 09aa2d9

12 files changed

+293
-116
lines changed

actions/reconfigure_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,11 @@ func (m *ProxyMock) RemoveService(service string) {
924924
m.Called(service)
925925
}
926926

927+
func (m *ProxyMock) GetServices() map[string]proxy.Service {
928+
params := m.Called()
929+
return params.Get(0).(map[string]proxy.Service)
930+
}
931+
927932
func (m *ProxyMock) GetCertPaths() []string {
928933
params := m.Called()
929934
return params.Get(0).([]string)
@@ -955,6 +960,9 @@ func getProxyMock(skipMethod string) *ProxyMock {
955960
if skipMethod != "RemoveService" {
956961
mockObj.On("RemoveService", mock.Anything)
957962
}
963+
if skipMethod != "GetServices" {
964+
mockObj.On("GetServices")
965+
}
958966
if skipMethod != "GetCertPaths" {
959967
mockObj.On("GetCertPaths")
960968
}

docs/usage.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ HEALTHCHECK --interval=5s --timeout=5s CMD wget -qO- "http://localhost:8080/v1/d
231231

232232
> Outputs HAProxy configuration
233233
234-
The address is **[PROXY_IP]:[PROXY_PORT]/v1/docker-flow-proxy/config**
234+
The following query arguments can be used to send a *reload* request to *Docker Flow Proxy*. They should be added to the base address **[PROXY_IP]:[PROXY_PORT]/v1/docker-flow-proxy/config**.
235+
236+
|Query |Description |
237+
|-----------|-----------------------------------------------------------|
238+
|type |If set to `json`, the list of services is returned in JSON format. Any other value returns HAProxy configuration in text format.<br>**Default:** `text`<br>**Example:** `json`|
235239

236240
## Templates
237241

0 commit comments

Comments
 (0)