Consul
Exported Services HTTP Endpoint
Note
The exported services HTTP API endpoint requires Consul v1.17.3 or newer.The /exported-services
endpoint returns a list of exported services, as well as the admin partitions and cluster peers that consume the services.
This list consists of the services that were exported using an exported-services
configuration entry. Sameness groups and wildcards in the configuration entry are expanded in the response.
List Exported Services
This endpoint returns a list of exported services.
Method | Path | Produces |
---|---|---|
GET | /exported-services | application/json |
The table below shows this endpoint's support for blocking queries, consistency modes, agent caching, and required ACLs.
Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
---|---|---|---|
YES | none | none | mesh:read or operator:read |
Query Parameters
partition
(string: "")
Enterprise - The partition to use. If not provided, the partition is inferred from the request's ACL token, or defaults to thedefault
partition.
Sample Request
$ curl --header "X-Consul-Token: 0137db51-5895-4c25-b6cd-d9ed992f4a52" \
http://127.0.0.1:8500/v1/exported-services
Sample Response
[
{
"Service": "frontend",
"Consumers": {
"Peers": [
"east",
"west",
]
}
},
{
"Service": "db",
"Consumers": {
"Peers": [
"east",
]
}
},
{
"Service": "web",
"Consumers": {
"Peers": [
"east",
"west"
]
}
}
]