diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-05-21 22:25:33 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-05-21 22:25:33 +0200 |
commit | 8c43611eb5bbaeb42f19da8d8ed521df208bfada (patch) | |
tree | c207e950744f451424e139e97aaf852c2d8ff949 /README.md | |
parent | 4da459ce8ba49f98084a8ce32f600470ff883ec5 (diff) | |
download | diplonat-8c43611eb5bbaeb42f19da8d8ed521df208bfada.tar.gz diplonat-8c43611eb5bbaeb42f19da8d8ed521df208bfada.zip |
Broken Diplonat
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -21,3 +21,27 @@ export DIPLONAT_CONSUL_NODE_NAME="lheureduthe" export RUST_LOG=debug cargo run ``` + +## About Consul Catalog + + * We query the `/v1/catalog/node/<node>` endpoint + * We can watch it thanks to [Blocking Queries](https://www.consul.io/api/features/blocking.html) + +eg: + +```bash +curl -vvv http://127.0.0.1:8500/v1/catalog/node/lheureduthe +# returns X-Consul-Index: 15 +curl -vvv http://127.0.0.1:8500/v1/catalog/node/lheureduthe?index=15 +``` + +Each time you do the request, the whole list of services bound to the node is returned. + + +To test the Consul Catalog part, you can do: + +```bash +consul agent -dev #in a separate terminal, if not already running +consul services register -name=example -port=1337 +consul services -id=example +``` |