mirror of https://github.com/status-im/consul.git
Added documentation for meta
This commit is contained in:
parent
eccc223480
commit
4c1ddbd0d5
|
@ -25,6 +25,9 @@ A service definition is a script that looks like:
|
||||||
"name": "redis",
|
"name": "redis",
|
||||||
"tags": ["primary"],
|
"tags": ["primary"],
|
||||||
"address": "",
|
"address": "",
|
||||||
|
"meta": {
|
||||||
|
"meta": "for my service"
|
||||||
|
}
|
||||||
"port": 8000,
|
"port": 8000,
|
||||||
"enable_tag_override": false,
|
"enable_tag_override": false,
|
||||||
"checks": [
|
"checks": [
|
||||||
|
@ -38,8 +41,8 @@ A service definition is a script that looks like:
|
||||||
```
|
```
|
||||||
|
|
||||||
A service definition must include a `name` and may optionally provide an
|
A service definition must include a `name` and may optionally provide an
|
||||||
`id`, `tags`, `address`, `port`, `check`, and `enable_tag_override`. The
|
`id`, `tags`, `address`, `port`, `check`, `meta` and `enable_tag_override`.
|
||||||
`id` is set to the `name` if not provided. It is required that all
|
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
|
services have a unique ID per node, so if names might conflict then
|
||||||
unique IDs should be provided.
|
unique IDs should be provided.
|
||||||
|
|
||||||
|
@ -57,6 +60,13 @@ The `port` field can be used as well to make a service-oriented architecture
|
||||||
simpler to configure; this way, the address and port of a service can
|
simpler to configure; this way, the address and port of a service can
|
||||||
be discovered.
|
be discovered.
|
||||||
|
|
||||||
|
The `meta` object is a map of max 64 key/values with string semantics. Key can contain
|
||||||
|
only ASCII chars and no special characters (`A-Z` `a-z` `0-9` `_` and `-`, no `.`).
|
||||||
|
For performance and security reasons, values as well as keys are limited to 128
|
||||||
|
characters for keys, 512 for values, it has the same limitations as the node meta
|
||||||
|
keys. All those meta data can be retrieved individually per instance of the service
|
||||||
|
and all the instances of a given service have their own copy of it.
|
||||||
|
|
||||||
Services may also contain a `token` field to provide an ACL token. This token is
|
Services may also contain a `token` field to provide an ACL token. This token is
|
||||||
used for any interaction with the catalog for the service, including
|
used for any interaction with the catalog for the service, including
|
||||||
[anti-entropy syncs](/docs/internals/anti-entropy.html) and deregistration.
|
[anti-entropy syncs](/docs/internals/anti-entropy.html) and deregistration.
|
||||||
|
|
Loading…
Reference in New Issue