Skip to content

Instantly share code, notes, and snippets.

@aetheon
Created September 9, 2019 07:56
Show Gist options
  • Save aetheon/6c39e016412aba401ccb892e23092191 to your computer and use it in GitHub Desktop.
Save aetheon/6c39e016412aba401ccb892e23092191 to your computer and use it in GitHub Desktop.
Consul API examples
// GET /v1/health/service/video-call-core
[
{
"Node": {
"ID": "3879921a-38f3-b799-2429-66a60f7b7171",
"Node": "ip-172-31-73-146",
"Address": "172.31.73.146",
"Datacenter": "eu-west",
"TaggedAddresses": {
"lan": "172.31.73.146",
"wan": "172.31.73.146"
},
"Meta": {
"consul-network-segment": ""
},
"CreateIndex": 118,
"ModifyIndex": 119
},
"Service": {
"ID": "video-call-core",
"Service": "video-call-core",
"Tags": [
"media-server"
],
"Address": "",
"Meta": null,
"Port": 4567,
"Weights": {
"Passing": 1,
"Warning": 1
},
"EnableTagOverride": false,
"Proxy": {
"MeshGateway": {}
},
"Connect": {},
"CreateIndex": 119,
"ModifyIndex": 119
},
"Checks": [
{
"Node": "ip-172-31-73-146",
"CheckID": "serfHealth",
"Name": "Serf Health Status",
"Status": "passing",
"Notes": "",
"Output": "Agent alive and reachable",
"ServiceID": "",
"ServiceName": "",
"ServiceTags": [],
"Definition": {},
"CreateIndex": 118,
"ModifyIndex": 122
},
{
"Node": "ip-172-31-73-146",
"CheckID": "healthcheck",
"Name": "HTTP Healthcheck",
"Status": "critical",
"Notes": "",
"Output": "Get http://localhost:8080/healthcheck: dial tcp 127.0.0.1:8080: connect: connection refused",
"ServiceID": "video-call-core",
"ServiceName": "video-call-core",
"ServiceTags": [
"media-server"
],
"Definition": {},
"CreateIndex": 119,
"ModifyIndex": 144
}
]
},
{
"Node": {
"ID": "0024234a-4c01-a4cf-f4f0-302c73901a67",
"Node": "ip-172-31-78-219",
"Address": "172.31.78.219",
"Datacenter": "eu-west",
"TaggedAddresses": {
"lan": "172.31.78.219",
"wan": "172.31.78.219"
},
"Meta": {
"consul-network-segment": ""
},
"CreateIndex": 98,
"ModifyIndex": 99
},
"Service": {
"ID": "video-call-core",
"Service": "video-call-core",
"Tags": [
"media-server"
],
"Address": "",
"Meta": null,
"Port": 4567,
"Weights": {
"Passing": 1,
"Warning": 1
},
"EnableTagOverride": false,
"Proxy": {
"MeshGateway": {}
},
"Connect": {},
"CreateIndex": 99,
"ModifyIndex": 99
},
"Checks": [
{
"Node": "ip-172-31-78-219",
"CheckID": "serfHealth",
"Name": "Serf Health Status",
"Status": "passing",
"Notes": "",
"Output": "Agent alive and reachable",
"ServiceID": "",
"ServiceName": "",
"ServiceTags": [],
"Definition": {},
"CreateIndex": 98,
"ModifyIndex": 98
},
{
"Node": "ip-172-31-78-219",
"CheckID": "healthcheck",
"Name": "HTTP Healthcheck",
"Status": "critical",
"Notes": "",
"Output": "Get http://localhost:8080/healthcheck: dial tcp 127.0.0.1:8080: connect: connection refused",
"ServiceID": "video-call-core",
"ServiceName": "video-call-core",
"ServiceTags": [
"media-server"
],
"Definition": {},
"CreateIndex": 99,
"ModifyIndex": 126
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment