diff --git a/api/agent.go b/api/agent.go index 08b1441333c6..53ea191a7bb4 100644 --- a/api/agent.go +++ b/api/agent.go @@ -22,6 +22,7 @@ type AgentService struct { Service string Tags []string Port int + Address string } // AgentMember represents a cluster member known to the agent @@ -41,12 +42,13 @@ type AgentMember struct { // AgentServiceRegistration is used to register a new service type AgentServiceRegistration struct { - ID string `json:",omitempty"` - Name string `json:",omitempty"` - Tags []string `json:",omitempty"` - Port int `json:",omitempty"` - Check *AgentServiceCheck - Checks AgentServiceChecks + ID string `json:",omitempty"` + Name string `json:",omitempty"` + Tags []string `json:",omitempty"` + Port int `json:",omitempty"` + Address string `json:",omitempty"` + Check *AgentServiceCheck + Checks AgentServiceChecks } // AgentCheckRegistration is used to register a new check diff --git a/api/agent_test.go b/api/agent_test.go index e27887d6f85d..1af8c090d00e 100644 --- a/api/agent_test.go +++ b/api/agent_test.go @@ -45,9 +45,10 @@ func TestAgent_Services(t *testing.T) { agent := c.Agent() reg := &AgentServiceRegistration{ - Name: "foo", - Tags: []string{"bar", "baz"}, - Port: 8000, + Name: "foo", + Tags: []string{"bar", "baz"}, + Port: 8000, + Address: "192.168.0.42", Check: &AgentServiceCheck{ TTL: "15s", },