Skip to content

Instantly share code, notes, and snippets.

@YEMEAC
Created October 5, 2018 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YEMEAC/9a0d8938a38a1722ad3b956cc57fbe97 to your computer and use it in GitHub Desktop.
Save YEMEAC/9a0d8938a38a1722ad3b956cc57fbe97 to your computer and use it in GitHub Desktop.
register and delete service in consul with curl
curl -X PUT \
http://127.0.0.1:8500/v1/catalog/register \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 9aa3163f-31b9-8c8f-f9cd-6feaca81d4ce' \
-d '{
"Datacenter": "dc1",
"Node": "externalServices",
"Address": "172.30.50.59",
"Service": {
"ID": "transporter-service",
"Service": "transporter-service",
"Address": "172.30.50.59",
"Port": 29487
},
"Check": {
"Node": "externalServices",
"CheckID": "service:transporter-service",
"Status": "passing",
"ServiceID": "transporter-service"
}
}'
curl -X PUT \
http://127.0.0.1:8500/v1/catalog/deregister \
-d '{
"ServiceID": "transporter-Service",
"node": "externalServices"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment