From 1abce8cddf33d6d2db37736910a3e85aa280a4b0 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Thu, 8 Jan 2015 12:08:29 -0800 Subject: [PATCH] website: Updating the documentation --- website/source/docs/agent/http.html.markdown | 9 +++++++-- website/source/docs/agent/services.html.markdown | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/website/source/docs/agent/http.html.markdown b/website/source/docs/agent/http.html.markdown index 008a17b8f0..e82abc6527 100644 --- a/website/source/docs/agent/http.html.markdown +++ b/website/source/docs/agent/http.html.markdown @@ -283,6 +283,7 @@ This endpoint is hit with a GET and returns a JSON body like this: "ID": "redis", "Service": "redis", "Tags": null, + "Address": "", "Port": 8000 } } @@ -502,6 +503,7 @@ body must look like: "master", "v1" ], + "Address": "127.0.0.1", "Port": 8000, "Check": { "Script": "/usr/local/bin/check_redis.py", @@ -513,8 +515,9 @@ body must look like: The `Name` field is mandatory, If an `ID` is not provided, it is set to `Name`. You cannot have duplicate `ID` entries per agent, so it may be necessary to provide an ID. -`Tags`, `Port` and `Check` are optional. If `Check` is provided, only one of `Script` and `Interval` +`Tags`, `Address`, `Port` and `Check` are optional. If `Check` is provided, only one of `Script` and `Interval` or `TTL` should be provided. There is more information about checks [here](/docs/agent/checks.html). +The `Address` will default to that of the agent if not provided. The created check will be named "service:\". @@ -568,6 +571,7 @@ body must look like: "master", "v1" ], + "Address": "127.0.0.1", "Port": 8000 }, "Check": { @@ -588,7 +592,7 @@ the node with the catalog. If the `Service` key is provided, then the service will also be registered. If `ID` is not provided, it will be defaulted to `Service`. It is mandated that the -ID be node-unique. Both `Tags` and `Port` can be omitted. +ID be node-unique. The `Tags`, `Address` and `Port` fields can be omitted. If the `Check` key is provided, then a health check will also be registered. It is important to remember that this register API is very low level. This manipulates @@ -732,6 +736,7 @@ It returns a JSON body like this: "ServiceID": "redis", "ServiceName": "redis", "ServiceTags": null, + "ServiceAddress": "", "ServicePort": 8000 } ] diff --git a/website/source/docs/agent/services.html.markdown b/website/source/docs/agent/services.html.markdown index ad66da571a..2a4bce7a5f 100644 --- a/website/source/docs/agent/services.html.markdown +++ b/website/source/docs/agent/services.html.markdown @@ -24,6 +24,7 @@ A service definition that is a script looks like: "service": { "name": "redis", "tags": ["master"], + "address": "127.0.0.1", "port": 8000, "check": { "script": "/usr/local/bin/check_redis.py", @@ -34,12 +35,14 @@ A service definition that is a script looks like: ``` A service definition must include a `name`, and may optionally provide -an `id`, `tags`, `port`, and `check`. The `id` is set to the `name` if not +an `id`, `tags`, `address`, `port`, and `check`. The `id` is set to the `name` if not provided. It is required that all services have a unique ID per node, so if names might conflict then unique ID's should be provided. The `tags` is a list of opaque value to Consul, but can be used to distinguish between "master" or "slave" nodes, different versions, or any other service level labels. +The `address` can be used to specify a service specific IP address. By default, +the IP address of the agent is used, and this does not need to be provided. The `port` can be used as well to make a service oriented architecture simpler to configure. This way the address and port of a service can be discovered. @@ -76,6 +79,7 @@ Multiple services definitions can be provided at once using the `services` "tags": [ "master" ], + "address": "127.0.0.1", "port": 6000, "check": { "script": "/bin/check_redis -p 6000", @@ -90,6 +94,7 @@ Multiple services definitions can be provided at once using the `services` "delayed", "slave" ], + "address": "127.0.0.1", "port": 7000, "check": { "script": "/bin/check_redis -p 7000",