From 89c5fcabf782828d50f8e2c8ec733b11544f37ce Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 9 Mar 2016 16:42:15 -0800 Subject: [PATCH] Adds a reference to the health endpoint in the intro. Fixes #1739. --- .../intro/getting-started/services.html.markdown | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/website/source/intro/getting-started/services.html.markdown b/website/source/intro/getting-started/services.html.markdown index 413e3f7ad9..2124b99732 100644 --- a/website/source/intro/getting-started/services.html.markdown +++ b/website/source/intro/getting-started/services.html.markdown @@ -140,6 +140,17 @@ $ curl http://localhost:8500/v1/catalog/service/web "ServiceName":"web","ServiceTags":["rails"],"ServicePort":80}] ``` +The catalog API gives all nodes hosting a given service. As we will see later +with [health checks](/intro/getting-started/checks.html) you'll typically want +to query just for healthy instances where the checks are passing. This is what +DNS is doing under the hood. Here's a query to look for only healthy instances: + +```text +$ curl 'http://localhost:8500/v1/health/service/web?passing' +[{"Node":"Armons-MacBook-Air","Address":"172.20.20.11","Service":{ \ + "ID":"web", "Service":"web", "Tags":["rails"],"Port":80}, "Checks": ...}] +``` + ## Updating Services Service definitions can be updated by changing configuration files and