After registering a service in Consul (e.g. consul services register), how can you view the service definition?
consul services register
This is necessary because Nomad creates Consul Connect services, but it’s not possible to inspect how they work.
For example, the checks behind these:
Hi @ersch,
You can use the /v1/agent/service/:service_id API endpoint to get this information. This API takes the service ID as input, not the service name. If you wanted to execute this request using curl, the command would need to look something like this:
/v1/agent/service/:service_id
curl
$ curl --header "X-Consul-Token:$CONSUL_HTTP_TOKEN" \ --url "$CONSUL_HTTP_ADDR/v1/agent/service/_nomad_task-b8b48d32-6663-6b89-41a5-b9ac2d2dfa0e-group-webbgroup-webb-8202"