Skip to content

Commit

Permalink
Returns services in JSON format through the /config endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
vfarcic committed Jul 24, 2017
1 parent bd2890e commit 09aa2d9
Show file tree
Hide file tree
Showing 12 changed files with 293 additions and 116 deletions.
8 changes: 8 additions & 0 deletions actions/reconfigure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,11 @@ func (m *ProxyMock) RemoveService(service string) {
m.Called(service)
}

func (m *ProxyMock) GetServices() map[string]proxy.Service {
params := m.Called()
return params.Get(0).(map[string]proxy.Service)
}

func (m *ProxyMock) GetCertPaths() []string {
params := m.Called()
return params.Get(0).([]string)
Expand Down Expand Up @@ -955,6 +960,9 @@ func getProxyMock(skipMethod string) *ProxyMock {
if skipMethod != "RemoveService" {
mockObj.On("RemoveService", mock.Anything)
}
if skipMethod != "GetServices" {
mockObj.On("GetServices")
}
if skipMethod != "GetCertPaths" {
mockObj.On("GetCertPaths")
}
Expand Down
6 changes: 5 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ HEALTHCHECK --interval=5s --timeout=5s CMD wget -qO- "http://localhost:8080/v1/d

> Outputs HAProxy configuration
The address is **[PROXY_IP]:[PROXY_PORT]/v1/docker-flow-proxy/config**
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**.

|Query |Description |
|-----------|-----------------------------------------------------------|
|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`|

## Templates

Expand Down
Loading

0 comments on commit 09aa2d9

Please sign in to comment.