diff --git a/discovery/token/README.md b/discovery/token/README.md index 78d6cc7f2c..8088169f1d 100644 --- a/discovery/token/README.md +++ b/discovery/token/README.md @@ -10,11 +10,11 @@ The discovery service is still in alpha stage and currently hosted at `https://d `<- ` #####Add new nodes to a cluster -`-> POST https://discovery-stage.hub.docker.com/v1/clusters/ Request body: ":"` +`-> POST https://discovery-stage.hub.docker.com/v1/clusters/?ttl= Request body: ":"` `<- OK` -`-> POST https://discovery-stage.hub.docker.com/v1/clusters/ Request body: ":")` +`-> POST https://discovery-stage.hub.docker.com/v1/clusters/?ttl= Request body: ":")` `<- OK` diff --git a/discovery/token/token.go b/discovery/token/token.go index 71f03b7179..455b43565e 100644 --- a/discovery/token/token.go +++ b/discovery/token/token.go @@ -119,8 +119,8 @@ func (s *Discovery) Watch(stopCh <-chan struct{}) (<-chan discovery.Entries, <-c func (s *Discovery) Register(addr string) error { buf := strings.NewReader(addr) - resp, err := http.Post(fmt.Sprintf("%s/%s/%s", s.url, - "clusters", s.token), "application/json", buf) + resp, err := http.Post(fmt.Sprintf("%s/%s/%s?ttl=%d", s.url, + "clusters", s.token, uint64(s.ttl.Seconds())), "application/json", buf) if err != nil { return err