Add agent service Address field to the api

The Address field was introduced in #570. This patch extends this to the api.
This commit is contained in:
Dr. Stefan Schimanski 2015-01-22 10:24:50 +01:00
parent d478f786db
commit a85575dcaa
2 changed files with 12 additions and 9 deletions

View File

@ -22,6 +22,7 @@ type AgentService struct {
Service string Service string
Tags []string Tags []string
Port int Port int
Address string
} }
// AgentMember represents a cluster member known to the agent // AgentMember represents a cluster member known to the agent
@ -45,6 +46,7 @@ type AgentServiceRegistration struct {
Name string `json:",omitempty"` Name string `json:",omitempty"`
Tags []string `json:",omitempty"` Tags []string `json:",omitempty"`
Port int `json:",omitempty"` Port int `json:",omitempty"`
Address string `json:",omitempty"`
Check *AgentServiceCheck Check *AgentServiceCheck
Checks AgentServiceChecks Checks AgentServiceChecks
} }

View File

@ -48,6 +48,7 @@ func TestAgent_Services(t *testing.T) {
Name: "foo", Name: "foo",
Tags: []string{"bar", "baz"}, Tags: []string{"bar", "baz"},
Port: 8000, Port: 8000,
Address: "192.168.0.42",
Check: &AgentServiceCheck{ Check: &AgentServiceCheck{
TTL: "15s", TTL: "15s",
}, },