Added ServiceMeta documentation in website source

pull/3881/head
Pierre Souchay 2018-02-11 14:12:41 +01:00
parent b259b1609c
commit 6022c7a209
4 changed files with 30 additions and 2 deletions

View File

@ -53,6 +53,9 @@ $ curl \
"Service": "redis", "Service": "redis",
"Tags": [], "Tags": [],
"Address": "", "Address": "",
"ServiceMeta": {
"redis_version": "4.0"
},
"Port": 8000 "Port": 8000
} }
} }
@ -96,6 +99,9 @@ The table below shows this endpoint's support for
provided, the agent's address is used as the address for the service during provided, the agent's address is used as the address for the service during
DNS queries. DNS queries.
- `ServiceMeta` `(map<string|string>: nil)` - Specifies arbitrary KV metadata
linked to the service instance.
- `Port` `(int: 0)` - Specifies the port of the service. - `Port` `(int: 0)` - Specifies the port of the service.
- `Check` `(Check: nil)` - Specifies a check. Please see the - `Check` `(Check: nil)` - Specifies a check. Please see the
@ -147,6 +153,9 @@ The table below shows this endpoint's support for
], ],
"Address": "127.0.0.1", "Address": "127.0.0.1",
"Port": 8000, "Port": 8000,
"ServiceMeta": {
"redis_version": "4.0"
},
"EnableTagOverride": false, "EnableTagOverride": false,
"Check": { "Check": {
"DeregisterCriticalServiceAfter": "90m", "DeregisterCriticalServiceAfter": "90m",

View File

@ -54,7 +54,7 @@ The table below shows this endpoint's support for
- `Service` `(Service: nil)` - Specifies to register a service. If `ID` is not - `Service` `(Service: nil)` - Specifies to register a service. If `ID` is not
provided, it will be defaulted to the value of the `Service.Service` property. provided, it will be defaulted to the value of the `Service.Service` property.
Only one service with a given `ID` may be present per node. The service Only one service with a given `ID` may be present per node. The service
`Tags`, `Address`, and `Port` fields are all optional. `Tags`, `Address`, `ServiceMeta` and `Port` fields are all optional.
- `Check` `(Check: nil)` - Specifies to register a check. The register API - `Check` `(Check: nil)` - Specifies to register a check. The register API
manipulates the health check entry in the Catalog, but it does not setup the manipulates the health check entry in the Catalog, but it does not setup the
@ -105,6 +105,9 @@ and vice versa. A catalog entry can have either, neither, or both.
"v1" "v1"
], ],
"Address": "127.0.0.1", "Address": "127.0.0.1",
"ServiceMeta": {
"redis_version": "4.0"
},
"Port": 8000 "Port": 8000
}, },
"Check": { "Check": {
@ -432,6 +435,9 @@ $ curl \
"ServiceID": "32a2a47f7992:nodea:5000", "ServiceID": "32a2a47f7992:nodea:5000",
"ServiceName": "foobar", "ServiceName": "foobar",
"ServicePort": 5000, "ServicePort": 5000,
"ServiceMeta": {
"foobar_meta_value": "baz"
},
"ServiceTags": [ "ServiceTags": [
"tacos" "tacos"
] ]
@ -467,6 +473,8 @@ $ curl \
- `ServiceName` is the name of the service - `ServiceName` is the name of the service
- `ServiceMeta` is a list of user-defined metadata key/value pairs for the service
- `ServicePort` is the port number of the service - `ServicePort` is the port number of the service
- `ServiceTags` is a list of tags for the service - `ServiceTags` is a list of tags for the service
@ -529,6 +537,7 @@ $ curl \
"ID": "consul", "ID": "consul",
"Service": "consul", "Service": "consul",
"Tags": null, "Tags": null,
"ServiceMeta": {},
"Port": 8300 "Port": 8300
}, },
"redis": { "redis": {
@ -537,6 +546,9 @@ $ curl \
"Tags": [ "Tags": [
"v1" "v1"
], ],
"ServiceMeta": {
"redis_version": "4.0"
},
"Port": 8000 "Port": 8000
} }
} }

View File

@ -216,6 +216,9 @@ $ curl \
"Service": "redis", "Service": "redis",
"Tags": ["primary"], "Tags": ["primary"],
"Address": "10.1.10.12", "Address": "10.1.10.12",
"ServiceMeta": {
"redis_version": "4.0"
},
"Port": 8000 "Port": 8000
}, },
"Checks": [ "Checks": [

View File

@ -241,6 +241,7 @@ The table below shows this endpoint's support for
"Near": "node1", "Near": "node1",
"OnlyPassing": false, "OnlyPassing": false,
"Tags": ["primary", "!experimental"], "Tags": ["primary", "!experimental"],
"ServiceMeta": {"redis_version": "4.0"},
"NodeMeta": {"instance_type": "m3.large"} "NodeMeta": {"instance_type": "m3.large"}
}, },
"DNS": { "DNS": {
@ -313,6 +314,7 @@ $ curl \
}, },
"OnlyPassing": false, "OnlyPassing": false,
"Tags": ["primary", "!experimental"], "Tags": ["primary", "!experimental"],
"ServiceMeta": {"redis_version": "4.0"},
"NodeMeta": {"instance_type": "m3.large"} "NodeMeta": {"instance_type": "m3.large"}
}, },
"DNS": { "DNS": {
@ -510,6 +512,7 @@ $ curl \
"ID": "redis", "ID": "redis",
"Service": "redis", "Service": "redis",
"Tags": null, "Tags": null,
"ServiceMeta": {"redis_version": "4.0"},
"Port": 8000 "Port": 8000
}, },
"Checks": [ "Checks": [
@ -616,6 +619,7 @@ $ curl \
}, },
"OnlyPassing": true, "OnlyPassing": true,
"Tags": ["primary"], "Tags": ["primary"],
"ServiceMeta": { "mysql_version": "5.7.20" },
"NodeMeta": {"instance_type": "m3.large"} "NodeMeta": {"instance_type": "m3.large"}
} }
} }