diff --git a/command/agent/http.go b/command/agent/http.go index 350862cae4..117defbcf7 100644 --- a/command/agent/http.go +++ b/command/agent/http.go @@ -491,7 +491,7 @@ func (s *HTTPServer) parseToken(req *http.Request, token *string) { func (s *HTTPServer) parseSource(req *http.Request, source *structs.QuerySource) { s.parseDC(req, &source.Datacenter) if node := req.URL.Query().Get("near"); node != "" { - if node == "self" { + if node == "_agent" { source.Node = s.agent.config.NodeName } else { source.Node = node diff --git a/command/agent/http_test.go b/command/agent/http_test.go index 1b39e68116..545ad0742c 100644 --- a/command/agent/http_test.go +++ b/command/agent/http_test.go @@ -381,9 +381,9 @@ func TestParseSource(t *testing.T) { t.Fatalf("bad: %v", source) } - // The magic "self" node name will use the agent's local node name. + // The magic "_agent" node name will use the agent's local node name. req, err = http.NewRequest("GET", - "/v1/catalog/nodes?near=self", nil) + "/v1/catalog/nodes?near=_agent", nil) if err != nil { t.Fatalf("err: %v", err) } diff --git a/website/source/docs/agent/http/catalog.html.markdown b/website/source/docs/agent/http/catalog.html.markdown index 300e8b008a..323166f387 100644 --- a/website/source/docs/agent/http/catalog.html.markdown +++ b/website/source/docs/agent/http/catalog.html.markdown @@ -181,7 +181,7 @@ however, the dc can be provided using the "?dc=" query parameter. Adding the optional "?near=" parameter with a node name will sort the node list in ascending order based on the estimated round trip -time from that node. Passing "?near=self" will use the agent's local +time from that node. Passing "?near=_agent" will use the agent's node for the sort. It returns a JSON body like this: @@ -237,7 +237,7 @@ by tag using the "?tag=" query parameter. Adding the optional "?near=" parameter with a node name will sort the node list in ascending order based on the estimated round trip -time from that node. Passing "?near=self" will use the agent's local +time from that node. Passing "?near=_agent" will use the agent's node for the sort. It returns a JSON body like this: diff --git a/website/source/docs/agent/http/health.html.markdown b/website/source/docs/agent/http/health.html.markdown index e1321b3d7d..6e8ba7b1a6 100644 --- a/website/source/docs/agent/http/health.html.markdown +++ b/website/source/docs/agent/http/health.html.markdown @@ -72,7 +72,7 @@ however, the dc can be provided using the "?dc=" query parameter. Adding the optional "?near=" parameter with a node name will sort the node list in ascending order based on the estimated round trip -time from that node. Passing "?near=self" will use the agent's local +time from that node. Passing "?near=_agent" will use the agent's node for the sort. It returns a JSON body like this: @@ -102,7 +102,7 @@ however, the dc can be provided using the "?dc=" query parameter. Adding the optional "?near=" parameter with a node name will sort the node list in ascending order based on the estimated round trip -time from that node. Passing "?near=self" will use the agent's local +time from that node. Passing "?near=_agent" will use the agent's node for the sort. By default, all nodes matching the service are returned. The list can be filtered @@ -171,7 +171,7 @@ however, the dc can be provided using the "?dc=" query parameter. Adding the optional "?near=" parameter with a node name will sort the node list in ascending order based on the estimated round trip -time from that node. Passing "?near=self" will use the agent's local +time from that node. Passing "?near=_agent" will use the agent's node for the sort. The supported states are `any`, `unknown`, `passing`, `warning`, or `critical`.