docs(discovery/service): Clarify multiple service definitions

Be more explicit that the definition of multiple services only works in config files,
not using the HTTP API.

Ref: https://discuss.hashicorp.com/t/register-multiple-services-via-put-request/
This commit is contained in:
Frederic Hemberger 2021-04-29 19:39:11 +02:00 committed by Blake Covarrubias
parent 00d3283e93
commit 9a5a0ba209

View File

@ -27,8 +27,8 @@ To configure a service, either provide the service definition as a
`-config-file` option to the agent or place it inside the `-config-dir` of the `-config-file` option to the agent or place it inside the `-config-dir` of the
agent. The file must end in the `.json` or `.hcl` extension to be loaded by agent. The file must end in the `.json` or `.hcl` extension to be loaded by
Consul. Check definitions can be updated by sending a `SIGHUP` to the agent. Consul. Check definitions can be updated by sending a `SIGHUP` to the agent.
Alternatively, the service can be registered dynamically using the [HTTP Alternatively, the service can be [registered dynamically](/api-docs/agent/service#register-service)
API](/api). using the [HTTP API](/api).
A service definition is a configuration that looks like the following. This A service definition is a configuration that looks like the following. This
example shows all possible fields, but note that only a few are required. example shows all possible fields, but note that only a few are required.
@ -71,7 +71,7 @@ example shows all possible fields, but note that only a few are required.
"mode": "transparent", "mode": "transparent",
"transparent_proxy": { "transparent_proxy": {
"outbound_listener_port": 22500 "outbound_listener_port": 22500
} },
"config": {}, "config": {},
"upstreams": [], "upstreams": [],
"mesh_gateway": { "mesh_gateway": {
@ -275,8 +275,9 @@ deprecated and has been removed as of Consul 1.1.
## Multiple Service Definitions ## Multiple Service Definitions
Multiple services definitions can be provided at once using the plural Multiple services definitions can be provided at once when registering services
`services` key in your configuration file. via the agent configuration by using the plural `services` key (registering
multiple services in this manner is not supported using the HTTP API).
```javascript ```javascript
{ {