Skip to content

Commit

Permalink
Add agent service Address field to the api
Browse files Browse the repository at this point in the history
The Address field was introduced in hashicorp#570. This patch extends this to the api.
  • Loading branch information
sttts committed Jan 22, 2015
1 parent d478f78 commit d228777
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
14 changes: 8 additions & 6 deletions api/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type AgentService struct {
Service string
Tags []string
Port int
Address string
}

// AgentMember represents a cluster member known to the agent
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions api/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down

0 comments on commit d228777

Please sign in to comment.